Commit 1e2a24e9 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

wininet/tests: Fix InternetGetConnectedStateEx() parameter checking.

It should set the error code if given a non-zero reserved value.
parent 6fa67bc8
......@@ -1216,7 +1216,10 @@ BOOL WINAPI InternetGetConnectedStateExW(LPDWORD lpdwStatus, LPWSTR lpszConnecti
/* Must be zero */
if(dwReserved)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
for (;;)
{
......
......@@ -1759,6 +1759,11 @@ static void test_InternetGetConnectedStateExW(void)
res = pInternetGetConnectedStateExW(NULL, NULL, 0, 0);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
SetLastError(0xdeadbeef);
res = pInternetGetConnectedStateExW(NULL, NULL, 0, 1);
ok(res == FALSE, "Expected TRUE, got %d\n", res);
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Unexpected gle %lu\n", GetLastError());
flags = 0;
res = pInternetGetConnectedStateExW(&flags, NULL, 0, 0);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
......
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