mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 04:45:45 +00:00
- Add more error checks which reduce winetest errors
svn path=/trunk/; revision=39419
This commit is contained in:
parent
9e98af0628
commit
c6c028fe41
1 changed files with 57 additions and 1 deletions
|
@ -1025,6 +1025,48 @@ EnumServicesStatusA(SC_HANDLE hSCManager,
|
|||
|
||||
TRACE("EnumServicesStatusA() called\n");
|
||||
|
||||
if (!hSCManager)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (dwServiceType != SERVICE_DRIVER && dwServiceType != SERVICE_WIN32)
|
||||
{
|
||||
if (pcbBytesNeeded && lpServicesReturned)
|
||||
{
|
||||
*pcbBytesNeeded = 0;
|
||||
*lpServicesReturned = 0;
|
||||
}
|
||||
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (dwServiceState != SERVICE_ACTIVE && dwServiceState != SERVICE_INACTIVE && dwServiceState != SERVICE_STATE_ALL)
|
||||
{
|
||||
if (pcbBytesNeeded)
|
||||
*pcbBytesNeeded = 0;
|
||||
|
||||
if (lpServicesReturned)
|
||||
*lpServicesReturned = 0;
|
||||
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!pcbBytesNeeded || !lpServicesReturned || !lpResumeHandle)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_ADDRESS);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!lpServices && cbBufSize != 0)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_ADDRESS);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
RpcTryExcept
|
||||
{
|
||||
dwError = REnumServicesStatusA((SC_RPC_HANDLE)hSCManager,
|
||||
|
@ -1407,6 +1449,8 @@ GetServiceKeyNameA(SC_HANDLE hSCManager,
|
|||
if (!lpDisplayName)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_ADDRESS);
|
||||
|
||||
if (!lpServiceName)
|
||||
*lpcchBuffer = 1;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -2295,6 +2339,12 @@ QueryServiceStatus(SC_HANDLE hService,
|
|||
TRACE("QueryServiceStatus(%p, %p)\n",
|
||||
hService, lpServiceStatus);
|
||||
|
||||
if (!hService)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
RpcTryExcept
|
||||
{
|
||||
/* Call to services.exe using RPC */
|
||||
|
@ -2334,6 +2384,12 @@ QueryServiceStatusEx(SC_HANDLE hService,
|
|||
|
||||
TRACE("QueryServiceStatusEx() called\n");
|
||||
|
||||
if (InfoLevel != SC_STATUS_PROCESS_INFO)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_LEVEL);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
RpcTryExcept
|
||||
{
|
||||
/* Call to services.exe using RPC */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue