services: Terminate service when its status is set to SERVICE_STOPPED.

This commit is contained in:
Piotr Caban 2011-12-12 11:04:58 +01:00 committed by Alexandre Julliard
parent 01ef66cb1e
commit c21ede4474

View file

@ -697,7 +697,9 @@ DWORD __cdecl svcctl_SetServiceStatus(
service->service_entry->status.dwWaitHint = lpServiceStatus->dwWaitHint;
service_unlock(service->service_entry);
if (service->service_entry->status_changed_event)
if (lpServiceStatus->dwCurrentState == SERVICE_STOPPED)
service_terminate(service->service_entry);
else if (service->service_entry->status_changed_event)
SetEvent(service->service_entry->status_changed_event);
return ERROR_SUCCESS;