-
-
Notifications
You must be signed in to change notification settings - Fork 745
Move all remaining kernel32 ctypes calls to winBindings #18896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…replace all raw ctypes calls. Also move some structures where required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR moves all remaining kernel32 ctypes calls to the winBindings module. The purpose is to replace raw ctypes calls to kernel32 with properly defined functions in winBindings.kernel32, ensuring correct execution on 64-bit systems and providing better type safety.
Key changes include:
- Adding comprehensive kernel32 function definitions to winBindings.kernel32
- Replacing raw ctypes calls throughout the codebase with winBindings equivalents
- Moving related structures (SYSTEMTIME, FILETIME, TIME_ZONE_INFORMATION, etc.) to winBindings.kernel32
Reviewed Changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| source/winBindings/kernel32.py | Adds hundreds of kernel32 function definitions with proper type annotations and documentation |
| source/winKernel.py | Replaces raw ctypes calls with winBindings equivalents and moves structures |
| source/languageHandler.py | Updates locale-related function calls to use winBindings |
| source/wincon.py | Replaces console API calls and moves structures |
| Various other files | Updates scattered kernel32 calls throughout the codebase |
Comments suppressed due to low confidence (1)
source/winBindings/kernel32.py:1
- Extra space after 'PAPCFUNC' in the all tuple.
# A part of NonVisual Desktop Access (NVDA)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…ed outside of NVDA.
|
Could you please also update changes.md? At present, the API changes I noted when reviewing were:
|
Co-authored-by: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…LAPPED_COMPLETION_ROUTINE to match Microsoft docs. Remove duplicate struct from hwIo.ioThread and deprecate as a moved symbol to winBindigns.kernel32.
Co-authored-by: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com>
…ed from within itself.
…PCROUTINE, but it is optional. Unfortunablely ctypes does not allow this, so it must be c_void_p so the caller, such as in watchdog.py can pass in None.
Co-authored-by: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com>
…watchdog: change calls to SetWaitableTimer to use the correct null function pointer
SaschaCowley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of small new things. Please note that the following comments remain unresolved:
source/winBindings/kernel32.py line 420
source/winBindings/kernel32.py line 455
source/wincon.py lines 11-14
source/wincon.py line 30
Co-authored-by: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com>
Link to issue number:
None.
Summary of the issue:
There are still many raw ctypes calls to kernel32 functions in the code base. These must be moved to winBindings, with correct definitions per Microsoft documentation to ensure accurate execution on 64 bit.
Description of user facing changes:
None.
Description of developer facing changes:
Description of development approach:
Add all required kernel32 definitions to winBindings, verifying each against Microsoft Documentation.
Replace the raw ctypes calls through out the code base with the winBindings definitions.
Any ctypes structures required by these definitions have also been moved to winBindings, and appropriate deprecation code added.
Testing strategy:
General smoke testing of an installed binary copy.
Known issues with pull request:
None known.
Code Review Checklist: