Author: tfaber
Date: Sat Aug 30 07:04:57 2014
New Revision: 63981
URL:
http://svn.reactos.org/svn/reactos?rev=63981&view=rev
Log:
[USETUP][WINLOGON]
- Acuire SeShutdownPrivilege before calling NtShutdownSystem
CORE-8476
Modified:
trunk/reactos/base/setup/usetup/interface/usetup.c
trunk/reactos/base/setup/usetup/usetup.h
trunk/reactos/base/system/winlogon/sas.c
Modified: trunk/reactos/base/setup/usetup/interface/usetup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
==============================================================================
--- trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] Sat Aug 30 07:04:57
2014
@@ -4095,6 +4095,7 @@
PAGE_NUMBER Page;
LARGE_INTEGER Time;
NTSTATUS Status;
+ BOOLEAN Old;
NtQuerySystemTime(&Time);
@@ -4296,7 +4297,9 @@
NtDelayExecution(FALSE, &Time);
/* Reboot */
+ RtlAdjustPrivilege(SE_SHUTDOWN_PRIVILEGE, TRUE, FALSE, &Old);
NtShutdownSystem(ShutdownReboot);
+ RtlAdjustPrivilege(SE_SHUTDOWN_PRIVILEGE, Old, FALSE, &Old);
NtTerminateProcess(NtCurrentProcess(), 0);
}
Modified: trunk/reactos/base/setup/usetup/usetup.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.h…
==============================================================================
--- trunk/reactos/base/setup/usetup/usetup.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/usetup.h [iso-8859-1] Sat Aug 30 07:04:57 2014
@@ -48,6 +48,7 @@
#include <ndk/obfuncs.h>
#include <ndk/psfuncs.h>
#include <ndk/rtlfuncs.h>
+#include <ndk/setypes.h>
/* Filesystem headers */
#include <fslib/ext2lib.h>
Modified: trunk/reactos/base/system/winlogon/sas.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/sas.c…
==============================================================================
--- trunk/reactos/base/system/winlogon/sas.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/winlogon/sas.c [iso-8859-1] Sat Aug 30 07:04:57 2014
@@ -776,6 +776,7 @@
PLOGOFF_SHUTDOWN_DATA LSData;
HANDLE hThread;
DWORD exitCode;
+ BOOLEAN Old;
DisplayStatusMessage(Session, Session->WinlogonDesktop,
IDS_REACTOSISSHUTTINGDOWN);
@@ -821,6 +822,7 @@
UninitializeSAS(Session);
FIXME("FIXME: Call SMSS API #1\n");
+ RtlAdjustPrivilege(SE_SHUTDOWN_PRIVILEGE, TRUE, FALSE, &Old);
if (wlxAction == WLX_SAS_ACTION_SHUTDOWN_REBOOT)
NtShutdownSystem(ShutdownReboot);
else
@@ -832,6 +834,7 @@
}
NtShutdownSystem(ShutdownNoReboot);
}
+ RtlAdjustPrivilege(SE_SHUTDOWN_PRIVILEGE, Old, FALSE, &Old);
return STATUS_SUCCESS;
}