Skip to content

Move process access rights from winKernel to winBindings.kernel32 - #20836

Open
SaschaCowley wants to merge 4 commits into
masterfrom
winKernel-to-kernel32
Open

Move process access rights from winKernel to winBindings.kernel32#20836
SaschaCowley wants to merge 4 commits into
masterfrom
winKernel-to-kernel32

Conversation

@SaschaCowley

@SaschaCowley SaschaCowley commented Sep 11, 2026

Copy link
Copy Markdown
Member

Link to issue number:

Follow-up to #20784

Summary of the issue:

The ART project uses the PROCESS_DUP_HANDLE process access right. While that constant is not defined in NVDA, other process access rights are. In order to keep master and try-art-staging in sync as much as practical, this PR moves the existing process access rights from winKernel to winBindings.kernel32.

Description of user facing changes:

None.

Description of developer facing changes:

The winKernel.PROCESS_* process access rights are deprecated, and the winBindings.kernel32.PROCESS. enum members should be used instead.

Description of development approach:

Removed PROCESS_* constants from winKernel to winBindings.kernel32, adding them to a PROCESS IntEnum therein. Checked the definitions against the official Microsoft documentation. Also added the PROCESS_DUP_HANDLE process access right, which is currently not needed by NVDA, as was done for the DUPLICATE_CLOSE_SOURCE constant.

For all but PROCESS_ALL_ACCESS, added MovedSymbol entries to WinKernel's deprecation table. I added PROCESS_ALL_ACCESS as a removed symbol as its value has changed: pre-Vista, PROCESS_ALL_ACCESS was STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFF, but from Vista onward, it is STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFFF. I'm not sure what the behaviour of the access right sans the modern 0x0000F000 is on Windows 10 and 11. Not that it matters, but using the new format on pre-Vista systems will cause an error.

Testing strategy:

Unit/system tests.

When running alpha-57818,dd2bccb3 (2027.1.0.57818), copied the result of executing the following in the Python console to the clipboard: import winKernel; {sym: getattr(winKernel, sym) for sym in dir(winKernel) if sym.startswith("PROCESS_")}.

Ran from source and checked that running the following in the Python console returned True, replacing {} with the previously copied value: import winKernel; all(getattr(winKernel, k) == v for k, v in {}.items()).

Known issues with pull request:

As far as I can tell, there are no consumers of PROCESS_ALL_ACCESS, PROCESS_VM_OPERATION, PROCESS_VM_READ or PROCESS_VM_WRITE in NVDA itself.

As mentioned above, the existing value of PROCESS_ALL_ACCESS is incorrect for all supported Windows versions. I do not know what the real-world impact of just switching to the modern format of this would be, given NVDA is not supported on pre-Vista versions of Windows.

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
  • [s] API is compatible with existing add-ons.
  • Security precautions taken.

@SaschaCowley
SaschaCowley marked this pull request as ready for review September 11, 2026 08:37
@SaschaCowley
SaschaCowley requested a review from a team as a code owner September 11, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant