URLMON: Added PARSE_SECURITY_URL action implementation
Jacek Caban
jack at itma.pwr.wroc.pl
Fri Sep 9 14:17:54 CDT 2005
Changelog:
Added PARSE_SECURITY_URL action implementation
-------------- next part --------------
Index: dlls/urlmon/internet.c
===================================================================
RCS file: /home/wine/wine/dlls/urlmon/internet.c,v
retrieving revision 1.2
diff -u -p -r1.2 internet.c
--- dlls/urlmon/internet.c 9 Sep 2005 09:08:56 -0000 1.2
+++ dlls/urlmon/internet.c 9 Sep 2005 19:12:58 -0000
@@ -108,6 +108,24 @@ static IInternetProtocolInfo *get_protoc
return ret;
}
+static HRESULT parse_security_url(LPCWSTR url, DWORD flags, LPWSTR result, DWORD size, DWORD *rsize)
+{
+ IInternetProtocolInfo *protocol_info;
+ HRESULT hres;
+
+ TRACE("(%s %08lx %p %ld %p)\n", debugstr_w(url), flags, result, size, rsize);
+
+ protocol_info = get_protocol_info(url);
+
+ if(protocol_info) {
+ hres = IInternetProtocolInfo_ParseUrl(protocol_info, url, PARSE_SECURITY_URL,
+ flags, result, size, rsize, 0);
+ return hres;
+ }
+
+ return E_FAIL;
+}
+
static HRESULT parse_encode(LPCWSTR url, DWORD flags, LPWSTR result, DWORD size, DWORD *rsize)
{
IInternetProtocolInfo *protocol_info;
@@ -166,6 +184,8 @@ HRESULT WINAPI CoInternetParseUrl(LPCWST
WARN("dwReserved = %ld\n", dwReserved);
switch(ParseAction) {
+ case PARSE_SECURITY_URL:
+ return parse_security_url(pwzUrl, dwFlags, pszResult, cchResult, pcchResult);
case PARSE_ENCODE:
return parse_encode(pwzUrl, dwFlags, pszResult, cchResult, pcchResult);
case PARSE_PATH_FROM_URL:
Index: dlls/urlmon/tests/misc.c
===================================================================
RCS file: /home/wine/wine/dlls/urlmon/tests/misc.c,v
retrieving revision 1.4
diff -u -p -r1.4 misc.c
--- dlls/urlmon/tests/misc.c 9 Sep 2005 09:08:56 -0000 1.4
+++ dlls/urlmon/tests/misc.c 9 Sep 2005 19:12:58 -0000
@@ -208,6 +208,8 @@ static const WCHAR url2[] = {'i','n','d'
static const WCHAR url3[] = {'f','i','l','e',':','c',':','\\','I','n','d','e','x','.','h','t','m',0};
static const WCHAR url4[] = {'f','i','l','e',':','s','o','m','e','%','2','0','f','i','l','e',
'%','2','E','j','p','g',0};
+static const WCHAR url5[] = {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q',
+ '.','o','r','g',0};
static const WCHAR url4e[] = {'f','i','l','e',':','s','o','m','e',' ','f','i','l','e',
'.','j','p','g',0};
@@ -221,6 +223,7 @@ static const WCHAR wszEmpty[] = {0};
struct parse_test {
LPCWSTR url;
+ HRESULT secur_hres;
LPCWSTR encoded_url;
HRESULT path_hres;
LPCWSTR path;
@@ -228,10 +231,10 @@ struct parse_test {
};
static const struct parse_test parse_tests[] = {
- {url1, url1, E_INVALIDARG, NULL, wszRes},
- {url2, url2, E_INVALIDARG, NULL, wszEmpty},
- {url3, url3, S_OK, path3, wszFile},
- {url4, url4e, S_OK, path4, wszFile}
+ {url1, S_OK, url1, E_INVALIDARG, NULL, wszRes},
+ {url2, E_FAIL, url2, E_INVALIDARG, NULL, wszEmpty},
+ {url3, E_FAIL, url3, S_OK, path3, wszFile},
+ {url4, E_FAIL, url4e, S_OK, path4, wszFile}
};
static void test_CoInternetParseUrl(void)
@@ -249,6 +252,12 @@ static void test_CoInternetParseUrl(void
for(i=0; i < sizeof(parse_tests)/sizeof(parse_tests[0]); i++) {
memset(buf, 0xf0, sizeof(buf));
+ hres = CoInternetParseUrl(parse_tests[i].url, PARSE_SECURITY_URL, 0, buf,
+ sizeof(buf)/sizeof(WCHAR), &size, 0);
+ ok(hres == parse_tests[i].secur_hres, "[%d] security url failed: %08lx, expected %08lx\n",
+ i, hres, parse_tests[i].secur_hres);
+
+ memset(buf, 0xf0, sizeof(buf));
hres = CoInternetParseUrl(parse_tests[i].url, PARSE_ENCODE, 0, buf,
sizeof(buf)/sizeof(WCHAR), &size, 0);
ok(hres == S_OK, "[%d] encoding failed: %08lx\n", i, hres);
More information about the wine-patches
mailing list