Commit 2eec6b04 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

wininet: Return correct errors in InternetOpenUrlW.

parent f57360af
......@@ -2934,6 +2934,7 @@ HINTERNET WINAPI INTERNET_InternetOpenUrlW(LPWININETAPPINFOW hIC, LPCWSTR lpszUr
/* gopher doesn't seem to be implemented in wine, but it's supposed
* to be supported by InternetOpenUrlA. */
default:
INTERNET_SetLastError(ERROR_INTERNET_UNRECOGNIZED_SCHEME);
break;
}
......@@ -2963,6 +2964,12 @@ HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl,
dump_INTERNET_FLAGS(dwFlags);
}
if (!lpszUrl)
{
SetLastError(ERROR_INVALID_PARAMETER);
goto lend;
}
hIC = (LPWININETAPPINFOW) WININET_GetObject( hInternet );
if (NULL == hIC || hIC->hdr.htype != WH_HINIT) {
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
......
......@@ -143,6 +143,14 @@ static void test_null(void)
ok(GetLastError() == ERROR_INVALID_HANDLE, "wrong error\n");
ok(hc == NULL, "connect failed\n");
hc = InternetOpenUrlW(hi, NULL, NULL, 0, 0, 0);
ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error\n");
ok(hc == NULL, "connect failed\n");
hc = InternetOpenUrlW(hi, szServer, NULL, 0, 0, 0);
ok(GetLastError() == ERROR_INTERNET_UNRECOGNIZED_SCHEME, "wrong error\n");
ok(hc == NULL, "connect failed\n");
InternetCloseHandle(hi);
}
......
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