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:
Sebastian Lackner 2016-03-16 04:30:56 +01:00 committed by Alexandre Julliard
parent 38a09f9c7b
commit 7fc3107b4c
2 changed files with 2 additions and 1 deletions

View File

@ -507,7 +507,6 @@ static DWORD create_serviceW(
return err;
}
entry->ref_count = 1;
entry->is_wow64 = is_wow64;
entry->config.dwServiceType = entry->status.dwServiceType = dwServiceType;
entry->config.dwStartType = dwStartType;

View File

@ -107,6 +107,7 @@ DWORD service_create(LPCWSTR name, struct service_entry **entry)
HeapFree(GetProcessHeap(), 0, *entry);
return err;
}
(*entry)->ref_count = 1;
(*entry)->status.dwCurrentState = SERVICE_STOPPED;
(*entry)->status.dwWin32ExitCode = ERROR_SERVICE_NEVER_STARTED;
(*entry)->preshutdown_timeout = default_preshutdown_timeout;
@ -557,6 +558,7 @@ static DWORD scmdatabase_load_services(struct scmdatabase *db)
entry->db = db;
list_add_tail(&db->services, &entry->entry);
release_service(entry);
}
return ERROR_SUCCESS;
}