services: Initialize service ref_count directly in service_create.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
38a09f9c7b
commit
7fc3107b4c
|
@ -507,7 +507,6 @@ static DWORD create_serviceW(
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
entry->ref_count = 1;
|
|
||||||
entry->is_wow64 = is_wow64;
|
entry->is_wow64 = is_wow64;
|
||||||
entry->config.dwServiceType = entry->status.dwServiceType = dwServiceType;
|
entry->config.dwServiceType = entry->status.dwServiceType = dwServiceType;
|
||||||
entry->config.dwStartType = dwStartType;
|
entry->config.dwStartType = dwStartType;
|
||||||
|
|
|
@ -107,6 +107,7 @@ DWORD service_create(LPCWSTR name, struct service_entry **entry)
|
||||||
HeapFree(GetProcessHeap(), 0, *entry);
|
HeapFree(GetProcessHeap(), 0, *entry);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
(*entry)->ref_count = 1;
|
||||||
(*entry)->status.dwCurrentState = SERVICE_STOPPED;
|
(*entry)->status.dwCurrentState = SERVICE_STOPPED;
|
||||||
(*entry)->status.dwWin32ExitCode = ERROR_SERVICE_NEVER_STARTED;
|
(*entry)->status.dwWin32ExitCode = ERROR_SERVICE_NEVER_STARTED;
|
||||||
(*entry)->preshutdown_timeout = default_preshutdown_timeout;
|
(*entry)->preshutdown_timeout = default_preshutdown_timeout;
|
||||||
|
@ -557,6 +558,7 @@ static DWORD scmdatabase_load_services(struct scmdatabase *db)
|
||||||
entry->db = db;
|
entry->db = db;
|
||||||
|
|
||||||
list_add_tail(&db->services, &entry->entry);
|
list_add_tail(&db->services, &entry->entry);
|
||||||
|
release_service(entry);
|
||||||
}
|
}
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue