Commit 049ac1d8 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

services: Hold an additional process reference while waiting for startup.

parent cafcf644
...@@ -778,7 +778,7 @@ static DWORD service_start_process(struct service_entry *service_entry, struct p ...@@ -778,7 +778,7 @@ static DWORD service_start_process(struct service_entry *service_entry, struct p
service_entry->status.dwCurrentState = SERVICE_START_PENDING; service_entry->status.dwCurrentState = SERVICE_START_PENDING;
scmdatabase_add_process(service_entry->db, process); scmdatabase_add_process(service_entry->db, process);
service_entry->process = process; service_entry->process = grab_process(process);
service_unlock(service_entry); service_unlock(service_entry);
...@@ -788,6 +788,7 @@ static DWORD service_start_process(struct service_entry *service_entry, struct p ...@@ -788,6 +788,7 @@ static DWORD service_start_process(struct service_entry *service_entry, struct p
{ {
err = GetLastError(); err = GetLastError();
process_terminate(process); process_terminate(process);
release_process(process);
return err; return err;
} }
...@@ -916,6 +917,8 @@ DWORD service_start(struct service_entry *service, DWORD service_argc, LPCWSTR * ...@@ -916,6 +917,8 @@ DWORD service_start(struct service_entry *service, DWORD service_argc, LPCWSTR *
ReleaseMutex(process->control_mutex); ReleaseMutex(process->control_mutex);
else else
process_terminate(process); process_terminate(process);
release_process(process);
} }
scmdatabase_unlock_startup(service->db); scmdatabase_unlock_startup(service->db);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment