mirror of
https://github.com/reactos/wine.git
synced 2025-01-19 10:13:01 +00:00
urlmon: CreateUri should return E_INVALIDARG for NULL args.
This commit is contained in:
parent
3aa93e11ad
commit
c79be42057
@ -20,7 +20,9 @@
|
||||
|
||||
/*
|
||||
* IUri testing framework goals:
|
||||
* - Test invalid flags
|
||||
* - Test invalid args
|
||||
* - invalid flags
|
||||
* - invalid args (IUri, uri string)
|
||||
* - Test parsing for components when no canonicalization occurs
|
||||
* - Test parsing for components when canonicalization occurs.
|
||||
* - More tests...
|
||||
@ -75,6 +77,18 @@ static void test_CreateUri_InvalidFlags(void) {
|
||||
}
|
||||
}
|
||||
|
||||
static void test_CreateUri_InvalidArgs(void) {
|
||||
HRESULT hr;
|
||||
IUri *uri = (void*) 0xdeadbeef;
|
||||
|
||||
hr = pCreateUri(http_urlW, 0, 0, NULL);
|
||||
ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr, E_INVALIDARG);
|
||||
|
||||
hr = pCreateUri(NULL, 0, 0, &uri);
|
||||
ok(hr == E_INVALIDARG, "Error: CreateUri returned 0x%08x, expected 0x%08x\n", hr, E_INVALIDARG);
|
||||
ok(uri == NULL, "Error: Expected the IUri to be NULL, but it was %p instead\n", uri);
|
||||
}
|
||||
|
||||
START_TEST(uri) {
|
||||
HMODULE hurlmon;
|
||||
|
||||
@ -88,4 +102,7 @@ START_TEST(uri) {
|
||||
|
||||
trace("test CreateUri invalid flags...\n");
|
||||
test_CreateUri_InvalidFlags();
|
||||
|
||||
trace("test CreateUri invalid args...\n");
|
||||
test_CreateUri_InvalidArgs();
|
||||
}
|
||||
|
@ -296,6 +296,14 @@ HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IU
|
||||
|
||||
TRACE("(%s %x %x %p)\n", debugstr_w(pwzURI), dwFlags, (DWORD)dwReserved, ppURI);
|
||||
|
||||
if(!ppURI)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if(!pwzURI) {
|
||||
*ppURI = NULL;
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
ret = heap_alloc(sizeof(Uri));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
Loading…
x
Reference in New Issue
Block a user