From 4d9d4b10e0a8833cf981bcef90ff04cb529b7673 Mon Sep 17 00:00:00 2001 From: Thomas Mullaly Date: Wed, 10 Nov 2010 22:31:35 -0500 Subject: [PATCH] urlmon: Added stub for CoInternetCombineUrlEx. --- dlls/urlmon/tests/uri.c | 38 ++++++++++++++++++++++++++++++++++++++ dlls/urlmon/uri.c | 25 +++++++++++++++++++++++++ dlls/urlmon/urlmon.spec | 1 + include/urlmon.idl | 1 + 4 files changed, 65 insertions(+) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index 8c4fd386ea8..c06c4cd2b06 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -67,6 +67,7 @@ static HRESULT (WINAPI *pCreateUriWithFragment)(LPCWSTR, LPCWSTR, DWORD, DWORD_P 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 const WCHAR http_urlW[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q', '.','o','r','g','/',0}; @@ -9285,6 +9286,39 @@ static void test_CoInternetCombineIUri_Pluggable(void) { unregister_protocols(); } +static void test_CoInternetCombineUrlEx(void) { + HRESULT hr; + IUri *base, *result; + + base = NULL; + hr = pCreateUri(http_urlW, 0, 0, &base); + ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08x.\n", hr); + if(SUCCEEDED(hr)) { + result = (void*) 0xdeadbeef; + hr = pCoInternetCombineUrlEx(base, NULL, 0, &result, 0); + ok(hr == E_UNEXPECTED, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n", + hr, E_UNEXPECTED); + ok(!result, "Error: Expected 'result' to be NULL was %p instead.\n", result); + } + + result = (void*) 0xdeadbeef; + hr = pCoInternetCombineUrlEx(NULL, http_urlW, 0, &result, 0); + ok(hr == E_INVALIDARG, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n", + hr, E_INVALIDARG); + ok(!result, "Error: Expected 'result' to be NULL, but was %p instead.\n", result); + + result = (void*) 0xdeadbeef; + hr = pCoInternetCombineUrlEx(NULL, NULL, 0, &result, 0); + ok(hr == E_UNEXPECTED, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n", + hr, E_UNEXPECTED); + ok(!result, "Error: Expected 'result' to be NULL, but was %p instead.\n", result); + + hr = pCoInternetCombineUrlEx(base, http_urlW, 0, NULL, 0); + ok(hr == E_POINTER, "Error: CoInternetCombineUrlEx returned 0x%08x, expected 0x%08x.\n", + hr, E_POINTER); + if(base) IUri_Release(base); +} + START_TEST(uri) { HMODULE hurlmon; @@ -9294,6 +9328,7 @@ START_TEST(uri) { pCreateUriWithFragment = (void*) GetProcAddress(hurlmon, "CreateUriWithFragment"); pCreateIUriBuilder = (void*) GetProcAddress(hurlmon, "CreateIUriBuilder"); pCoInternetCombineIUri = (void*) GetProcAddress(hurlmon, "CoInternetCombineIUri"); + pCoInternetCombineUrlEx = (void*) GetProcAddress(hurlmon, "CoInternetCombineUrlEx"); if(!pCreateUri) { win_skip("CreateUri is not present, skipping tests.\n"); @@ -9369,6 +9404,9 @@ START_TEST(uri) { trace("test CoInternetCombineIUri...\n"); test_CoInternetCombineIUri(); + trace("test CoInternetCombineUrlEx...\n"); + test_CoInternetCombineUrlEx(); + trace("test CoInternetCombineIUri pluggable...\n"); test_CoInternetCombineIUri_Pluggable(); } diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index 6ed71e12015..518c6d0f7df 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -6009,3 +6009,28 @@ HRESULT WINAPI CoInternetCombineIUri(IUri *pBaseUri, IUri *pRelativeUri, DWORD d return combine_uri(base, relative, dwCombineFlags, ppCombinedUri); } + +/*********************************************************************** + * CoInternetCombineUrlEx (urlmon.@) + */ +HRESULT WINAPI CoInternetCombineUrlEx(IUri *pBaseUri, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags, + IUri **ppCombinedUri, DWORD_PTR dwReserved) +{ + TRACE("(%p %s %x %p %x) stub\n", pBaseUri, debugstr_w(pwzRelativeUrl), dwCombineFlags, + ppCombinedUri, (DWORD)dwReserved); + + if(!ppCombinedUri) + return E_POINTER; + + if(!pwzRelativeUrl) { + *ppCombinedUri = NULL; + return E_UNEXPECTED; + } + + if(!pBaseUri) { + *ppCombinedUri = NULL; + return E_INVALIDARG; + } + + return E_NOTIMPL; +} diff --git a/dlls/urlmon/urlmon.spec b/dlls/urlmon/urlmon.spec index ff1adeaca49..a4173d7ee13 100644 --- a/dlls/urlmon/urlmon.spec +++ b/dlls/urlmon/urlmon.spec @@ -11,6 +11,7 @@ @ stdcall CoGetClassObjectFromURL(ptr wstr long long wstr ptr long ptr ptr ptr) @ stub CoInstall @ stdcall CoInternetCombineUrl(wstr wstr long wstr long ptr long) +@ stdcall CoInternetCombineUrlEx(ptr wstr long ptr long) @ stdcall CoInternetCompareUrl(wstr wstr long) @ stdcall CoInternetCombineIUri(ptr ptr long ptr long) @ stdcall CoInternetCreateSecurityManager(ptr ptr long) diff --git a/include/urlmon.idl b/include/urlmon.idl index e50975d7af3..7a92e213d9f 100644 --- a/include/urlmon.idl +++ b/include/urlmon.idl @@ -1930,6 +1930,7 @@ cpp_quote("HRESULT WINAPI CreateAsyncBindCtx(DWORD, IBindStatusCallback*, IEnumF cpp_quote("HRESULT WINAPI CreateAsyncBindCtxEx(IBindCtx*,DWORD,IBindStatusCallback*,IEnumFORMATETC*,IBindCtx**,DWORD);") cpp_quote("HRESULT WINAPI CoInternetCreateSecurityManager(IServiceProvider*,IInternetSecurityManager**,DWORD);") cpp_quote("HRESULT WINAPI CoInternetCombineUrl(LPCWSTR,LPCWSTR,DWORD,LPWSTR,DWORD,DWORD*,DWORD);") +cpp_quote("HRESULT WINAPI CoInternetCombineUrlEx(IUri*,LPCWSTR,DWORD,IUri**,DWORD_PTR);") 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);")