wtsapi32: Extend the parameter check of WTSEnumerateProcessesW.
This commit is contained in:
parent
cb9c2d429f
commit
0d2ff50e22
|
@ -45,41 +45,33 @@ static void test_WTSEnumerateProcessesW(void)
|
||||||
info = NULL;
|
info = NULL;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 1, 1, &info, &count);
|
ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 1, 1, &info, &count);
|
||||||
todo_wine
|
|
||||||
ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
|
ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
|
||||||
todo_wine
|
|
||||||
ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
|
ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
|
||||||
if (info) WTSFreeMemory(info);
|
if (info) WTSFreeMemory(info);
|
||||||
|
|
||||||
info = NULL;
|
info = NULL;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 0, &info, &count);
|
ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 0, &info, &count);
|
||||||
todo_wine
|
|
||||||
ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
|
ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
|
||||||
todo_wine
|
|
||||||
ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
|
ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
|
||||||
if (info) WTSFreeMemory(info);
|
if (info) WTSFreeMemory(info);
|
||||||
|
|
||||||
info = NULL;
|
info = NULL;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 2, &info, &count);
|
ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 2, &info, &count);
|
||||||
todo_wine
|
|
||||||
ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
|
ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
|
||||||
todo_wine
|
|
||||||
ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
|
ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
|
||||||
if (info) WTSFreeMemory(info);
|
if (info) WTSFreeMemory(info);
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 1, NULL, &count);
|
ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 1, NULL, &count);
|
||||||
ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
|
ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
|
||||||
todo_wine
|
|
||||||
ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
|
ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
|
||||||
|
|
||||||
info = NULL;
|
info = NULL;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 1, &info, NULL);
|
ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 1, &info, NULL);
|
||||||
ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
|
ok(!ret, "expected WTSEnumerateProcessesW to fail\n");
|
||||||
todo_wine
|
|
||||||
ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
|
ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError());
|
||||||
if (info) WTSFreeMemory(info);
|
if (info) WTSFreeMemory(info);
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,11 @@ BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version
|
||||||
FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
|
FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version,
|
||||||
ppProcessInfo, pCount);
|
ppProcessInfo, pCount);
|
||||||
|
|
||||||
if (!ppProcessInfo || !pCount) return FALSE;
|
if (!ppProcessInfo || !pCount || Reserved != 0 || Version != 1)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
*pCount = 0;
|
*pCount = 0;
|
||||||
*ppProcessInfo = NULL;
|
*ppProcessInfo = NULL;
|
||||||
|
|
Loading…
Reference in New Issue