From 1aa359ec7f5cd7597d3d138c7323dedac9774e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 25 Feb 2018 00:31:17 +0100 Subject: [PATCH] [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 d28a98c0826..9ae8441b648 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,