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

This commit is contained in:
Jacek Caban 2006-07-26 20:55:35 +02:00 committed by Alexandre Julliard
parent bbdcccd3b7
commit ae154d44e9
1 changed files with 13 additions and 5 deletions

View File

@ -588,7 +588,7 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
}
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));
IInternetProtocolSink_ReportResult(pOIProtSink, MK_E_SYNTAX, 0, NULL);
mshtml_free(url);
@ -604,12 +604,20 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
}
src = FindResourceW(hdll, url_file, (LPCWSTR)RT_HTML);
if(!src) {
LPWSTR endpoint = NULL;
DWORD file_id = strtolW(url_file, &endpoint, 10);
if(endpoint == url_file+strlenW(url_file))
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);
IInternetProtocolSink_ReportResult(pOIProtSink,
HRESULT_FROM_WIN32(GetLastError()), 0, NULL);
mshtml_free(url);
return HRESULT_FROM_WIN32(GetLastError());
}
}
if(This->data) {
WARN("data already loaded\n");