Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SoftEtherVPN/SoftEtherVPN_Stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mayaqua/Microsoft.c')
-rw-r--r--src/Mayaqua/Microsoft.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/Mayaqua/Microsoft.c b/src/Mayaqua/Microsoft.c
index 22404212..d78bc623 100644
--- a/src/Mayaqua/Microsoft.c
+++ b/src/Mayaqua/Microsoft.c
@@ -12609,6 +12609,14 @@ NT_API *MsLoadNtApiFunctions()
(BOOL (__stdcall *)(HANDLE,DWORD,LPWSTR,PDWORD))
GetProcAddress(nt->hKernel32, "QueryFullProcessImageNameW");
+ nt->RegLoadKeyW =
+ (LSTATUS (__stdcall *)(HKEY,LPCWSTR,LPCWSTR))
+ GetProcAddress(nt->hAdvapi32, "RegLoadKeyW");
+
+ nt->RegUnLoadKeyW =
+ (LSTATUS (__stdcall *)(HKEY,LPCWSTR))
+ GetProcAddress(nt->hAdvapi32, "RegUnLoadKeyW");
+
if (info.dwMajorVersion >= 5)
{
nt->UpdateDriverForPlugAndPlayDevicesW =
@@ -12957,6 +12965,59 @@ DWORD MsRegAccessMaskFor64BitEx(bool force32bit, bool force64bit)
return 0;
}
+// Load the hive
+bool MsRegLoadHive(UINT root, wchar_t *keyname, wchar_t *filename)
+{
+ LONG ret;
+ if (keyname == NULL || filename == NULL)
+ {
+ WHERE;
+ return false;
+ }
+
+ if (ms->nt == NULL || ms->nt->RegLoadKeyW == NULL || ms->nt->RegUnLoadKeyW == NULL)
+ {
+ WHERE;
+ return false;
+ }
+
+ ret = ms->nt->RegLoadKeyW(MsGetRootKeyFromInt(root), keyname, filename);
+
+ if (ret != ERROR_SUCCESS)
+ {
+ Debug("RegLoadKeyW: %S %S %u\n", keyname, filename, GetLastError());
+ return false;
+ }
+ WHERE;
+
+ return true;
+}
+
+// Unload the hive
+bool MsRegUnloadHive(UINT root, wchar_t *keyname)
+{
+ LONG ret;
+ if (keyname == NULL)
+ {
+ return false;
+ }
+
+ if (ms->nt == NULL || ms->nt->RegLoadKeyW == NULL || ms->nt->RegUnLoadKeyW == NULL)
+ {
+ return false;
+ }
+
+ ret = ms->nt->RegUnLoadKeyW(MsGetRootKeyFromInt(root), keyname);
+
+ if (ret != ERROR_SUCCESS)
+ {
+ Debug("RegUnLoadKeyW: %u\n", GetLastError());
+ return false;
+ }
+
+ return true;
+}
+
// Delete the value
bool MsRegDeleteValue(UINT root, char *keyname, char *valuename)
{