Rob Shearman : mshtml: Support parsing the resource type in the res:// protocol.
Alexandre Julliard
julliard at winehq.org
Fri Apr 11 06:27:53 CDT 2008
Module: wine
Branch: master
Commit: a5d47baba4073e83d8ace70233adbb05dac1a2c4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a5d47baba4073e83d8ace70233adbb05dac1a2c4
Author: Rob Shearman <rob at codeweavers.com>
Date: Thu Apr 10 12:01:48 2008 +0100
mshtml: Support parsing the resource type in the res:// protocol.
---
dlls/mshtml/protocol.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/dlls/mshtml/protocol.c b/dlls/mshtml/protocol.c
index e338369..0b502ba 100644
--- a/dlls/mshtml/protocol.c
+++ b/dlls/mshtml/protocol.c
@@ -593,7 +593,7 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
ResProtocol *This = PROTOCOL_THIS(iface);
DWORD grfBINDF = 0, len;
BINDINFO bindinfo;
- LPWSTR url_dll, url_file, url, mime;
+ LPWSTR url_dll, url_file, url, mime, res_type = (LPWSTR)RT_HTML;
HMODULE hdll;
HRSRC src;
HRESULT hres;
@@ -636,13 +636,26 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
*url_file++ = 0;
hdll = LoadLibraryExW(url_dll, NULL, LOAD_LIBRARY_AS_DATAFILE);
if(!hdll) {
- WARN("Could not open dll: %s\n", debugstr_w(url_dll));
- IInternetProtocolSink_ReportResult(pOIProtSink, HRESULT_FROM_WIN32(GetLastError()), 0, NULL);
- heap_free(url);
- return HRESULT_FROM_WIN32(GetLastError());
+ if (!(res_type = strrchrW(url_dll, '/'))) {
+ WARN("Could not open dll: %s\n", debugstr_w(url_dll));
+ IInternetProtocolSink_ReportResult(pOIProtSink, HRESULT_FROM_WIN32(GetLastError()), 0, NULL);
+ heap_free(url);
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+ *res_type++ = 0;
+
+ hdll = LoadLibraryExW(url_dll, NULL, LOAD_LIBRARY_AS_DATAFILE);
+ if(!hdll) {
+ WARN("Could not open dll: %s\n", debugstr_w(url_dll));
+ IInternetProtocolSink_ReportResult(pOIProtSink, HRESULT_FROM_WIN32(GetLastError()), 0, NULL);
+ heap_free(url);
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
}
- src = FindResourceW(hdll, url_file, (LPCWSTR)RT_HTML);
+ TRACE("trying to find resource type %s, name %s\n", debugstr_w(res_type), debugstr_w(url_file));
+
+ src = FindResourceW(hdll, url_file, res_type);
if(!src) {
LPWSTR endpoint = NULL;
DWORD file_id = strtolW(url_file, &endpoint, 10);
More information about the wine-cvs
mailing list