And more winBindings#18860
Conversation
…Information from advapi32.dll. Completing all required functions from this dll. Also moved STARTUPINFO and PROCESS_INFORMATION structures from winKernel to winBindings.advapi32
…g it up in msftedi.dll. It never changes.
…ExecutInfo structure from shlobj to winBindings.shell32.
…structures from wingdi.py to winBindings.gdiplus
There was a problem hiding this comment.
Pull Request Overview
This PR continues the ongoing effort to replace raw ctypes calls with properly typed winBindings definitions to improve 64-bit compatibility. The PR adds and utilizes winBindings definitions for multiple Windows DLLs including shlwapi, gdi32, mshtml, urlmon, wtsapi32, winmm, advapi32, version, shell32, and gdiplus.
Key changes include:
- Addition of new winBindings modules for various Windows DLLs with proper function signatures and structures
- Migration of existing code from raw ctypes calls to use the new winBindings definitions
- Movement of some structures from legacy modules to winBindings with deprecation handling
- Hardcoding of IID_ITextServices rather than dynamic lookup for better reliability
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| source/windowUtils.py | Updates GetDeviceCaps call to use winBindings.gdi32 |
| source/winKernel.py | Moves STARTUPINFO/PROCESS_INFORMATION structures to winBindings.advapi32 with deprecation handling |
| source/winGDI.py | Replaces GDI+ and GDI32 raw calls with winBindings equivalents and adds deprecation handling |
| source/winBindings/*.py | New winBindings modules for various Windows DLLs with proper type definitions |
| source/visionEnhancementProviders/NVDAHighlighter.py | Adds import for winBindings.gdi32 |
| source/ui.py | Updates mshtml and urlmon calls to use winBindings |
| source/systemUtils.py | Updates advapi32 and shell32 calls to use winBindings |
| source/synthDrivers/sapi4.py | Updates winmm calls to use winBindings |
| source/shlobj.py | Updates shell32 calls to use winBindings with deprecation handling |
| source/shellapi.py | Updates shell32 calls and moves structures to winBindings |
| source/screenBitmap.py | Updates gdi32 calls to use winBindings |
| source/gui/installerGui.py | Updates shell32 calls to use winBindings |
| source/fonts/init.py | Updates gdi32 calls to use winBindings |
| source/fileUtils.py | Updates version.dll calls to use winBindings |
| source/config/init.py | Updates shell32 calls to use winBindings |
| source/NVDAObjects/window/excel.py | Updates gdi32 calls to use winBindings |
| source/NVDAObjects/IAccessible/init.py | Hardcodes IID_ITextServices instead of dynamic lookup |
| source/NVDAHelper/init.py | Updates shlwapi calls and fixes CreateProcessAsUser call |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
michaelDCurran
left a comment
There was a problem hiding this comment.
@SaschaCowley Your extra changes all look good to me. Thanks for cleaning up my rather rough work. Re changing things like gdiplus to winBindings.gdiplus in wingdi.py: I went back and forth on this. I think what you have reads well and better handles deprecation handling. However, it is worth noting that there will then be an extra attribute lookup every time. Tiny per call, but can add up in the long run.
Link to issue number:
None.
Summary of the issue:
Raw ctypes calls may not be 64 bit compatible. They should be replaced.
Description of user facing changes:
None.
Description of development approach:
Replaced more raw ctyps calls with winBindings definitions.
With this PR and previous PRs, 146 functions have now been replaced, with 118 to go.
Testing strategy:
General smoke testing.
Known issues with pull request:
Code Review Checklist: