https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1aa359ec7f5cd7597d3d1…
commit 1aa359ec7f5cd7597d3d138c7323dedac9774e41
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Feb 25 00:31:17 2018 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Feb 25 00:49:58 2018 +0100
[SERVICES] Send services shutdown notifications only if they accept them.
---
base/system/services/database.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/base/system/services/database.c b/base/system/services/database.c
index d28a98c082..9ae8441b64 100644
--- a/base/system/services/database.c
+++ b/base/system/services/database.c
@@ -2164,10 +2164,11 @@ ScmAutoShutdownServices(VOID)
{
CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry);
- if (CurrentService->Status.dwCurrentState == SERVICE_RUNNING ||
- CurrentService->Status.dwCurrentState == SERVICE_START_PENDING)
+ if ((CurrentService->Status.dwControlsAccepted & SERVICE_ACCEPT_SHUTDOWN)
&&
+ (CurrentService->Status.dwCurrentState == SERVICE_RUNNING ||
+ CurrentService->Status.dwCurrentState == SERVICE_START_PENDING))
{
- /* shutdown service */
+ /* Send the shutdown notification */
DPRINT("Shutdown service: %S\n",
CurrentService->lpServiceName);
ScmControlService(CurrentService->lpImage->hControlPipe,
CurrentService->lpServiceName,