Commit bb52f14d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Use pluggable protocol in CoInternetCompareUrl.

parent 35e0e994
......@@ -236,3 +236,24 @@ HRESULT WINAPI CoInternetCombineUrl(LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl,
return hres;
}
/**************************************************************************
* CoInternetCompareUrl (URLMON.@)
*/
HRESULT WINAPI CoInternetCompareUrl(LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
{
IInternetProtocolInfo *protocol_info;
HRESULT hres;
TRACE("(%s,%s,%08x)\n", debugstr_w(pwzUrl1), debugstr_w(pwzUrl2), dwCompareFlags);
protocol_info = get_protocol_info(pwzUrl1);
if(protocol_info) {
hres = IInternetProtocolInfo_CompareUrl(protocol_info, pwzUrl1, pwzUrl2, dwCompareFlags);
if(SUCCEEDED(hres))
return hres;
}
return UrlCompareW(pwzUrl1, pwzUrl2, dwCompareFlags) ? S_FALSE : S_OK;
}
......@@ -328,6 +328,20 @@ static void test_CoInternetParseUrl(void)
}
}
static void test_CoInternetCompareUrl(void)
{
HRESULT hres;
hres = CoInternetCompareUrl(url1, url1, 0);
ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
hres = CoInternetCompareUrl(url1, url3, 0);
ok(hres == S_FALSE, "CoInternetParseUrl failed: %08x\n", hres);
hres = CoInternetCompareUrl(url3, url1, 0);
ok(hres == S_FALSE, "CoInternetParseUrl failed: %08x\n", hres);
}
static const WCHAR mimeTextHtml[] = {'t','e','x','t','/','h','t','m','l',0};
static const WCHAR mimeTextPlain[] = {'t','e','x','t','/','p','l','a','i','n',0};
static const WCHAR mimeAppOctetStream[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
......@@ -1081,6 +1095,7 @@ START_TEST(misc)
test_CreateFormatEnum();
test_RegisterFormatEnumerator();
test_CoInternetParseUrl();
test_CoInternetCompareUrl();
test_FindMimeFromData();
test_SecurityManager();
test_ZoneManager();
......
......@@ -303,12 +303,6 @@ HRESULT WINAPI ObtainUserAgentString(DWORD dwOption, LPSTR pcszUAOut, DWORD *cbS
return S_OK;
}
HRESULT WINAPI CoInternetCompareUrl(LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
{
TRACE("(%s,%s,%08x)\n", debugstr_w(pwzUrl1), debugstr_w(pwzUrl2), dwCompareFlags);
return UrlCompareW(pwzUrl1, pwzUrl2, dwCompareFlags)==0?S_OK:S_FALSE;
}
/**************************************************************************
* IsValidURL (URLMON.@)
*
......
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