Commit 0daa39fa authored by Thomas Mullaly's avatar Thomas Mullaly Committed by Alexandre Julliard

urlmon: Added support for invalid flag combinations to CreateUri.

parent b3ad7469
......@@ -3683,11 +3683,9 @@ static void test_CreateUri_InvalidFlags(void) {
IUri *uri = (void*) 0xdeadbeef;
hr = pCreateUri(http_urlW, invalid_flag_tests[i].flags, 0, &uri);
todo_wine {
ok(hr == invalid_flag_tests[i].expected, "Error: CreateUri returned 0x%08x, expected 0x%08x, flags=0x%08x\n",
hr, invalid_flag_tests[i].expected, invalid_flag_tests[i].flags);
}
todo_wine { ok(uri == NULL, "Error: expected the IUri to be NULL, but it was %p instead\n", uri); }
ok(hr == invalid_flag_tests[i].expected, "Error: CreateUri returned 0x%08x, expected 0x%08x, flags=0x%08x\n",
hr, invalid_flag_tests[i].expected, invalid_flag_tests[i].flags);
ok(uri == NULL, "Error: expected the IUri to be NULL, but it was %p instead\n", uri);
}
}
......
......@@ -3761,6 +3761,16 @@ HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IU
return E_INVALIDARG;
}
/* Check for invalid flags. */
if((dwFlags & Uri_CREATE_DECODE_EXTRA_INFO && dwFlags & Uri_CREATE_NO_DECODE_EXTRA_INFO) ||
(dwFlags & Uri_CREATE_CANONICALIZE && dwFlags & Uri_CREATE_NO_CANONICALIZE) ||
(dwFlags & Uri_CREATE_CRACK_UNKNOWN_SCHEMES && dwFlags & Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES) ||
(dwFlags & Uri_CREATE_PRE_PROCESS_HTML_URI && dwFlags & Uri_CREATE_NO_PRE_PROCESS_HTML_URI) ||
(dwFlags & Uri_CREATE_IE_SETTINGS && dwFlags & Uri_CREATE_NO_IE_SETTINGS)) {
*ppURI = NULL;
return E_INVALIDARG;
}
ret = heap_alloc(sizeof(Uri));
if(!ret)
return E_OUTOFMEMORY;
......
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