mirror of
https://github.com/reactos/reactos.git
synced 2024-06-28 00:41:36 +00:00
[SYSSETUP] Save the HKEY_USERS\.DEFAULT hive in the ntuser.dat file of the default user profile
This commit is contained in:
parent
249dc97165
commit
e7340a2800
|
@ -1171,6 +1171,52 @@ done:
|
|||
}
|
||||
|
||||
|
||||
static
|
||||
DWORD
|
||||
SaveDefaultUserHive(VOID)
|
||||
{
|
||||
WCHAR szDefaultUserHive[MAX_PATH];
|
||||
HKEY hUserKey = NULL;
|
||||
DWORD cchSize;
|
||||
DWORD dwError;
|
||||
|
||||
DPRINT("SaveDefaultUserHive()\n");
|
||||
|
||||
cchSize = ARRAYSIZE(szDefaultUserHive);
|
||||
GetDefaultUserProfileDirectoryW(szDefaultUserHive, &cchSize);
|
||||
|
||||
wcscat(szDefaultUserHive, L"\\ntuser.dat");
|
||||
|
||||
dwError = RegOpenKeyExW(HKEY_USERS,
|
||||
L".DEFAULT",
|
||||
0,
|
||||
KEY_READ,
|
||||
&hUserKey);
|
||||
if (dwError != ERROR_SUCCESS)
|
||||
{
|
||||
DPRINT1("RegOpenKeyExW() failed (Error %lu)\n", dwError);
|
||||
return dwError;
|
||||
}
|
||||
|
||||
pSetupEnablePrivilege(L"SeBackupPrivilege", TRUE);
|
||||
|
||||
dwError = RegSaveKeyExW(hUserKey,
|
||||
szDefaultUserHive,
|
||||
NULL,
|
||||
REG_STANDARD_FORMAT);
|
||||
if (dwError != ERROR_SUCCESS)
|
||||
{
|
||||
DPRINT1("RegSaveKeyExW() failed (Error %lu)\n", dwError);
|
||||
}
|
||||
|
||||
pSetupEnablePrivilege(L"SeBackupPrivilege", FALSE);
|
||||
|
||||
RegCloseKey(hUserKey);
|
||||
|
||||
return dwError;
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
DWORD
|
||||
InstallReactOS(VOID)
|
||||
|
@ -1233,6 +1279,8 @@ InstallReactOS(VOID)
|
|||
CreateDirectory(szBuffer, NULL);
|
||||
}
|
||||
|
||||
SaveDefaultUserHive();
|
||||
|
||||
hHotkeyThread = CreateThread(NULL, 0, HotkeyThread, NULL, 0, NULL);
|
||||
|
||||
/* Hack: Install TCP/IP protocol driver */
|
||||
|
|
Loading…
Reference in a new issue