Constants
wslwinreg constants
These values are set up on instantiation of the wslwinreg module.
PY2
- wslwinreg.common.PY2 = 2
True if the interpreter is Python 2.x.
IS_LINUX
- wslwinreg.common.IS_LINUX = sys.platform.startswith("linux")
Running on linux?
IS_CYGWIN
- wslwinreg.common.IS_CYGWIN = sys.platform.startswith("cygwin")
Running on Cygwin.
IS_MSYS
- wslwinreg.common.IS_MSYS = sys.platform.startswith("msys")
Running on MSYS.
IS_WSL
- wslwinreg.common.IS_WSL = IS_LINUX and "icrosoft" in platform.platform()
Running on Windows Subsystem for Linux.
Windows constants
These integers are used to pass to Windows Registry calls.
ERROR_SUCCESS
- wslwinreg.common.ERROR_SUCCESS = 0x00000000
The operation completed successfully.
ERROR_FILE_NOT_FOUND
- wslwinreg.common.ERROR_FILE_NOT_FOUND = 0x00000002
The system cannot find the file specified.
ERROR_MORE_DATA
- wslwinreg.common.ERROR_MORE_DATA = 0x000000ea
More data is available.
HKEY_CLASSES_ROOT
- wslwinreg.common.HKEY_CLASSES_ROOT = 0x80000000
Registry entries subordinate to this key define types (or classes) of documents and the properties associated with those types.
HKEY_CURRENT_USER
- wslwinreg.common.HKEY_CURRENT_USER = 0x80000001
Registry entries subordinate to this key define the preferences of the current user.
HKEY_LOCAL_MACHINE
- wslwinreg.common.HKEY_LOCAL_MACHINE = 0x80000002
Registry entries subordinate to this key define the physical state of the computer, including data about the bus type, system memory, and installed hardware and software.
HKEY_USERS
- wslwinreg.common.HKEY_USERS = 0x80000003
Registry entries subordinate to this key define the default user configuration for new users on the local computer and the user configuration for the current user.
HKEY_PERFORMANCE_DATA
- wslwinreg.common.HKEY_PERFORMANCE_DATA = 0x80000004
Registry entries subordinate to this key reference the text strings that describe counters in US English.
HKEY_CURRENT_CONFIG
- wslwinreg.common.HKEY_CURRENT_CONFIG = 0x80000005
Contains information about the current hardware profile of the local computer system.
HKEY_DYN_DATA
- wslwinreg.common.HKEY_DYN_DATA = 0x80000006
Windows registry hive that contains information about hardware devices, including Plug and Play and network performance statistics.
KEY_QUERY_VALUE
- wslwinreg.common.KEY_QUERY_VALUE = 0x00000001
Required to query the values of a registry key.
KEY_SET_VALUE
- wslwinreg.common.KEY_SET_VALUE = 0x00000002
Required to create, delete, or set a registry value.
KEY_CREATE_SUB_KEY
- wslwinreg.common.KEY_CREATE_SUB_KEY = 0x00000004
Required to create a subkey of a registry key.
KEY_ENUMERATE_SUB_KEYS
- wslwinreg.common.KEY_ENUMERATE_SUB_KEYS = 0x00000008
Required to enumerate the subkeys of a registry key.
KEY_NOTIFY
- wslwinreg.common.KEY_NOTIFY = 0x00000010
Required to request change notifications for a registry key or for subkeys of a registry key.
KEY_CREATE_LINK
- wslwinreg.common.KEY_CREATE_LINK = 0x00000020
Reserved for system use.
KEY_WOW64_32KEY
- wslwinreg.common.KEY_WOW64_32KEY = 0x00000200
Indicates that an application on 64-bit Windows should operate on the 32-bit registry view.
KEY_WOW64_64KEY
- wslwinreg.common.KEY_WOW64_64KEY = 0x00000100
Indicates that an application on 64-bit Windows should operate on the 64-bit registry view.
KEY_WOW64_RES
- wslwinreg.common.KEY_WOW64_RES = 0x00000300
Mask for common.KEY_WOW64_32KEY or’d with common.KEY_WOW64_64KEY.
KEY_WRITE
- wslwinreg.common.KEY_WRITE = 0x00020006
Combines the STANDARD_RIGHTS_WRITE, common.KEY_SET_VALUE, and common.KEY_CREATE_SUB_KEY access rights.
KEY_EXECUTE
- wslwinreg.common.KEY_EXECUTE = 0x00020019
Equivalent to KEY_READ.
KEY_READ
- wslwinreg.common.KEY_READ = 0x00020019
Combines the STANDARD_RIGHTS_READ, common.KEY_QUERY_VALUE, common.KEY_ENUMERATE_SUB_KEYS, and common.KEY_NOTIFY values.
KEY_ALL_ACCESS
- wslwinreg.common.KEY_ALL_ACCESS = 0x000f003f
Combines the STANDARD_RIGHTS_REQUIRED, common.KEY_QUERY_VALUE, common.KEY_SET_VALUE, common.KEY_CREATE_SUB_KEY, common.KEY_ENUMERATE_SUB_KEYS, common.KEY_NOTIFY, and common.KEY_CREATE_LINK access rights.
REG_OPTION_RESERVED
- wslwinreg.common.REG_OPTION_RESERVED = 0x00000000
Default key option, same as common.REG_OPTION_NON_VOLATILE.
REG_OPTION_NON_VOLATILE
- wslwinreg.common.REG_OPTION_NON_VOLATILE = 0x00000000
This key is not volatile; this is the default.
REG_OPTION_VOLATILE
- wslwinreg.common.REG_OPTION_VOLATILE = 0x00000001
All keys created by the function are volatile.
REG_OPTION_CREATE_LINK
- wslwinreg.common.REG_OPTION_CREATE_LINK = 0x00000002
This key is a symbolic link.
REG_OPTION_BACKUP_RESTORE
- wslwinreg.common.REG_OPTION_BACKUP_RESTORE = 0x00000004
If this flag is set, the function ignores the samDesired parameter and attempts to open the key with the access required to backup or restore the key.
REG_OPTION_OPEN_LINK
- wslwinreg.common.REG_OPTION_OPEN_LINK = 0x00000008
The key to be opened is a symbolic link.
REG_LEGAL_OPTION
- wslwinreg.common.REG_LEGAL_OPTION = REG_OPTION_RESERVED | \ REG_OPTION_NON_VOLATILE | \ REG_OPTION_VOLATILE | \ REG_OPTION_CREATE_LINK | \ REG_OPTION_BACKUP_RESTORE | \ REG_OPTION_OPEN_LINK
Mask for all registry key option flags.
REG_CREATED_NEW_KEY
- wslwinreg.common.REG_CREATED_NEW_KEY = 0x00000001
The key did not exist and was created.
REG_OPENED_EXISTING_KEY
- wslwinreg.common.REG_OPENED_EXISTING_KEY = 0x00000002
The key existed and was simply opened without being changed.
REG_WHOLE_HIVE_VOLATILE
- wslwinreg.common.REG_WHOLE_HIVE_VOLATILE = 0x00000001
If specified, a new, volatile (memory only) set of registry information, or hive, is created.
REG_REFRESH_HIVE
- wslwinreg.common.REG_REFRESH_HIVE = 0x00000002
If set, the location of the subtree that the hKey parameter points to is restored to its state immediately following the last flush.
REG_NO_LAZY_FLUSH
- wslwinreg.common.REG_NO_LAZY_FLUSH = 0x00000004
If set, disable lazy flushing.
REG_NOTIFY_CHANGE_NAME
- wslwinreg.common.REG_NOTIFY_CHANGE_NAME = 0x00000001
Notify the caller if a subkey is added or deleted.
REG_NOTIFY_CHANGE_ATTRIBUTES
- wslwinreg.common.REG_NOTIFY_CHANGE_ATTRIBUTES = 0x00000002
Notify the caller of changes to the attributes of the key, such as the security descriptor information.
REG_NOTIFY_CHANGE_LAST_SET
- wslwinreg.common.REG_NOTIFY_CHANGE_LAST_SET = 0x00000004
Notify the caller of changes to a value of the key.
REG_NOTIFY_CHANGE_SECURITY
- wslwinreg.common.REG_NOTIFY_CHANGE_SECURITY = 0x00000008
Notify the caller of changes to the security descriptor of the key.
REG_LEGAL_CHANGE_FILTER
- wslwinreg.common.REG_LEGAL_CHANGE_FILTER = REG_NOTIFY_CHANGE_NAME | \ REG_NOTIFY_CHANGE_ATTRIBUTES | \ REG_NOTIFY_CHANGE_LAST_SET | \ REG_NOTIFY_CHANGE_SECURITY
Mask for all REG_NOTIFY flags.
REG_NONE
- wslwinreg.common.REG_NONE = 0x000000000
No defined value type.
REG_SZ
- wslwinreg.common.REG_SZ = 0x000000001
A null-terminated string.
REG_EXPAND_SZ
- wslwinreg.common.REG_EXPAND_SZ = 0x000000002
A null-terminated string that contains unexpanded references to environment variables (for example, “%PATH%”)
REG_BINARY
- wslwinreg.common.REG_BINARY = 0x000000003
Binary data in any form.
REG_DWORD
- wslwinreg.common.REG_DWORD = 0x000000004
A 32-bit number.
REG_DWORD_LITTLE_ENDIAN
- wslwinreg.common.REG_DWORD_LITTLE_ENDIAN = 0x000000004
A 32-bit number in little-endian format.
REG_DWORD_BIG_ENDIAN
- wslwinreg.common.REG_DWORD_BIG_ENDIAN = 0x000000005
A 32-bit number in big-endian format.
REG_LINK
- wslwinreg.common.REG_LINK = 0x000000006
A null-terminated Unicode string that contains the target path of a symbolic link that was created by calling the RegCreateKeyEx function with common.REG_OPTION_CREATE_LINK.
REG_MULTI_SZ
- wslwinreg.common.REG_MULTI_SZ = 0x000000007
A sequence of null-terminated strings, terminated by an empty string (\0).
REG_RESOURCE_LIST
- wslwinreg.common.REG_RESOURCE_LIST = 0x000000008
Device-driver resource list.
REG_FULL_RESOURCE_DESCRIPTOR
- wslwinreg.common.REG_FULL_RESOURCE_DESCRIPTOR = 0x000000009
A list of hardware resources that a physical device is using, detected and written into the \HardwareDescription tree by the system.
REG_RESOURCE_REQUIREMENTS_LIST
- wslwinreg.common.REG_RESOURCE_REQUIREMENTS_LIST = 0x00000000a
A device driver’s list of possible hardware resources it or one of the physical devices it controls can use, from which the system writes a subset into the \ResourceMap tree.
REG_QWORD
- wslwinreg.common.REG_QWORD = 0x0000000b
A 64-bit number.
REG_QWORD_LITTLE_ENDIAN
- wslwinreg.common.REG_QWORD_LITTLE_ENDIAN = 0x0000000b
A 64-bit number in little-endian format.
FORMAT_MESSAGE_ALLOCATE_BUFFER
- wslwinreg.common.FORMAT_MESSAGE_ALLOCATE_BUFFER = 256
The function allocates a buffer large enough to hold the formatted message, and places a pointer to the allocated buffer at the address specified by lpBuffer.
FORMAT_MESSAGE_IGNORE_INSERTS
- wslwinreg.common.FORMAT_MESSAGE_IGNORE_INSERTS = 512
Insert sequences in the message definition such as %1 are to be ignored and passed through to the output buffer unchanged.
FORMAT_MESSAGE_FROM_STRING
- wslwinreg.common.FORMAT_MESSAGE_FROM_STRING = 1024
The lpSource parameter is a pointer to a null-terminated string that contains a message definition.
FORMAT_MESSAGE_FROM_HMODULE
- wslwinreg.common.FORMAT_MESSAGE_FROM_HMODULE = 2048
The lpSource parameter is a module handle containing the message-table resource(s) to search.
FORMAT_MESSAGE_FROM_SYSTEM
- wslwinreg.common.FORMAT_MESSAGE_FROM_SYSTEM = 4096
The function should search the system message-table resource(s) for the requested message.
FORMAT_MESSAGE_ARGUMENT_ARRAY
- wslwinreg.common.FORMAT_MESSAGE_ARGUMENT_ARRAY = 8192
The Arguments parameter is not a va_list structure, but is a pointer to an array of values that represent the arguments.
FORMAT_MESSAGE_MAX_WIDTH_MASK
- wslwinreg.common.FORMAT_MESSAGE_MAX_WIDTH_MASK = 255
The function ignores regular line breaks in the message definition text.
LANG_NEUTRAL
- wslwinreg.common.LANG_NEUTRAL = 0x00
String has no associated language.
SUBLANG_DEFAULT
- wslwinreg.common.SUBLANG_DEFAULT = 0x01
User default sub language.
Windows C++ data types
These classes are used to describe the parameters to Windows functions.
LPCVOID
- wslwinreg.common.LPCVOID = c_void_p
const void *C void pointer
LPVOID
- wslwinreg.common.LPVOID = c_void_p
void *C void pointer
BOOL
- wslwinreg.common.BOOL = c_long
BOOL 32 bit C integer type.
WORD
- wslwinreg.common.WORD = c_ushort
short int16 bit C integer type
DWORD
- wslwinreg.common.DWORD = c_ulong
unsigned int32 bit C integer type
PDWORD
- wslwinreg.common.PDWORD = POINTER(DWORD)
unsigned int *32 bit C integer pointer
LPDWORD
- wslwinreg.common.LPDWORD = PDWORD
FAR unsigned int *32 bit C pointer
QWORD
- wslwinreg.common.QWORD = c_ulonglong
unsigned long long64 bit C integer type
PQWORD
- wslwinreg.common.PQWORD = POINTER(QWORD)
unsigned long long *64 bit C integer pointer
LPQWORD
- wslwinreg.common.LPQWORD = PQWORD
FAR unsigned long long *64 bit C integer pointer
LONG
- wslwinreg.common.LONG = c_int
signed int32 bit signed C integer type
PLONG
- wslwinreg.common.PLONG = POINTER(LONG)
signed int *32 bit signed C integer pointer
PBYTE
- wslwinreg.common.PBYTE = c_char_p
signed char8 bit signed C integer type
LPBYTE
- wslwinreg.common.LPBYTE = PBYTE
unsigned char8 bit unsigned C integer type
LPSTR
- wslwinreg.common.LPSTR = c_char_p
char *C string pointer
LPWSTR
- wslwinreg.common.LPWSTR = c_wchar_p
wchar_t *C string pointer (16-bit)
LPCWSTR
- wslwinreg.common.LPCWSTR = LPWSTR
FAR wchar_t *C string pointer (16-bit)
HANDLE
- wslwinreg.common.HANDLE = c_void_p
HANDLEC data type from Windows (void *)
HKEY
- wslwinreg.common.HKEY = HANDLE
HKEYC data type for Windows registry keys (void *)
PHKEY
- wslwinreg.common.PHKEY = POINTER(HKEY)
HKEY *C pointer to Windows HKEY (void **)
HLOCAL
- wslwinreg.common.HLOCAL = c_void_p
HLOCALWindows HLOCAL data type (void *)
REGSAM
- wslwinreg.common.REGSAM = c_uint
REGSAMWindows REGSAM C data type (unsigned int)