Commit bc71921f authored by Thomas Mullaly's avatar Thomas Mullaly Committed by Alexandre Julliard

urlmon: Added stub for CoInternetParseIUri.

parent bf228d4a
......@@ -68,6 +68,7 @@ static HRESULT (WINAPI *pCreateIUriBuilder)(IUri*, DWORD, DWORD_PTR, IUriBuilder
static HRESULT (WINAPI *pCoInternetCombineIUri)(IUri*,IUri*,DWORD,IUri**,DWORD_PTR);
static HRESULT (WINAPI *pCoInternetGetSession)(DWORD,IInternetSession**,DWORD);
static HRESULT (WINAPI *pCoInternetCombineUrlEx)(IUri*,LPCWSTR,DWORD,IUri**,DWORD_PTR);
static HRESULT (WINAPI *pCoInternetParseIUri)(IUri*,PARSEACTION,DWORD,LPWSTR,DWORD,DWORD*,DWORD_PTR);
static const WCHAR http_urlW[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
'.','o','r','g','/',0};
......@@ -9441,6 +9442,57 @@ static void test_CoInternetCombineUrlEx_Pluggable(void) {
if(base) IUri_Release(base);
}
static void test_CoInternetParseIUri_InvalidArgs(void) {
HRESULT hr;
IUri *uri = NULL;
WCHAR tmp[3];
DWORD result = -1;
hr = pCoInternetParseIUri(NULL, PARSE_CANONICALIZE, 0, tmp, 3, &result, 0);
ok(hr == E_INVALIDARG, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
hr, E_INVALIDARG);
ok(!result, "Error: Expected 'result' to be 0, but was %d.\n", result);
hr = pCreateUri(http_urlW, 0, 0, &uri);
ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08x.\n", hr);
if(SUCCEEDED(hr)) {
result = -1;
hr = pCoInternetParseIUri(uri, PARSE_CANONICALIZE, 0, NULL, 0, &result, 0);
ok(hr == E_INVALIDARG, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
hr, E_INVALIDARG);
ok(!result, "Error: Expected 'result' to be 0, but was %d.\n", result);
hr = pCoInternetParseIUri(uri, PARSE_CANONICALIZE, 0, tmp, 3, NULL, 0);
ok(hr == E_POINTER, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
hr, E_POINTER);
result = -1;
hr = pCoInternetParseIUri(uri, PARSE_SECURITY_URL, 0, tmp, 3, &result, 0);
ok(hr == E_FAIL, "Error: CoInternetParseIUri returned 0x%08x expected 0x%08x.\n",
hr, E_FAIL);
ok(!result, "Error: Expected 'result' to be 0, but was %d.\n", result);
result = -1;
hr = pCoInternetParseIUri(uri, PARSE_MIME, 0, tmp, 3, &result, 0);
ok(hr == E_FAIL, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
hr, E_FAIL);
ok(!result, "Error: Expected 'result' to be 0, but was %d.\n", result);
result = -1;
hr = pCoInternetParseIUri(uri, PARSE_SERVER, 0, tmp, 3, &result, 0);
ok(hr == E_FAIL, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
hr, E_FAIL);
ok(!result, "Error: Expected 'result' to be 0, but was %d.\n", result);
result = -1;
hr = pCoInternetParseIUri(uri, PARSE_SECURITY_DOMAIN, 0, tmp, 3, &result, 0);
ok(hr == E_FAIL, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n",
hr, E_FAIL);
ok(!result, "Error: Expected 'result' to be 0, but was %d.\n", result);
}
if(uri) IUri_Release(uri);
}
START_TEST(uri) {
HMODULE hurlmon;
......@@ -9451,6 +9503,7 @@ START_TEST(uri) {
pCreateIUriBuilder = (void*) GetProcAddress(hurlmon, "CreateIUriBuilder");
pCoInternetCombineIUri = (void*) GetProcAddress(hurlmon, "CoInternetCombineIUri");
pCoInternetCombineUrlEx = (void*) GetProcAddress(hurlmon, "CoInternetCombineUrlEx");
pCoInternetParseIUri = (void*) GetProcAddress(hurlmon, "CoInternetParseIUri");
if(!pCreateUri) {
win_skip("CreateUri is not present, skipping tests.\n");
......@@ -9529,6 +9582,9 @@ START_TEST(uri) {
trace("test CoInternetCombineUrlEx...\n");
test_CoInternetCombineUrlEx();
trace("test CoInternetParseIUri Invalid Args...\n");
test_CoInternetParseIUri_InvalidArgs();
register_protocols();
trace("test CoInternetCombineIUri pluggable...\n");
......
......@@ -6080,3 +6080,41 @@ HRESULT WINAPI CoInternetCombineUrlEx(IUri *pBaseUri, LPCWSTR pwzRelativeUrl, DW
IUri_Release(relative);
return hr;
}
/***********************************************************************
* CoInternetParseIUri (urlmon.@)
*/
HRESULT WINAPI CoInternetParseIUri(IUri *pIUri, PARSEACTION ParseAction, DWORD dwFlags,
LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult,
DWORD_PTR dwReserved)
{
HRESULT hr;
TRACE("(%p %d %x %p %d %p %x)\n", pIUri, ParseAction, dwFlags, pwzResult,
cchResult, pcchResult, (DWORD)dwReserved);
if(!pcchResult)
return E_POINTER;
if(!pwzResult || !pIUri) {
*pcchResult = 0;
return E_INVALIDARG;
}
switch(ParseAction) {
case PARSE_SECURITY_URL:
case PARSE_MIME:
case PARSE_SERVER:
case PARSE_SECURITY_DOMAIN:
*pcchResult = 0;
hr = E_FAIL;
break;
default:
*pcchResult = 0;
hr = E_NOTIMPL;
FIXME("(%p %d %x %p %d %p %x) Partial stub.\n", pIUri, ParseAction, dwFlags,
pwzResult, cchResult, pcchResult, (DWORD)dwReserved);
}
return hr;
}
......@@ -21,6 +21,7 @@
@ stdcall CoInternetGetSession(long ptr long)
@ stdcall CoInternetIsFeatureEnabled(long long)
@ stdcall CoInternetParseUrl(wstr long long wstr long ptr long)
@ stdcall CoInternetParseIUri(ptr long long wstr long ptr long)
@ stdcall CoInternetQueryInfo(ptr long long ptr long ptr long)
@ stdcall CoInternetSetFeatureEnabled(long long long)
@ stub CompareSecurityIds
......
......@@ -1935,6 +1935,7 @@ cpp_quote("HRESULT WINAPI CoInternetCompareUrl(LPCWSTR,LPCWSTR,DWORD);")
cpp_quote("HRESULT WINAPI CoInternetCombineIUri(IUri*,IUri*,DWORD,IUri**,DWORD_PTR);")
cpp_quote("HRESULT WINAPI CoInternetCreateZoneManager(IServiceProvider*, IInternetZoneManager**, DWORD);")
cpp_quote("HRESULT WINAPI CoInternetParseUrl(LPCWSTR,PARSEACTION,DWORD,LPWSTR,DWORD,DWORD*,DWORD);")
cpp_quote("HRESULT WINAPI CoInternetParseIUri(IUri*,PARSEACTION,DWORD,LPWSTR,DWORD,DWORD*,DWORD_PTR);")
cpp_quote("HRESULT WINAPI CoInternetQueryInfo(LPCWSTR,QUERYOPTION,DWORD,LPVOID,DWORD,DWORD*,DWORD);")
cpp_quote("HRESULT WINAPI CoInternetSetFeatureEnabled(INTERNETFEATURELIST,DWORD,BOOL);")
cpp_quote("HRESULT WINAPI CoInternetGetSecurityUrl(LPCWSTR,LPWSTR*,PSUACTION,DWORD);")
......
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