Module: wine Branch: master Commit: c0351acd5788664637b8eb95ccba976c516ba3ad URL: http://source.winehq.org/git/wine.git/?a=commit;h=c0351acd5788664637b8eb95cc...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Feb 22 21:11:21 2007 +0100
itss: Added ParseUrl implementation.
---
dlls/itss/protocol.c | 17 +++++++++++++- dlls/itss/tests/protocol.c | 48 ++++++++++++++++++++++++++----------------- 2 files changed, 44 insertions(+), 21 deletions(-)
diff --git a/dlls/itss/protocol.c b/dlls/itss/protocol.c index 8286aed..44345db 100644 --- a/dlls/itss/protocol.c +++ b/dlls/itss/protocol.c @@ -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, diff --git a/dlls/itss/tests/protocol.c b/dlls/itss/tests/protocol.c index 4cdf09f..4ef8045 100644 --- a/dlls/itss/tests/protocol.c +++ b/dlls/itss/tests/protocol.c @@ -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); }