https://git.reactos.org/?p=reactos.git;a=commitdiff;h=225c5c4a20aa16b1e068e…
commit 225c5c4a20aa16b1e068eda6e426def38871687a
Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
AuthorDate: Sun Nov 25 20:13:56 2018 +0200
Commit: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
CommitDate: Tue Nov 27 10:28:31 2018 +0200
[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.
---
win32ss/user/winsrv/usersrv/shutdown.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/win32ss/user/winsrv/usersrv/shutdown.c b/win32ss/user/winsrv/usersrv/shutdown.c
index 5c2f464f84..7238b21ab8 100644
--- a/win32ss/user/winsrv/usersrv/shutdown.c
+++ b/win32ss/user/winsrv/usersrv/shutdown.c
@@ -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;