Commit ae154d44 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Fix handling res URLs with full path and number resource ID.

parent bbdcccd3
...@@ -588,7 +588,7 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, ...@@ -588,7 +588,7 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
} }
url_dll = url + sizeof(wszRes)/sizeof(wszRes[0]); url_dll = url + sizeof(wszRes)/sizeof(wszRes[0]);
if(!(url_file = strchrW(url_dll, '/'))) { if(!(url_file = strrchrW(url_dll, '/'))) {
WARN("wrong url: %s\n", debugstr_w(url)); WARN("wrong url: %s\n", debugstr_w(url));
IInternetProtocolSink_ReportResult(pOIProtSink, MK_E_SYNTAX, 0, NULL); IInternetProtocolSink_ReportResult(pOIProtSink, MK_E_SYNTAX, 0, NULL);
mshtml_free(url); mshtml_free(url);
...@@ -605,10 +605,18 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, ...@@ -605,10 +605,18 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
src = FindResourceW(hdll, url_file, (LPCWSTR)RT_HTML); src = FindResourceW(hdll, url_file, (LPCWSTR)RT_HTML);
if(!src) { if(!src) {
WARN("Could not find resource\n"); LPWSTR endpoint = NULL;
IInternetProtocolSink_ReportResult(pOIProtSink, HRESULT_FROM_WIN32(GetLastError()), 0, NULL); DWORD file_id = strtolW(url_file, &endpoint, 10);
mshtml_free(url); if(endpoint == url_file+strlenW(url_file))
return HRESULT_FROM_WIN32(GetLastError()); src = FindResourceW(hdll, (LPCWSTR)file_id, (LPCWSTR)RT_HTML);
if(!src) {
WARN("Could not find resource\n");
IInternetProtocolSink_ReportResult(pOIProtSink,
HRESULT_FROM_WIN32(GetLastError()), 0, NULL);
mshtml_free(url);
return HRESULT_FROM_WIN32(GetLastError());
}
} }
if(This->data) { if(This->data) {
......
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