Commit 42fb9fe7 authored by Alexandre Julliard's avatar Alexandre Julliard

services: Properly initialize service status at creation time.

parent 3c88a2f0
...@@ -364,7 +364,7 @@ DWORD svcctl_CreateServiceW( ...@@ -364,7 +364,7 @@ DWORD svcctl_CreateServiceW(
err = service_create(lpServiceName, &entry); err = service_create(lpServiceName, &entry);
if (err != ERROR_SUCCESS) if (err != ERROR_SUCCESS)
return err; return err;
entry->config.dwServiceType = dwServiceType; entry->config.dwServiceType = entry->status.dwServiceType = dwServiceType;
entry->config.dwStartType = dwStartType; entry->config.dwStartType = dwStartType;
entry->config.dwErrorControl = dwErrorControl; entry->config.dwErrorControl = dwErrorControl;
entry->config.lpBinaryPathName = strdupW(lpBinaryPathName); entry->config.lpBinaryPathName = strdupW(lpBinaryPathName);
......
...@@ -71,6 +71,9 @@ DWORD service_create(LPCWSTR name, struct service_entry **entry) ...@@ -71,6 +71,9 @@ DWORD service_create(LPCWSTR name, struct service_entry **entry)
return ERROR_NOT_ENOUGH_SERVER_MEMORY; return ERROR_NOT_ENOUGH_SERVER_MEMORY;
} }
(*entry)->control_pipe = INVALID_HANDLE_VALUE; (*entry)->control_pipe = INVALID_HANDLE_VALUE;
(*entry)->status.dwCurrentState = SERVICE_STOPPED;
(*entry)->status.dwWin32ExitCode = ERROR_SERVICE_NEVER_STARTED;
/* all other fields are zero */
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
...@@ -442,10 +445,7 @@ static DWORD scmdatabase_load_services(struct scmdatabase *db) ...@@ -442,10 +445,7 @@ static DWORD scmdatabase_load_services(struct scmdatabase *db)
} }
entry->status.dwServiceType = entry->config.dwServiceType; entry->status.dwServiceType = entry->config.dwServiceType;
entry->status.dwCurrentState = SERVICE_STOPPED;
entry->status.dwWin32ExitCode = ERROR_SERVICE_NEVER_STARTED;
entry->db = db; entry->db = db;
/* all other fields are zero */
list_add_tail(&db->services, &entry->entry); list_add_tail(&db->services, &entry->entry);
} }
......
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