[WINSRV] Wait for the process to exit after calling NtTerminateProcess

NtTerminateProcess just queues an apc in every thread of the target process which in turn kills each thread. We need to wait so that all processes have enough time to exit before shutting down.
This commit is contained in:
Giannis Adamopoulos 2018-11-25 20:13:56 +02:00
parent 6d6e371225
commit 225c5c4a20

View file

@ -796,6 +796,8 @@ UserClientShutdown(IN PCSR_PROCESS CsrProcess,
#endif
NtTerminateProcess(CsrProcess->ProcessHandle, 0);
WaitForSingleObject(CsrProcess->ProcessHandle, ShutdownSettings.ProcessTerminateTimeout);
/* We are done */
CsrDereferenceProcess(CsrProcess);
return CsrShutdownCsrProcess;