From: Francois Gouget fgouget@codeweavers.com
It should set the error code if given a non-zero reserved value. --- dlls/wininet/internet.c | 3 +++ dlls/wininet/tests/internet.c | 5 +++++ 2 files changed, 8 insertions(+)
diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 665e339f920..a2d9f00ce6f 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -1216,7 +1216,10 @@ BOOL WINAPI InternetGetConnectedStateExW(LPDWORD lpdwStatus, LPWSTR lpszConnecti
/* Must be zero */ if(dwReserved) + { + SetLastError(ERROR_INVALID_PARAMETER); return FALSE; + }
for (;;) { diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c index a32813b598b..50bb4883735 100644 --- a/dlls/wininet/tests/internet.c +++ b/dlls/wininet/tests/internet.c @@ -1747,6 +1747,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);