urlmon: Added support for invalid flag combinations to CreateUri.
This commit is contained in:
parent
b3ad7469d0
commit
0daa39fa97
|
@ -3683,11 +3683,9 @@ static void test_CreateUri_InvalidFlags(void) {
|
||||||
IUri *uri = (void*) 0xdeadbeef;
|
IUri *uri = (void*) 0xdeadbeef;
|
||||||
|
|
||||||
hr = pCreateUri(http_urlW, invalid_flag_tests[i].flags, 0, &uri);
|
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",
|
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);
|
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);
|
||||||
todo_wine { 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;
|
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));
|
ret = heap_alloc(sizeof(Uri));
|
||||||
if(!ret)
|
if(!ret)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
Loading…
Reference in New Issue