diff --git a/programs/services/rpc.c b/programs/services/rpc.c index 228371cd8ae..45366fb903f 100644 --- a/programs/services/rpc.c +++ b/programs/services/rpc.c @@ -1137,7 +1137,8 @@ DWORD __cdecl svcctl_ControlService( if (result == ERROR_SUCCESS && service->service_entry->force_shutdown) { result = ERROR_SERVICE_CANNOT_ACCEPT_CTRL; - service_terminate(service->service_entry); + if ((process = service->service_entry->process)) + process_terminate(process); } if (result != ERROR_SUCCESS) diff --git a/programs/services/services.c b/programs/services/services.c index feb137de95e..b0d008d492c 100644 --- a/programs/services/services.c +++ b/programs/services/services.c @@ -787,7 +787,7 @@ static DWORD service_start_process(struct service_entry *service_entry, struct p if (!r) { err = GetLastError(); - service_terminate(service_entry); + process_terminate(process); return err; } @@ -915,7 +915,7 @@ DWORD service_start(struct service_entry *service, DWORD service_argc, LPCWSTR * if (err == ERROR_SUCCESS) ReleaseMutex(process->control_mutex); else - service_terminate(service); + process_terminate(process); } scmdatabase_unlock_startup(service->db); @@ -925,21 +925,6 @@ DWORD service_start(struct service_entry *service, DWORD service_argc, LPCWSTR * return err; } -void service_terminate(struct service_entry *service) -{ - struct process_entry *process; - - service_lock(service); - if ((process = service->process)) - { - TerminateProcess(process->process, 0); - release_process(process); - service->process = NULL; - } - service->status.dwCurrentState = SERVICE_STOPPED; - service_unlock(service); -} - void process_terminate(struct process_entry *process) { struct scmdatabase *db = process->db; diff --git a/programs/services/services.h b/programs/services/services.h index 778b30a2318..16f99f89fa8 100644 --- a/programs/services/services.h +++ b/programs/services/services.h @@ -88,7 +88,6 @@ void release_service(struct service_entry *service); void service_lock(struct service_entry *service); void service_unlock(struct service_entry *service); DWORD service_start(struct service_entry *service, DWORD service_argc, LPCWSTR *service_argv); -void service_terminate(struct service_entry *service); /* Process functions */