The documentation and docstring of winreg.DeleteKeyEx() claim that RegDeleteKeyExW() 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_64KEY and KEY_WOW64_32KEY access constants, in which case RegDeleteKeyExW() is functionally equivalent to RegDeleteKeyW(). 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 access should have been 0 instead of KEY_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 for access or use winreg.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.
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.