Jacek Caban : mshtml: Fix protocol tests on XP.
Make Wine match XP implementation.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon May 15 04:52:03 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 8bb2513ee9f2457093b6ac3fff5866f3279e3274
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=8bb2513ee9f2457093b6ac3fff5866f3279e3274
Author: Jacek Caban <jacek at codeweavers.com>
Date: Fri May 12 18:49:27 2006 +0200
mshtml: Fix protocol tests on XP. Make Wine match XP implementation.
---
dlls/mshtml/protocol.c | 20 +++++++++++---
dlls/mshtml/tests/protocol.c | 61 ++++++++++++++++++++++++++++++++++++++++--
2 files changed, 74 insertions(+), 7 deletions(-)
diff --git a/dlls/mshtml/protocol.c b/dlls/mshtml/protocol.c
index 104b1c1..b99bef3 100644
--- a/dlls/mshtml/protocol.c
+++ b/dlls/mshtml/protocol.c
@@ -414,8 +414,14 @@ static HRESULT WINAPI AboutProtocolInfo_
}
if(ParseAction == PARSE_DOMAIN) {
- /* Tests show that we don't have to do anything here */
- return S_OK;
+ if(!pcchResult)
+ return E_POINTER;
+
+ if(pwzUrl)
+ *pcchResult = strlenW(pwzUrl)+1;
+ else
+ *pcchResult = 1;
+ return E_FAIL;
}
return INET_E_DEFAULT_ACTION;
@@ -810,8 +816,14 @@ static HRESULT WINAPI ResProtocolInfo_Pa
}
if(ParseAction == PARSE_DOMAIN) {
- /* Tests show that we don't have to do anything here */
- return S_OK;
+ if(!pcchResult)
+ return E_POINTER;
+
+ if(pwzUrl)
+ *pcchResult = strlenW(pwzUrl)+1;
+ else
+ *pcchResult = 1;
+ return E_FAIL;
}
return INET_E_DEFAULT_ACTION;
diff --git a/dlls/mshtml/tests/protocol.c b/dlls/mshtml/tests/protocol.c
index 309c860..3f01207 100644
--- a/dlls/mshtml/tests/protocol.c
+++ b/dlls/mshtml/tests/protocol.c
@@ -290,21 +290,51 @@ static void test_res_protocol(void)
sizeof(buf)/sizeof(buf[0]), &size, 0);
ok(hres == MK_E_SYNTAX, "ParseUrl failed: %08lx, expected MK_E_SYNTAX\n", hres);
+ size = 0xdeadbeef;
buf[0] = '?';
hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_DOMAIN, 0, buf,
sizeof(buf)/sizeof(buf[0]), &size, 0);
- ok(hres == S_OK, "ParseUrl failed: %08lx\n", hres);
+ ok(hres == S_OK || hres == E_FAIL, "ParseUrl failed: %08lx\n", hres);
ok(buf[0] == '?', "buf changed\n");
+ ok(size == sizeof(blank_url)/sizeof(WCHAR),
+ "size=%ld, ezpected %d\n", size, sizeof(wrong_url1)/sizeof(WCHAR));
+ size = 0xdeadbeef;
hres = IInternetProtocolInfo_ParseUrl(protocol_info, wrong_url1, PARSE_DOMAIN, 0, buf,
sizeof(buf)/sizeof(buf[0]), &size, 0);
- ok(hres == S_OK, "ParseUrl failed: %08lx, expected MK_E_SYNTAX\n", hres);
+ ok(hres == S_OK || hres == E_FAIL, "ParseUrl failed: %08lx\n", hres);
ok(buf[0] == '?', "buf changed\n");
+ ok(size == sizeof(wrong_url1)/sizeof(WCHAR),
+ "size=%ld, ezpected %d\n", size, sizeof(wrong_url1)/sizeof(WCHAR));
+#if 0 /* Crashes on win9x */
+ size = 0xdeadbeef;
+ buf[0] = '?';
+ hres = IInternetProtocolInfo_ParseUrl(protocol_info, NULL, PARSE_DOMAIN, 0, buf,
+ sizeof(buf)/sizeof(buf[0]), &size, 0);
+ ok(hres == E_FAIL, "ParseUrl failed: %08lx\n", hres);
+ ok(buf[0] == '?', "buf changed\n");
+ ok(size == 1, "size=%ld, ezpected 1\n", size);
+
+ buf[0] = '?';
+ hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_DOMAIN, 0, buf,
+ sizeof(buf)/sizeof(buf[0]), NULL, 0);
+ ok(hres == E_POINTER, "ParseUrl failed: %08lx\n", hres);
+ ok(buf[0] == '?', "buf changed\n");
+
+ buf[0] = '?';
+ hres = IInternetProtocolInfo_ParseUrl(protocol_info, NULL, PARSE_DOMAIN, 0, buf,
+ sizeof(buf)/sizeof(buf[0]), NULL, 0);
+ ok(hres == E_POINTER, "ParseUrl failed: %08lx\n", hres);
+ ok(buf[0] == '?', "buf changed\n");
+#endif
+
+ buf[0] = '?';
hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_UNESCAPE+1, 0, buf,
sizeof(buf)/sizeof(buf[0]), &size, 0);
ok(hres == INET_E_DEFAULT_ACTION,
"ParseUrl failed: %08lx, expected INET_E_DEFAULT_ACTION\n", hres);
+ ok(buf[0] == '?', "buf changed\n");
IInternetProtocolInfo_Release(protocol_info);
}
@@ -437,11 +467,36 @@ static void test_about_protocol(void)
ok(hres == S_OK, "ParseUrl failed: %08lx\n", hres);
ok(!lstrcmpW(test_url, buf), "buf != test_url\n");
+ size = 0xdeadbeef;
buf[0] = '?';
hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_DOMAIN, 0, buf,
sizeof(buf)/sizeof(buf[0]), &size, 0);
- ok(hres == S_OK, "ParseUrl failed: %08lx\n", hres);
+ ok(hres == S_OK || hres == E_FAIL, "ParseUrl failed: %08lx\n", hres);
+ ok(buf[0] == '?', "buf changed\n");
+ ok(size == sizeof(blank_url)/sizeof(WCHAR),
+ "size=%ld, expected %d\n", size, sizeof(blank_url)/sizeof(WCHAR));
+
+#if 0 /* Crashes on win9x */
+ size = 0xdeadbeef;
+ buf[0] = '?';
+ hres = IInternetProtocolInfo_ParseUrl(protocol_info, NULL, PARSE_DOMAIN, 0, buf,
+ sizeof(buf)/sizeof(buf[0]), &size, 0);
+ ok(hres == E_FAIL, "ParseUrl failed: %08lx\n", hres);
+ ok(buf[0] == '?', "buf changed\n");
+ ok(size == 1, "size=%ld, ezpected 1\n", size);
+
+ buf[0] = '?';
+ hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_DOMAIN, 0, buf,
+ sizeof(buf)/sizeof(buf[0]), NULL, 0);
+ ok(hres == E_POINTER, "ParseUrl failed: %08lx\n", hres);
+ ok(buf[0] == '?', "buf changed\n");
+
+ buf[0] = '?';
+ hres = IInternetProtocolInfo_ParseUrl(protocol_info, NULL, PARSE_DOMAIN, 0, buf,
+ sizeof(buf)/sizeof(buf[0]), NULL, 0);
+ ok(hres == E_POINTER, "ParseUrl failed: %08lx\n", hres);
ok(buf[0] == '?', "buf changed\n");
+#endif
hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_UNESCAPE+1, 0, buf,
sizeof(buf)/sizeof(buf[0]), &size, 0);
More information about the wine-cvs
mailing list