Commit 038c3a26 authored by Paul Chitescu's avatar Paul Chitescu Committed by Alexandre Julliard

advapi32: Accept a NULL lpServiceStatus in ControlService.

parent 95fa37ff
......@@ -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);
......
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