diff --git a/dll/win32/syssetup/install.c b/dll/win32/syssetup/install.c index ad14449a56e..74b357d4442 100644 --- a/dll/win32/syssetup/install.c +++ b/dll/win32/syssetup/install.c @@ -1279,7 +1279,17 @@ InstallReactOS(VOID) CreateDirectory(szBuffer, NULL); } - SaveDefaultUserHive(); + if (SaveDefaultUserHive() != ERROR_SUCCESS) + { + FatalError("SaveDefaultUserHive() failed"); + return 0; + } + + if (!CopySystemProfile(0)) + { + FatalError("CopySystemProfile() failed"); + return 0; + } hHotkeyThread = CreateThread(NULL, 0, HotkeyThread, NULL, 0, NULL); diff --git a/dll/win32/userenv/profile.c b/dll/win32/userenv/profile.c index 0b49d7a8699..a7289211bec 100644 --- a/dll/win32/userenv/profile.c +++ b/dll/win32/userenv/profile.c @@ -109,7 +109,7 @@ AcquireRemoveRestorePrivilege(IN BOOL bAcquire) BOOL WINAPI CopySystemProfile( - IN ULONG Unused) + _In_ ULONG Unused) { WCHAR szKeyName[MAX_PATH]; WCHAR szRawProfilePath[MAX_PATH]; @@ -231,46 +231,6 @@ CopySystemProfile( goto done; } - /* Create user hive file */ - -#if 0 - /* Use the default hive file name */ -// StringCbCopyW(szBuffer, sizeof(szBuffer), szProfilePath); - StringCbCatW(szProfilePath, sizeof(szProfilePath), L"\\ntuser.dat"); - - /* Acquire restore privilege */ - if (!AcquireRemoveRestorePrivilege(TRUE)) - { - DPRINT1("Failed to acquire the restore privilege (Error %lu)\n", GetLastError()); - goto done; - } - - /* Load the user hive */ - dwError = RegLoadKeyW(HKEY_USERS, - SidString.Buffer, - szProfilePath); - AcquireRemoveRestorePrivilege(FALSE); - if (dwError != ERROR_SUCCESS) - { - DPRINT1("Failed to load the new registry hive (Error %lu)\n", dwError); - goto done; - } - - bResult = TRUE; - - /* Initialize the user hive */ - if (!CreateUserHive(SidString.Buffer, szProfilePath)) - { - DPRINT1("Failed to create the new hive (Error %lu)\n", GetLastError()); - bResult = FALSE; - } - - /* Unload the user hive */ - AcquireRemoveRestorePrivilege(TRUE); - RegUnLoadKeyW(HKEY_USERS, SidString.Buffer); - AcquireRemoveRestorePrivilege(FALSE); -#endif - bResult = TRUE; done: