diff --git a/ctypes_generation/definitions/functions/registry.txt b/ctypes_generation/definitions/functions/registry.txt index b1caa3a..2b527dc 100644 --- a/ctypes_generation/definitions/functions/registry.txt +++ b/ctypes_generation/definitions/functions/registry.txt @@ -282,4 +282,28 @@ LSTATUS RegSaveKeyExW( LPCWSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD Flags +); + + +LSTATUS RegLoadKeyA( + [in] HKEY hKey, + [in, optional] LPCSTR lpSubKey, + [in] LPCSTR lpFile +); + + +LSTATUS RegLoadKeyW( + [in] HKEY hKey, + [in, optional] LPCWSTR lpSubKey, + [in] LPCWSTR lpFile +); + +LSTATUS RegUnLoadKeyA( + [in] HKEY hKey, + [in, optional] LPCSTR lpSubKey +); + +LSTATUS RegUnLoadKeyW( + [in] HKEY hKey, + [in, optional] LPCWSTR lpSubKey ); \ No newline at end of file diff --git a/windows/generated_def/meta.py b/windows/generated_def/meta.py index e7a2ba2..e284a6d 100644 --- a/windows/generated_def/meta.py +++ b/windows/generated_def/meta.py @@ -14045,6 +14045,8 @@ functions = set(['AccessCheck', 'RegGetKeySecurity', 'RegGetValueA', 'RegGetValueW', + 'RegLoadKeyA', + 'RegLoadKeyW', 'RegOpenKeyExA', 'RegOpenKeyExW', 'RegQueryInfoKeyA', @@ -14059,6 +14061,8 @@ functions = set(['AccessCheck', 'RegSetKeyValueW', 'RegSetValueExA', 'RegSetValueExW', + 'RegUnLoadKeyA', + 'RegUnLoadKeyW', 'RegisterTraceGuidsA', 'RegisterTraceGuidsW', 'RemoveVectoredExceptionHandler', diff --git a/windows/generated_def/winfuncs.py b/windows/generated_def/winfuncs.py index 270e35d..15ede01 100644 --- a/windows/generated_def/winfuncs.py +++ b/windows/generated_def/winfuncs.py @@ -1665,6 +1665,26 @@ RegSaveKeyExAParams = ((1, 'hKey'), (1, 'lpFile'), (1, 'lpSecurityAttributes'), RegSaveKeyExWPrototype = WINFUNCTYPE(LSTATUS, HKEY, LPCWSTR, LPSECURITY_ATTRIBUTES, DWORD) RegSaveKeyExWParams = ((1, 'hKey'), (1, 'lpFile'), (1, 'lpSecurityAttributes'), (1, 'Flags')) +#def RegLoadKeyA(hKey, lpSubKey, lpFile): +# return RegLoadKeyA.ctypes_function(hKey, lpSubKey, lpFile) +RegLoadKeyAPrototype = WINFUNCTYPE(LSTATUS, HKEY, LPCSTR, LPCSTR) +RegLoadKeyAParams = ((1, 'hKey'), (1, 'lpSubKey'), (1, 'lpFile')) + +#def RegLoadKeyW(hKey, lpSubKey, lpFile): +# return RegLoadKeyW.ctypes_function(hKey, lpSubKey, lpFile) +RegLoadKeyWPrototype = WINFUNCTYPE(LSTATUS, HKEY, LPCWSTR, LPCWSTR) +RegLoadKeyWParams = ((1, 'hKey'), (1, 'lpSubKey'), (1, 'lpFile')) + +#def RegUnLoadKeyA(hKey, lpSubKey): +# return RegUnLoadKeyA.ctypes_function(hKey, lpSubKey) +RegUnLoadKeyAPrototype = WINFUNCTYPE(LSTATUS, HKEY, LPCSTR) +RegUnLoadKeyAParams = ((1, 'hKey'), (1, 'lpSubKey')) + +#def RegUnLoadKeyW(hKey, lpSubKey): +# return RegUnLoadKeyW.ctypes_function(hKey, lpSubKey) +RegUnLoadKeyWPrototype = WINFUNCTYPE(LSTATUS, HKEY, LPCWSTR) +RegUnLoadKeyWParams = ((1, 'hKey'), (1, 'lpSubKey')) + #def IsValidSecurityDescriptor(pSecurityDescriptor): # return IsValidSecurityDescriptor.ctypes_function(pSecurityDescriptor) IsValidSecurityDescriptorPrototype = WINFUNCTYPE(BOOL, PSECURITY_DESCRIPTOR) diff --git a/windows/winproxy/apis/advapi32.py b/windows/winproxy/apis/advapi32.py index 682af75..4517abd 100644 --- a/windows/winproxy/apis/advapi32.py +++ b/windows/winproxy/apis/advapi32.py @@ -403,6 +403,22 @@ def RegSaveKeyExA(hKey, lpFile, lpSecurityAttributes, Flags): def RegSaveKeyExW(hKey, lpFile, lpSecurityAttributes, Flags): return RegSaveKeyExW.ctypes_function(hKey, lpFile, lpSecurityAttributes, Flags) +@Advapi32Proxy(error_check=result_is_error_code) +def RegLoadKeyA(hKey, lpSubKey, lpFile): + return RegLoadKeyA.ctypes_function(hKey, lpSubKey, lpFile) + +@Advapi32Proxy(error_check=result_is_error_code) +def RegLoadKeyW(hKey, lpSubKey, lpFile): + return RegLoadKeyW.ctypes_function(hKey, lpSubKey, lpFile) + +@Advapi32Proxy(error_check=result_is_error_code) +def RegUnLoadKeyA(hKey, lpSubKey): + return RegUnLoadKeyA.ctypes_function(hKey, lpSubKey) + +@Advapi32Proxy(error_check=result_is_error_code) +def RegUnLoadKeyW(hKey, lpSubKey): + return RegUnLoadKeyW.ctypes_function(hKey, lpSubKey) + # Service @Advapi32Proxy()