mirror of
https://github.com/reactos/wine.git
synced 2024-11-24 20:30:01 +00:00
advapi32: Added check for NULL pointer being passed to QueryServiceStatus for either parameter.
This commit is contained in:
parent
a2d1c7df5e
commit
fd0bec1f96
@ -1130,6 +1130,17 @@ BOOL WINAPI QueryServiceStatus(SC_HANDLE hService,
|
||||
|
||||
TRACE("%p %p\n", hService, lpservicestatus);
|
||||
|
||||
if (!hService)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (!lpservicestatus)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_ADDRESS);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ret = QueryServiceStatusEx(hService, SC_STATUS_PROCESS_INFO, (LPBYTE)&SvcStatusData,
|
||||
sizeof(SERVICE_STATUS_PROCESS), &dummy);
|
||||
if (ret) memcpy(lpservicestatus, &SvcStatusData, sizeof(SERVICE_STATUS)) ;
|
||||
|
@ -925,7 +925,6 @@ static void test_query_svc(void)
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = QueryServiceStatus(svc_handle, NULL);
|
||||
ok(!ret, "Expected failure\n");
|
||||
todo_wine
|
||||
ok(GetLastError() == ERROR_INVALID_ADDRESS ||
|
||||
GetLastError() == ERROR_INVALID_PARAMETER /* NT4 */,
|
||||
"Unexpected last error %d\n", GetLastError());
|
||||
|
Loading…
Reference in New Issue
Block a user