Module: wine Branch: refs/heads/master Commit: ae154d44e9b2a8aa55b57a6db102a306f9b9ab6a URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=ae154d44e9b2a8aa55b57a6d...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Jul 26 20:55:35 2006 +0200
mshtml: Fix handling res URLs with full path and number resource ID.
---
dlls/mshtml/protocol.c | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/protocol.c b/dlls/mshtml/protocol.c index 6717500..05b4388 100644 --- a/dlls/mshtml/protocol.c +++ b/dlls/mshtml/protocol.c @@ -588,7 +588,7 @@ static HRESULT WINAPI ResProtocol_Start( }
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); @@ -605,10 +605,18 @@ static HRESULT WINAPI ResProtocol_Start(
src = FindResourceW(hdll, url_file, (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()); + 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); + mshtml_free(url); + return HRESULT_FROM_WIN32(GetLastError()); + } }
if(This->data) {