Module: wine Branch: master Commit: 83ceee7424064805b133dc4c2f65b3f791539c24 URL: http://source.winehq.org/git/wine.git/?a=commit;h=83ceee7424064805b133dc4c2f...
Author: Jacek Caban jacek@codeweavers.com Date: Tue Nov 11 11:37:22 2014 +0100
mshtml: Ignore query and hash parts in res protocol handler.
---
dlls/mshtml/protocol.c | 8 +++++++- dlls/mshtml/tests/protocol.c | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/dlls/mshtml/protocol.c b/dlls/mshtml/protocol.c index c8f8d08..2499db4 100644 --- a/dlls/mshtml/protocol.c +++ b/dlls/mshtml/protocol.c @@ -594,9 +594,9 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, DWORD grfPI, HANDLE_PTR dwReserved) { ResProtocol *This = ResProtocol_from_IInternetProtocol(iface); + WCHAR *url_dll, *url_file, *url, *mime, *res_type = (LPWSTR)RT_HTML, *ptr; DWORD grfBINDF = 0, len; BINDINFO bindinfo; - LPWSTR url_dll, url_file, url, mime, res_type = (LPWSTR)RT_HTML; HMODULE hdll; HRSRC src; HRESULT hres; @@ -646,6 +646,12 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, res_type = MAKEINTRESOURCEW(RT_HTML); }
+ /* Ignore query and hash parts. */ + if((ptr = strchrW(url_file, '?'))) + *ptr = 0; + if((ptr = strchrW(url_file, '#'))) + *ptr = 0; + hdll = LoadLibraryExW(url_dll, NULL, LOAD_LIBRARY_AS_DATAFILE); if(!hdll) { WARN("Could not open dll: %s\n", debugstr_w(url_dll)); diff --git a/dlls/mshtml/tests/protocol.c b/dlls/mshtml/tests/protocol.c index 3c3b58b..49743d5 100644 --- a/dlls/mshtml/tests/protocol.c +++ b/dlls/mshtml/tests/protocol.c @@ -601,6 +601,13 @@ static void test_res_protocol(void) test_res_url("/jstest.html"); test_res_url("/Test/res.html"); test_res_url("/test/dir/dir2/res.html"); + + if(GetProcAddress(LoadLibraryA("urlmon.dll"), "CreateUri")) { + test_res_url("/test/dir/dir2/res.html?query_part"); + test_res_url("/test/dir/dir2/res.html#hash_part"); + }else { + win_skip("IUri not supported\n"); + } }
static void do_test_about_protocol(IClassFactory *factory, DWORD bf)