advapi32: Make SERVICE_STATUS_PROCESS match the declaration in MSDN and PSDK.

This commit is contained in:
Rolf Kalbermatter 2007-04-22 22:26:47 +02:00 committed by Alexandre Julliard
parent 1d19c2b72f
commit a2fbbd9209
2 changed files with 21 additions and 15 deletions

View File

@ -1580,7 +1580,7 @@ BOOL WINAPI QueryServiceStatus(SC_HANDLE hService,
ret = QueryServiceStatusEx(hService, SC_STATUS_PROCESS_INFO, (LPBYTE)&SvcStatusData, ret = QueryServiceStatusEx(hService, SC_STATUS_PROCESS_INFO, (LPBYTE)&SvcStatusData,
sizeof(SERVICE_STATUS_PROCESS), NULL); sizeof(SERVICE_STATUS_PROCESS), NULL);
if (ret) *lpservicestatus = SvcStatusData.status; if (ret) memcpy(lpservicestatus, &SvcStatusData, sizeof(SERVICE_STATUS)) ;
return ret; return ret;
} }
@ -1642,20 +1642,20 @@ BOOL WINAPI QueryServiceStatusEx(SC_HANDLE hService, SC_STATUS_TYPE InfoLevel,
return FALSE; 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); pipe = service_open_pipe(hsvc->name);
if (pipe != INVALID_HANDLE_VALUE) if (pipe != INVALID_HANDLE_VALUE)
{ {
r = service_get_status(pipe, &pSvcStatusData->status); r = service_get_status(pipe, (LPSERVICE_STATUS)&pSvcStatusData);
CloseHandle(pipe); CloseHandle(pipe);
if (r) if (r)
return TRUE; 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"); TRACE("Failed to read service status\n");
/* read the service type from the registry */ /* 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) if (r != ERROR_SUCCESS || type != REG_DWORD)
val = 0; val = 0;
pSvcStatusData->status.dwServiceType = val; pSvcStatusData->dwServiceType = val;
pSvcStatusData->status.dwCurrentState = SERVICE_STOPPED; /* stopped */ pSvcStatusData->dwCurrentState = SERVICE_STOPPED; /* stopped */
pSvcStatusData->status.dwControlsAccepted = 0; pSvcStatusData->dwControlsAccepted = 0;
pSvcStatusData->status.dwWin32ExitCode = ERROR_SERVICE_NEVER_STARTED; pSvcStatusData->dwWin32ExitCode = ERROR_SERVICE_NEVER_STARTED;
pSvcStatusData->status.dwServiceSpecificExitCode = 0; pSvcStatusData->dwServiceSpecificExitCode = 0;
pSvcStatusData->status.dwCheckPoint = 0; pSvcStatusData->dwCheckPoint = 0;
pSvcStatusData->status.dwWaitHint = 0; pSvcStatusData->dwWaitHint = 0;
return TRUE; return TRUE;
} }

View File

@ -135,7 +135,13 @@ typedef struct _SERVICE_STATUS {
typedef struct _SERVICE_STATUS_PROCESS 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 dwProcessId;
DWORD dwServiceFlags; DWORD dwServiceFlags;
} SERVICE_STATUS_PROCESS, *LPSERVICE_STATUS_PROCESS; } SERVICE_STATUS_PROCESS, *LPSERVICE_STATUS_PROCESS;