Skip to content
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

winreg.DeleteKeyEx() documentation #95423

Closed
eryksun opened this issue Jul 29, 2022 · 0 comments
Closed

winreg.DeleteKeyEx() documentation #95423

eryksun opened this issue Jul 29, 2022 · 0 comments
Labels
3.10 3.11 3.12 docs Documentation in the Doc dir easy OS-windows type-bug An unexpected behavior, bug, or error

Comments

@eryksun
Copy link
Contributor

@eryksun eryksun commented Jul 29, 2022

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.

@eryksun eryksun added type-bug An unexpected behavior, bug, or error docs Documentation in the Doc dir OS-windows 3.11 easy 3.10 3.12 labels Jul 29, 2022
derekdkim added a commit to derekdkim/cpython that referenced this issue Aug 1, 2022
Fixed some inaccuracies and added clarifications in the docstrings and documentation for winreg.DeleteKeyEx for how it behaves on 32-bit Windows.
derekdkim added a commit to derekdkim/cpython that referenced this issue Aug 1, 2022


# Conflicts:
#	Doc/library/winreg.rst
#	PC/winreg.c
derekdkim added a commit to derekdkim/cpython that referenced this issue Aug 2, 2022
pythongh-95423: Regenerated winreg code with updated docstrings.
pythongh-95423: Fixed default role backticks
derekdkim added a commit to derekdkim/cpython that referenced this issue Aug 2, 2022
derekdkim added a commit to derekdkim/cpython that referenced this issue Aug 3, 2022
derekdkim added a commit to derekdkim/cpython that referenced this issue Aug 3, 2022
derekdkim added a commit to derekdkim/cpython that referenced this issue Aug 3, 2022
zooba pushed a commit to zooba/cpython that referenced this issue Aug 3, 2022
zooba pushed a commit to zooba/cpython that referenced this issue Aug 3, 2022
zooba added a commit that referenced this issue Aug 3, 2022
…function load (GH-95521)

Co-authored-by: Derek Kim <ddkim1024@gmail.com>
zooba added a commit that referenced this issue Aug 3, 2022
…function load (GH-95521)

Co-authored-by: Derek Kim <ddkim1024@gmail.com>
@zooba zooba closed this as completed Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 3.11 3.12 docs Documentation in the Doc dir easy OS-windows type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants