Author: hbelusca
Date: Fri Feb 13 16:16:28 2015
New Revision: 66248
URL:
http://svn.reactos.org/svn/reactos?rev=66248&view=rev
Log:
[BASESRV]: Only SHUTDOWN_NORETRY can be set via Get/SetProcessShutdownParameters APIs.
Modified:
trunk/reactos/subsystems/win/basesrv/proc.c
Modified: trunk/reactos/subsystems/win/basesrv/proc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win/basesrv/pro…
==============================================================================
--- trunk/reactos/subsystems/win/basesrv/proc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win/basesrv/proc.c [iso-8859-1] Fri Feb 13 16:16:28 2015
@@ -288,7 +288,8 @@
ASSERT(CsrThread);
ShutdownParametersRequest->ShutdownLevel =
CsrThread->Process->ShutdownLevel;
- ShutdownParametersRequest->ShutdownFlags =
CsrThread->Process->ShutdownFlags;
+ /* Only SHUTDOWN_NORETRY flag is valid for this API. The other private flags are for
CSRSRV/WINSRV only. */
+ ShutdownParametersRequest->ShutdownFlags = CsrThread->Process->ShutdownFlags
& SHUTDOWN_NORETRY;
return STATUS_SUCCESS;
}
@@ -299,7 +300,15 @@
PCSR_THREAD CsrThread = CsrGetClientThread();
ASSERT(CsrThread);
+ /* Only SHUTDOWN_NORETRY flag is valid for this API. The other private flags are for
CSRSRV/WINSRV only. */
+ if (ShutdownParametersRequest->ShutdownFlags & ~SHUTDOWN_NORETRY)
+ {
+ /* If there were other flags specified, fail the call */
+ return STATUS_INVALID_PARAMETER;
+ }
+
CsrThread->Process->ShutdownLevel =
ShutdownParametersRequest->ShutdownLevel;
+ /* Notice that all the possible other private flags are reinitialized here */
CsrThread->Process->ShutdownFlags =
ShutdownParametersRequest->ShutdownFlags;
return STATUS_SUCCESS;