-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
[winreg] DeleteKeyEx() documentation #95423
Copy link
Copy link
Closed
Labels
3.10only security fixesonly security fixes3.11only security fixesonly security fixes3.12only security fixesonly security fixesOS-windowsdocsDocumentation in the Doc dirDocumentation in the Doc direasytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Metadata
Metadata
Assignees
Labels
3.10only security fixesonly security fixes3.11only security fixesonly security fixes3.12only security fixesonly security fixesOS-windowsdocsDocumentation in the Doc dirDocumentation in the Doc direasytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
The documentation and docstring of
winreg.DeleteKeyEx()claim thatRegDeleteKeyExW()is only implemented in 64-bit versions of Windows. Actually, it's available in the API on systems based on NT 5.2 and above, including XP Professional x64 Edition, Vista, and later releases of Windows.A 32-bit build of Windows ignores the
KEY_WOW64_64KEYandKEY_WOW64_32KEYaccess constants, in which caseRegDeleteKeyExW()is functionally equivalent toRegDeleteKeyW(). The documentation of these two constants in the "Access Rights" section should clarify that they're ignored in 32-bit Windows.The default value of
accessshould have been 0 instead ofKEY_WOW64_64KEY, if only this could be changed, but it can't. The docs should clarify that the way to delete a key from the default registry view of the process is either to pass 0 foraccessor usewinreg.DeleteKey().On a related note, since
RegDeleteKeyExW()has been available for all builds of Windows since Vista,winreg_DeleteKeyEx_impl()in "PC/winreg.c" can be simplified to use load-time dynamic linking. Updating this isn't necessary, however. It works fine either way.