summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBrian Curtin <brian.curtin@gmail.com>2010-04-02 21:18:14 (GMT)
committerBrian Curtin <brian.curtin@gmail.com>2010-04-02 21:18:14 (GMT)
commite33fa887d39f026dadd8bcb182725c90f7d51ece (patch)
tree1ae119210efb6848b418c3a6d9b9dce8eb8c7df2 /Doc
parentef253ac84e6fd11770ff78c56015a0e61c991fc4 (diff)
downloadcpython-e33fa887d39f026dadd8bcb182725c90f7d51ece.zip
cpython-e33fa887d39f026dadd8bcb182725c90f7d51ece.tar.gz
cpython-e33fa887d39f026dadd8bcb182725c90f7d51ece.tar.bz2
Implement #7347. Add CreateKeyEx, DeleteKeyEx, and update _winreg tests.
*ReflectionKey functions used to not be documented or tested, but they are now sufficiently documented and tested on platforms where they apply. Additionally, fixed a bug in QueryReflectionKey which was returning an incorrect value. All tests pass from XP through Windows 7, on 32 and 64-bit platforms.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/_winreg.rst104
1 files changed, 101 insertions, 3 deletions
diff --git a/Doc/library/_winreg.rst b/Doc/library/_winreg.rst
index 2a4d396..a9de7d4 100644
--- a/Doc/library/_winreg.rst
+++ b/Doc/library/_winreg.rst
@@ -68,15 +68,40 @@ This module offers the following functions:
:exc:`WindowsError` exception is raised.
+.. function:: CreateKeyEx(key, sub_key[, res=0[, sam=KEY_ALL_ACCESS]])
+
+ Creates or opens the specified key, returning a :dfn:`handle object`
+
+ *key* is an already open key, or one of the predefined :const:`HKEY_\*`
+ constants.
+
+ *sub_key* is a string that names the key this method opens or creates.
+
+ *res* is a reserved integer, and must be zero. The default is zero.
+
+ *sam* is an integer that specifies an access mask that describes the desired
+ security access for the key. Default is :const:`KEY_ALL_ACCESS`
+
+ If *key* is one of the predefined keys, *sub_key* may be ``None``. In that
+ case, the handle returned is the same key handle passed in to the function.
+
+ If the key already exists, this function opens the existing key.
+
+ The return value is the handle of the opened key. If the function fails, a
+ :exc:`WindowsError` exception is raised.
+
+.. versionadded:: 2.7
+
+
.. function:: DeleteKey(key, sub_key)
Deletes the specified key.
- *key* is an already open key, or any one of the predefined :const:`HKEY_\*`
+ *key* is an already open key, or any one of the predefined :const:`HKEY_\*`
constants.
- *sub_key* is a string that must be a subkey of the key identified by the *key*
- parameter. This value must not be ``None``, and the key may not have subkeys.
+ *sub_key* is a string that must be a subkey of the key identified by the *key*
+ parameter. This value must not be ``None``, and the key may not have subkeys.
*This method can not delete keys with subkeys.*
@@ -84,6 +109,37 @@ This module offers the following functions:
If the method fails, a :exc:`WindowsError` exception is raised.
+.. function:: DeleteKeyEx(key, sub_key[, sam=KEY_WOW64_64KEY[, res=0]])
+
+ Deletes the specified key.
+
+ .. note::
+ The :func:`DeleteKeyEx` function is implemented with the RegDeleteKeyEx
+ Windows API function, which is specific to 64-bit versions of Windows.
+ See http://msdn.microsoft.com/en-us/library/ms724847%28VS.85%29.aspx
+
+ *key* is an already open key, or any one of the predefined :const:`HKEY_\*`
+ constants.
+
+ *sub_key* is a string that must be a subkey of the key identified by the
+ *key* parameter. This value must not be ``None``, and the key may not have
+ subkeys.
+
+ *res* is a reserved integer, and must be zero. The default is zero.
+
+ *sam* is an integer that specifies an access mask that describes the
+ desired security access for the key. Default is :const:`KEY_WOW64_64KEY`
+
+ *This method can not delete keys with subkeys.*
+
+ If the method succeeds, the entire key, including all of its values, is
+ removed. If the method fails, a :exc:`WindowsError` exception is raised.
+
+ On unsupported Windows versions, :exc:`NotImplementedError` is raised.
+
+.. versionadded:: 2.7
+
+
.. function:: DeleteValue(key, value)
Removes a named value from a registry key.
@@ -383,6 +439,48 @@ This module offers the following functions:
registry. This helps the registry perform efficiently.
+.. function:: DisableReflectionKey(key)
+
+ Disables registry reflection for 32-bit processes running on a 64-bit
+ Operating System.
+
+ *key* is an already open key, or one of the predefined :const:`HKEY_\*`
+ constants.
+
+ Will generally raise :exc:`NotImplemented` if executed on a 32-bit
+ Operating System.
+
+ If the key is not on the reflection list, the function succeeds but has no
+ effect. Disabling reflection for a key does not affect reflection of any
+ subkeys.
+
+
+.. function:: EnableReflectionKey(key)
+
+ Restores registry reflection for the specified disabled key.
+
+ *key* is an already open key, or one of the predefined :const:`HKEY_\*`
+ constants.
+
+ Will generally raise :exc:`NotImplemented` if executed on a 32-bit
+ Operating System.
+
+ Restoring reflection for a key does not affect reflection of any subkeys.
+
+
+.. function:: QueryReflectionKey(key)
+
+ Determines the reflection state for the specified key.
+
+ *key* is an already open key, or one of the predefined :const:`HKEY_\*`
+ constants.
+
+ Returns ``True`` if reflection is disabled.
+
+ Will generally raise :exc:`NotImplemented` if executed on a 32-bit
+ Operating System.
+
+
.. _handle-object:
Registry Handle Objects