Commit 83ceee74 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Ignore query and hash parts in res protocol handler.

parent b84bc52b
......@@ -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));
......
......@@ -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)
......
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