https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bf1e655172088eb372b23…
commit bf1e655172088eb372b23e968205cf9c8f841da2
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Jul 29 23:19:14 2018 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Jul 29 23:40:36 2018 +0200
[ADVAPI32] Stop the service dispatcher thread only if a SERVICE_CONTROL_STOP command
was sent
---
dll/win32/advapi32/service/sctrl.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dll/win32/advapi32/service/sctrl.c b/dll/win32/advapi32/service/sctrl.c
index 8b28b2bffa..f4a7aa85c4 100644
--- a/dll/win32/advapi32/service/sctrl.c
+++ b/dll/win32/advapi32/service/sctrl.c
@@ -602,9 +602,10 @@ ScServiceDispatcher(HANDLE hPipe,
lpServiceName = (LPWSTR)((PBYTE)ControlPacket +
ControlPacket->dwServiceNameOffset);
TRACE("Service: %S\n", lpServiceName);
- if (lpServiceName[0] == UNICODE_NULL)
+ if ((ControlPacket->dwControl == SERVICE_CONTROL_STOP) &&
+ (lpServiceName[0] == UNICODE_NULL))
{
- ERR("Stop dispatcher thread\n");
+ TRACE("Stop dispatcher thread\n");
bRunning = FALSE;
dwError = ERROR_SUCCESS;
}