From 90810f42a464df1cad1567285f0547700884aeeb Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Wed, 15 May 2013 22:01:07 +0000 Subject: [PATCH] [SYSSETUP] Enable the restore privilege before the call to NtUnloadKey. Disable it immediately after the call to NtUnloadKey. svn path=/trunk/; revision=59021 --- reactos/dll/win32/syssetup/install.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/reactos/dll/win32/syssetup/install.c b/reactos/dll/win32/syssetup/install.c index 457dad670fb..713fadb6760 100644 --- a/reactos/dll/win32/syssetup/install.c +++ b/reactos/dll/win32/syssetup/install.c @@ -915,11 +915,14 @@ InstallReactOS(HINSTANCE hInstance) return 0; } - SetPrivilege(SE_RESTORE_NAME, SE_PRIVILEGE_ENABLED); - /* ROS HACK, as long as NtUnloadKey is not implemented */ { - NTSTATUS Status = NtUnloadKey(NULL); + NTSTATUS Status; + + SetPrivilege(SE_RESTORE_NAME, SE_PRIVILEGE_ENABLED); + Status = NtUnloadKey(NULL); + SetPrivilege(SE_RESTORE_NAME, 0); + if (Status == STATUS_NOT_IMPLEMENTED) { /* Create the Administrator profile */ @@ -947,8 +950,6 @@ InstallReactOS(HINSTANCE hInstance) } /* END OF ROS HACK */ - SetPrivilege(SE_RESTORE_NAME, 0); - SetupCloseInfFile(hSysSetupInf); SetSetupType(0);