Commit 643c66ba authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Try loading library in…

mshtml: Try loading library in IInternetProtocolInfo::ParseUrl(PARSE_INTERNET_URL) for res protocol to work around library name difference for winelib libraries.
parent 5fea02e8
...@@ -865,10 +865,22 @@ static HRESULT WINAPI ResProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, LPC ...@@ -865,10 +865,22 @@ static HRESULT WINAPI ResProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, LPC
len = SearchPathW(NULL, file_part, NULL, sizeof(full_path)/sizeof(WCHAR), full_path, NULL); len = SearchPathW(NULL, file_part, NULL, sizeof(full_path)/sizeof(WCHAR), full_path, NULL);
if(!len) { if(!len) {
HMODULE module;
/* SearchPath does not work well with winelib files (like our test executable),
* so we also try to load the library here */
module = LoadLibraryExW(file_part, NULL, LOAD_LIBRARY_AS_DATAFILE);
if(!module) {
WARN("Could not find file %s\n", debugstr_w(file_part)); WARN("Could not find file %s\n", debugstr_w(file_part));
return MK_E_SYNTAX; return MK_E_SYNTAX;
} }
len = GetModuleFileNameW(module, full_path, sizeof(full_path)/sizeof(WCHAR));
FreeLibrary(module);
if(!len)
return E_FAIL;
}
size = sizeof(wszFile)/sizeof(WCHAR) + len + 1; size = sizeof(wszFile)/sizeof(WCHAR) + len + 1;
if(pcchResult) if(pcchResult)
*pcchResult = size; *pcchResult = size;
......
...@@ -315,6 +315,8 @@ static void test_res_protocol(void) ...@@ -315,6 +315,8 @@ static void test_res_protocol(void)
{'r','e','s',':','/','/','x','x','.','d','l','l','/','b','l','a','n','k','.','h','t','m',0}; {'r','e','s',':','/','/','x','x','.','d','l','l','/','b','l','a','n','k','.','h','t','m',0};
static const WCHAR wrong_url5[] = static const WCHAR wrong_url5[] =
{'r','e','s',':','/','/','s','h','t','m','l','.','d','l','l','/','b','l','a','n','k','.','h','t','m',0}; {'r','e','s',':','/','/','s','h','t','m','l','.','d','l','l','/','b','l','a','n','k','.','h','t','m',0};
static const WCHAR wrong_url6[] =
{'r','e','s',':','/','/','c',':','\\','d','i','r','\\','f','i','l','e','.','d','l','l','/','b','l','a','n','k','.','h','t','m',0};
static const WCHAR mshtml_dllW[] = {'m','s','h','t','m','l','.','d','l','l',0}; static const WCHAR mshtml_dllW[] = {'m','s','h','t','m','l','.','d','l','l',0};
hres = CoGetClassObject(&CLSID_ResProtocol, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&unk); hres = CoGetClassObject(&CLSID_ResProtocol, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&unk);
...@@ -366,6 +368,10 @@ static void test_res_protocol(void) ...@@ -366,6 +368,10 @@ static void test_res_protocol(void)
sizeof(buf)/sizeof(buf[0]), &size, 0); sizeof(buf)/sizeof(buf[0]), &size, 0);
ok(hres == MK_E_SYNTAX, "ParseUrl failed: %08x, expected MK_E_SYNTAX\n", hres); ok(hres == MK_E_SYNTAX, "ParseUrl failed: %08x, expected MK_E_SYNTAX\n", hres);
hres = IInternetProtocolInfo_ParseUrl(protocol_info, wrong_url6, PARSE_SECURITY_URL, 0, buf,
sizeof(buf)/sizeof(buf[0]), &size, 0);
ok(hres == MK_E_SYNTAX, "ParseUrl failed: %08x, expected MK_E_SYNTAX\n", hres);
size = 0xdeadbeef; size = 0xdeadbeef;
buf[0] = '?'; buf[0] = '?';
hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_DOMAIN, 0, buf, hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_DOMAIN, 0, buf,
......
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