Move process access rights from winKernel to winBindings.kernel32 - #20836
Open
SaschaCowley wants to merge 4 commits into
Open
Move process access rights from winKernel to winBindings.kernel32#20836SaschaCowley wants to merge 4 commits into
SaschaCowley wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Follow-up to #20784
Summary of the issue:
The ART project uses the
PROCESS_DUP_HANDLEprocess access right. While that constant is not defined in NVDA, other process access rights are. In order to keepmasterandtry-art-stagingin sync as much as practical, this PR moves the existing process access rights fromwinKerneltowinBindings.kernel32.Description of user facing changes:
None.
Description of developer facing changes:
The
winKernel.PROCESS_*process access rights are deprecated, and thewinBindings.kernel32.PROCESS.enum members should be used instead.Description of development approach:
Removed
PROCESS_*constants fromwinKerneltowinBindings.kernel32, adding them to aPROCESSIntEnumtherein. Checked the definitions against the official Microsoft documentation. Also added thePROCESS_DUP_HANDLEprocess access right, which is currently not needed by NVDA, as was done for theDUPLICATE_CLOSE_SOURCEconstant.For all but
PROCESS_ALL_ACCESS, addedMovedSymbolentries toWinKernel's deprecation table. I addedPROCESS_ALL_ACCESSas a removed symbol as its value has changed: pre-Vista,PROCESS_ALL_ACCESSwasSTANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFF, but from Vista onward, it isSTANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFFF. I'm not sure what the behaviour of the access right sans the modern0x0000F000is 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_READorPROCESS_VM_WRITEin NVDA itself.As mentioned above, the existing value of
PROCESS_ALL_ACCESSis 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: