advapi32: Accept a NULL lpServiceStatus in ControlService.
This commit is contained in:
parent
95fa37ff84
commit
038c3a264b
|
@ -1037,26 +1037,29 @@ BOOL WINAPI ControlService( SC_HANDLE hService, DWORD dwControl,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
ret = QueryServiceStatus(hService, lpServiceStatus);
|
||||
if (!ret)
|
||||
if (lpServiceStatus)
|
||||
{
|
||||
ERR("failed to query service status\n");
|
||||
SetLastError(ERROR_SERVICE_NOT_ACTIVE);
|
||||
return FALSE;
|
||||
}
|
||||
ret = QueryServiceStatus(hService, lpServiceStatus);
|
||||
if (!ret)
|
||||
{
|
||||
ERR("failed to query service status\n");
|
||||
SetLastError(ERROR_SERVICE_NOT_ACTIVE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
switch (lpServiceStatus->dwCurrentState)
|
||||
{
|
||||
case SERVICE_STOPPED:
|
||||
SetLastError(ERROR_SERVICE_NOT_ACTIVE);
|
||||
return FALSE;
|
||||
case SERVICE_START_PENDING:
|
||||
if (dwControl==SERVICE_CONTROL_STOP)
|
||||
break;
|
||||
/* fall thru */
|
||||
case SERVICE_STOP_PENDING:
|
||||
SetLastError(ERROR_SERVICE_CANNOT_ACCEPT_CTRL);
|
||||
return FALSE;
|
||||
switch (lpServiceStatus->dwCurrentState)
|
||||
{
|
||||
case SERVICE_STOPPED:
|
||||
SetLastError(ERROR_SERVICE_NOT_ACTIVE);
|
||||
return FALSE;
|
||||
case SERVICE_START_PENDING:
|
||||
if (dwControl==SERVICE_CONTROL_STOP)
|
||||
break;
|
||||
/* fall thru */
|
||||
case SERVICE_STOP_PENDING:
|
||||
SetLastError(ERROR_SERVICE_CANNOT_ACCEPT_CTRL);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
handle = service_open_pipe(hsvc->name);
|
||||
|
|
Loading…
Reference in New Issue