| 1 |
import sys |
| 2 |
from _typeshed import ReadableBuffer, Unused |
| 3 |
from types import TracebackType |
| 4 |
from typing import Any, Final, Literal, final, overload |
| 5 |
from typing_extensions import Self, TypeAlias |
| 6 |
|
| 7 |
if sys.platform == "win32": |
| 8 |
_KeyType: TypeAlias = HKEYType | int |
| 9 |
def CloseKey(hkey: _KeyType, /) -> None: ... |
| 10 |
def ConnectRegistry(computer_name: str | None, key: _KeyType, /) -> HKEYType: ... |
| 11 |
def CreateKey(key: _KeyType, sub_key: str | None, /) -> HKEYType: ... |
| 12 |
def CreateKeyEx(key: _KeyType, sub_key: str | None, reserved: int = 0, access: int = 131078) -> HKEYType: ... |
| 13 |
def DeleteKey(key: _KeyType, sub_key: str, /) -> None: ... |
| 14 |
def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = 256, reserved: int = 0) -> None: ... |
| 15 |
def DeleteValue(key: _KeyType, value: str, /) -> None: ... |
| 16 |
def EnumKey(key: _KeyType, index: int, /) -> str: ... |
| 17 |
def EnumValue(key: _KeyType, index: int, /) -> tuple[str, Any, int]: ... |
| 18 |
def ExpandEnvironmentStrings(string: str, /) -> str: ... |
| 19 |
def FlushKey(key: _KeyType, /) -> None: ... |
| 20 |
def LoadKey(key: _KeyType, sub_key: str, file_name: str, /) -> None: ... |
| 21 |
def OpenKey(key: _KeyType, sub_key: str | None, reserved: int = 0, access: int = 131097) -> HKEYType: ... |
| 22 |
def OpenKeyEx(key: _KeyType, sub_key: str | None, reserved: int = 0, access: int = 131097) -> HKEYType: ... |
| 23 |
def QueryInfoKey(key: _KeyType, /) -> tuple[int, int, int]: ... |
| 24 |
def QueryValue(key: _KeyType, sub_key: str | None, /) -> str: ... |
| 25 |
def QueryValueEx(key: _KeyType, name: str, /) -> tuple[Any, int]: ... |
| 26 |
def SaveKey(key: _KeyType, file_name: str, /) -> None: ... |
| 27 |
def SetValue(key: _KeyType, sub_key: str | None, type: int, value: str, /) -> None: ... |
| 28 |
@overload |
| 29 |
def SetValueEx( |
| 30 |
key: _KeyType, value_name: str | None, reserved: Unused, type: Literal[4, 5], value: int | None, / |
| 31 |
) -> None: ... |
| 32 |
@overload |
| 33 |
def SetValueEx( |
| 34 |
key: _KeyType, value_name: str | None, reserved: Unused, type: Literal[1, 2], value: str | None, / |
| 35 |
) -> None: ... |
| 36 |
@overload |
| 37 |
def SetValueEx( |
| 38 |
key: _KeyType, value_name: str | None, reserved: Unused, type: Literal[7], value: list[str] | None, / |
| 39 |
) -> None: ... |
| 40 |
@overload |
| 41 |
def SetValueEx( |
| 42 |
key: _KeyType, |
| 43 |
value_name: str | None, |
| 44 |
reserved: Unused, |
| 45 |
type: Literal[0, 3, 8, 9, 10, 11], |
| 46 |
value: ReadableBuffer | None, |
| 47 |
/, |
| 48 |
) -> None: ... |
| 49 |
@overload |
| 50 |
def SetValueEx( |
| 51 |
key: _KeyType, |
| 52 |
value_name: str | None, |
| 53 |
reserved: Unused, |
| 54 |
type: int, |
| 55 |
value: int | str | list[str] | ReadableBuffer | None, |
| 56 |
/, |
| 57 |
) -> None: ... |
| 58 |
def DisableReflectionKey(key: _KeyType, /) -> None: ... |
| 59 |
def EnableReflectionKey(key: _KeyType, /) -> None: ... |
| 60 |
def QueryReflectionKey(key: _KeyType, /) -> bool: ... |
| 61 |
|
| 62 |
HKEY_CLASSES_ROOT: Final[int] |
| 63 |
HKEY_CURRENT_USER: Final[int] |
| 64 |
HKEY_LOCAL_MACHINE: Final[int] |
| 65 |
HKEY_USERS: Final[int] |
| 66 |
HKEY_PERFORMANCE_DATA: Final[int] |
| 67 |
HKEY_CURRENT_CONFIG: Final[int] |
| 68 |
HKEY_DYN_DATA: Final[int] |
| 69 |
|
| 70 |
KEY_ALL_ACCESS: Final = 983103 |
| 71 |
KEY_WRITE: Final = 131078 |
| 72 |
KEY_READ: Final = 131097 |
| 73 |
KEY_EXECUTE: Final = 131097 |
| 74 |
KEY_QUERY_VALUE: Final = 1 |
| 75 |
KEY_SET_VALUE: Final = 2 |
| 76 |
KEY_CREATE_SUB_KEY: Final = 4 |
| 77 |
KEY_ENUMERATE_SUB_KEYS: Final = 8 |
| 78 |
KEY_NOTIFY: Final = 16 |
| 79 |
KEY_CREATE_LINK: Final = 32 |
| 80 |
|
| 81 |
KEY_WOW64_64KEY: Final = 256 |
| 82 |
KEY_WOW64_32KEY: Final = 512 |
| 83 |
|
| 84 |
REG_BINARY: Final = 3 |
| 85 |
REG_DWORD: Final = 4 |
| 86 |
REG_DWORD_LITTLE_ENDIAN: Final = 4 |
| 87 |
REG_DWORD_BIG_ENDIAN: Final = 5 |
| 88 |
REG_EXPAND_SZ: Final = 2 |
| 89 |
REG_LINK: Final = 6 |
| 90 |
REG_MULTI_SZ: Final = 7 |
| 91 |
REG_NONE: Final = 0 |
| 92 |
REG_QWORD: Final = 11 |
| 93 |
REG_QWORD_LITTLE_ENDIAN: Final = 11 |
| 94 |
REG_RESOURCE_LIST: Final = 8 |
| 95 |
REG_FULL_RESOURCE_DESCRIPTOR: Final = 9 |
| 96 |
REG_RESOURCE_REQUIREMENTS_LIST: Final = 10 |
| 97 |
REG_SZ: Final = 1 |
| 98 |
|
| 99 |
REG_CREATED_NEW_KEY: Final = 1 |
| 100 |
REG_LEGAL_CHANGE_FILTER: Final = 268435471 |
| 101 |
REG_LEGAL_OPTION: Final = 31 |
| 102 |
REG_NOTIFY_CHANGE_ATTRIBUTES: Final = 2 |
| 103 |
REG_NOTIFY_CHANGE_LAST_SET: Final = 4 |
| 104 |
REG_NOTIFY_CHANGE_NAME: Final = 1 |
| 105 |
REG_NOTIFY_CHANGE_SECURITY: Final = 8 |
| 106 |
REG_NO_LAZY_FLUSH: Final = 4 |
| 107 |
REG_OPENED_EXISTING_KEY: Final = 2 |
| 108 |
REG_OPTION_BACKUP_RESTORE: Final = 4 |
| 109 |
REG_OPTION_CREATE_LINK: Final = 2 |
| 110 |
REG_OPTION_NON_VOLATILE: Final = 0 |
| 111 |
REG_OPTION_OPEN_LINK: Final = 8 |
| 112 |
REG_OPTION_RESERVED: Final = 0 |
| 113 |
REG_OPTION_VOLATILE: Final = 1 |
| 114 |
REG_REFRESH_HIVE: Final = 2 |
| 115 |
REG_WHOLE_HIVE_VOLATILE: Final = 1 |
| 116 |
|
| 117 |
error = OSError |
| 118 |
|
| 119 |
|
| 120 |
@final |
| 121 |
class HKEYType: |
| 122 |
def __bool__(self) -> bool: ... |
| 123 |
def __int__(self) -> int: ... |
| 124 |
def __enter__(self) -> Self: ... |
| 125 |
def __exit__( |
| 126 |
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, / |
| 127 |
) -> bool | None: ... |
| 128 |
def Close(self) -> None: ... |
| 129 |
def Detach(self) -> int: ... |
| 130 |
def __hash__(self) -> int: ... |
| 131 |
@property |
| 132 |
def handle(self) -> int: ... |