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

itss: Added ParseUrl implementation.

parent a4cc844b
......@@ -369,9 +369,22 @@ static HRESULT WINAPI ITSProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, LPC
DWORD *pcchResult, DWORD dwReserved)
{
ITSProtocol *This = PROTINFO_THIS(iface);
FIXME("(%p)->(%s %x %08x %p %d %p %d)\n", This, debugstr_w(pwzUrl), ParseAction,
TRACE("(%p)->(%s %x %08x %p %d %p %d)\n", This, debugstr_w(pwzUrl), ParseAction,
dwParseFlags, pwzResult, cchResult, pcchResult, dwReserved);
return E_NOTIMPL;
switch(ParseAction) {
case PARSE_CANONICALIZE:
FIXME("PARSE_CANONICALIZE\n");
return E_NOTIMPL;
case PARSE_SECURITY_URL:
FIXME("PARSE_SECURITY_URL\n");
return E_NOTIMPL;
default:
return INET_E_DEFAULT_ACTION;
}
return S_OK;
}
static HRESULT WINAPI ITSProtocolInfo_CombineUrl(IInternetProtocolInfo *iface,
......
......@@ -68,6 +68,22 @@ DEFINE_EXPECT(ReportResult);
static HRESULT expect_hrResult;
static IInternetProtocol *read_protocol = NULL;
static const WCHAR blank_url1[] = {'i','t','s',':',
't','e','s','t','.','c','h','m',':',':','/','b','l','a','n','k','.','h','t','m','l',0};
static const WCHAR blank_url2[] = {'m','S','-','i','T','s',':',
't','e','s','t','.','c','h','m',':',':','/','b','l','a','n','k','.','h','t','m','l',0};
static const WCHAR blank_url3[] = {'m','k',':','@','M','S','I','T','S','t','o','r','e',':',
't','e','s','t','.','c','h','m',':',':','/','b','l','a','n','k','.','h','t','m','l',0};
static const WCHAR blank_url4[] = {'i','t','s',':',
't','e','s','t','.','c','h','m',':',':','b','l','a','n','k','.','h','t','m','l',0};
static const WCHAR blank_url5[] = {'i','t','s',':',
't','e','s','t','.','c','h','m',':',':','\\','b','l','a','n','k','.','h','t','m','l',0};
static const WCHAR blank_url6[] = {'i','t','s',':',
't','e','s','t','.','c','h','m',':',':','/','%','6','2','l','a','n','k','.','h','t','m','l',0};
static const WCHAR blank_url7[] = {'m','k',':','@','M','S','I','T','S','t','o','r','e',':',
't','e','s','t','.','c','h','m',':',':','\\','b','l','a','n','k','.','h','t','m','l',0};
static enum {
ITS_PROTOCOL,
MK_PROTOCOL
......@@ -396,6 +412,8 @@ static void test_protocol_url(IClassFactory *factory, LPCWSTR url)
static void test_its_protocol_info(IInternetProtocol *protocol)
{
IInternetProtocolInfo *info;
WCHAR buf[1024];
DWORD size, i;
HRESULT hres;
hres = IInternetProtocol_QueryInterface(protocol, &IID_IInternetProtocolInfo, (void**)&info);
......@@ -403,6 +421,15 @@ static void test_its_protocol_info(IInternetProtocol *protocol)
if(FAILED(hres))
return;
for(i = PARSE_CANONICALIZE; i <= PARSE_UNESCAPE; i++) {
if(i != PARSE_CANONICALIZE && i != PARSE_SECURITY_URL) {
hres = IInternetProtocolInfo_ParseUrl(info, blank_url1, i, 0, buf,
sizeof(buf)/sizeof(buf[0]), &size, 0);
ok(hres == INET_E_DEFAULT_ACTION,
"[%d] failed: %08x, expected INET_E_DEFAULT_ACTION\n", i, hres);
}
}
IInternetProtocolInfo_Release(info);
}
......@@ -414,18 +441,6 @@ static void test_its_protocol(void)
ULONG ref;
HRESULT hres;
static const WCHAR blank_url1[] = {'i','t','s',':',
't','e','s','t','.','c','h','m',':',':','/','b','l','a','n','k','.','h','t','m','l',0};
static const WCHAR blank_url2[] = {'m','S','-','i','T','s',':',
't','e','s','t','.','c','h','m',':',':','/','b','l','a','n','k','.','h','t','m','l',0};
static const WCHAR blank_url3[] = {'m','k',':','@','M','S','I','T','S','t','o','r','e',':',
't','e','s','t','.','c','h','m',':',':','/','b','l','a','n','k','.','h','t','m','l',0};
static const WCHAR blank_url4[] = {'i','t','s',':',
't','e','s','t','.','c','h','m',':',':','b','l','a','n','k','.','h','t','m','l',0};
static const WCHAR blank_url5[] = {'i','t','s',':',
't','e','s','t','.','c','h','m',':',':','\\','b','l','a','n','k','.','h','t','m','l',0};
static const WCHAR blank_url6[] = {'i','t','s',':',
't','e','s','t','.','c','h','m',':',':','/','%','6','2','l','a','n','k','.','h','t','m','l',0};
static const WCHAR wrong_url1[] =
{'i','t','s',':','t','e','s','t','.','c','h','m',':',':','/','b','l','a','n','.','h','t','m','l',0};
static const WCHAR wrong_url2[] =
......@@ -491,11 +506,6 @@ static void test_mk_protocol(void)
IClassFactory *cf;
HRESULT hres;
static const WCHAR blank_url1[] = {'m','k',':','@','M','S','I','T','S','t','o','r','e',':',
't','e','s','t','.','c','h','m',':',':','/','b','l','a','n','k','.','h','t','m','l',0};
static const WCHAR blank_url2[] = {'m','k',':','@','M','S','I','T','S','t','o','r','e',':',
't','e','s','t','.','c','h','m',':',':','\\','b','l','a','n','k','.','h','t','m','l',0};
test_protocol = MK_PROTOCOL;
hres = CoGetClassObject(&CLSID_MkProtocol, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory,
......@@ -505,9 +515,9 @@ static void test_mk_protocol(void)
return;
cache_file = cache_file1;
test_protocol_url(cf, blank_url1);
test_protocol_url(cf, blank_url3);
cache_file = cache_file2;
test_protocol_url(cf, blank_url2);
test_protocol_url(cf, blank_url7);
IClassFactory_Release(cf);
}
......
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