From a2fbbd9209faa9589180c6eff018ee1fbc0696ef Mon Sep 17 00:00:00 2001 From: Rolf Kalbermatter Date: Sun, 22 Apr 2007 22:26:47 +0200 Subject: [PATCH] advapi32: Make SERVICE_STATUS_PROCESS match the declaration in MSDN and PSDK. --- dlls/advapi32/service.c | 28 ++++++++++++++-------------- include/winsvc.h | 8 +++++++- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c index 34cb96a4a1..3be52751ba 100644 --- a/dlls/advapi32/service.c +++ b/dlls/advapi32/service.c @@ -1580,7 +1580,7 @@ BOOL WINAPI QueryServiceStatus(SC_HANDLE hService, ret = QueryServiceStatusEx(hService, SC_STATUS_PROCESS_INFO, (LPBYTE)&SvcStatusData, sizeof(SERVICE_STATUS_PROCESS), NULL); - if (ret) *lpservicestatus = SvcStatusData.status; + if (ret) memcpy(lpservicestatus, &SvcStatusData, sizeof(SERVICE_STATUS)) ; return ret; } @@ -1642,20 +1642,20 @@ BOOL WINAPI QueryServiceStatusEx(SC_HANDLE hService, SC_STATUS_TYPE InfoLevel, return FALSE; } - /* FIXME: this would be the pid from service_start_process() */ - pSvcStatusData->dwProcessId = 0; - /* service is running in a process that is not a system process */ - pSvcStatusData->dwServiceFlags = 0; - pipe = service_open_pipe(hsvc->name); if (pipe != INVALID_HANDLE_VALUE) { - r = service_get_status(pipe, &pSvcStatusData->status); + r = service_get_status(pipe, (LPSERVICE_STATUS)&pSvcStatusData); CloseHandle(pipe); if (r) return TRUE; } + /* FIXME: this would be the pid from service_start_process() */ + pSvcStatusData->dwProcessId = 0; + /* service is running in a process that is not a system process */ + pSvcStatusData->dwServiceFlags = 0; + TRACE("Failed to read service status\n"); /* read the service type from the registry */ @@ -1664,13 +1664,13 @@ BOOL WINAPI QueryServiceStatusEx(SC_HANDLE hService, SC_STATUS_TYPE InfoLevel, if (r != ERROR_SUCCESS || type != REG_DWORD) val = 0; - pSvcStatusData->status.dwServiceType = val; - pSvcStatusData->status.dwCurrentState = SERVICE_STOPPED; /* stopped */ - pSvcStatusData->status.dwControlsAccepted = 0; - pSvcStatusData->status.dwWin32ExitCode = ERROR_SERVICE_NEVER_STARTED; - pSvcStatusData->status.dwServiceSpecificExitCode = 0; - pSvcStatusData->status.dwCheckPoint = 0; - pSvcStatusData->status.dwWaitHint = 0; + pSvcStatusData->dwServiceType = val; + pSvcStatusData->dwCurrentState = SERVICE_STOPPED; /* stopped */ + pSvcStatusData->dwControlsAccepted = 0; + pSvcStatusData->dwWin32ExitCode = ERROR_SERVICE_NEVER_STARTED; + pSvcStatusData->dwServiceSpecificExitCode = 0; + pSvcStatusData->dwCheckPoint = 0; + pSvcStatusData->dwWaitHint = 0; return TRUE; } diff --git a/include/winsvc.h b/include/winsvc.h index eeb953953c..617b9f4bac 100644 --- a/include/winsvc.h +++ b/include/winsvc.h @@ -135,7 +135,13 @@ typedef struct _SERVICE_STATUS { typedef struct _SERVICE_STATUS_PROCESS { - SERVICE_STATUS status; + DWORD dwServiceType; + DWORD dwCurrentState; + DWORD dwControlsAccepted; + DWORD dwWin32ExitCode; + DWORD dwServiceSpecificExitCode; + DWORD dwCheckPoint; + DWORD dwWaitHint; DWORD dwProcessId; DWORD dwServiceFlags; } SERVICE_STATUS_PROCESS, *LPSERVICE_STATUS_PROCESS;