Skip to content

Fix UWP OCR on 64 bit NVDA#18858

Merged
SaschaCowley merged 18 commits into
masterfrom
fixUwpOcr
Sep 8, 2025
Merged

Fix UWP OCR on 64 bit NVDA#18858
SaschaCowley merged 18 commits into
masterfrom
fixUwpOcr

Conversation

@SaschaCowley

@SaschaCowley SaschaCowley commented Sep 3, 2025

Copy link
Copy Markdown
Member

Link to issue number:

None

Summary of the issue:

Windows OCR doesn't work on 64 bit builds of NVDA.

Description of user facing changes:

Windows OCR works on 64-bit builds of NVDA.

Description of developer facing changes:

Deprecations

Description of development approach:

  • Fix up ctypes definitions for functions exported by nvdaHelperLocalWin10.dll that were causing problems
  • Move said ctypes definitions to a new NVDAHelper.localWin10 module

Testing strategy:

Recognise text (NVDA welcome dialog) on:

  • 64-bit source copy
  • 32-bit source copy
  • 64-bit portable copy
  • 32-bit portable copy

Known issues with pull request:

I have not moved all ctypes definitions for functions exported by nvdaHelperLocalWin10.dll to NVDAHelper.localWin10. I believe this is best done in a separate PR, to allow this bugfix to be merged sooner than later.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@SaschaCowley SaschaCowley marked this pull request as ready for review September 5, 2025 03:17
Copilot AI review requested due to automatic review settings September 5, 2025 03:17
@SaschaCowley SaschaCowley requested a review from a team as a code owner September 5, 2025 03:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes Windows OCR functionality on 64-bit NVDA builds by correcting ctypes definitions and reorganizing code structure.

  • Creates a new NVDAHelper.localWin10 module with properly defined ctypes for Win10 helper DLL functions
  • Refactors UWP OCR code to use the new module instead of inline ctypes definitions
  • Adds deprecation warnings for moved/removed symbols

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
user_docs/en/changes.md Documents deprecation of bstrReturn and uwpOcr_Callback
source/screenBitmap.py Adds parentheses to fix operator precedence in array size calculation
source/contentRecog/uwpOcr.py Refactors to use new NVDAHelper.localWin10 module imports
source/NVDAHelper/localWin10.py New module with proper ctypes definitions for Win10 helper DLL
source/NVDAHelper/init.py Moves and deprecates bstrReturn function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread source/NVDAHelper/localWin10.py Outdated
Comment thread source/NVDAHelper/localWin10.py Outdated
Comment thread source/NVDAHelper/localWin10.py Outdated
Comment thread source/NVDAHelper/localWin10.py Outdated
Comment thread source/screenBitmap.py
Comment thread source/NVDAHelper/__init__.py Outdated
Comment thread source/contentRecog/uwpOcr.py Outdated
@SaschaCowley SaschaCowley merged commit ac783ef into master Sep 8, 2025
112 of 114 checks passed
@SaschaCowley SaschaCowley deleted the fixUwpOcr branch September 8, 2025 00:23
@github-actions github-actions Bot added this to the 2026.1 milestone Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants