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

This commit is contained in:
Jacek Caban 2014-11-11 11:37:22 +01:00 committed by Alexandre Julliard
parent b84bc52b71
commit 83ceee7424
2 changed files with 14 additions and 1 deletions

View File

@ -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));

View File

@ -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)