Jacek Caban : hhctrl.ocx: Correctly handle URLs in SetChmPath.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 5 06:23:13 CST 2007


Module: wine
Branch: master
Commit: e18ddbc0cd0ff1ab74d7ce2fb975d4bc506f4a56
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e18ddbc0cd0ff1ab74d7ce2fb975d4bc506f4a56

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Mar  2 18:19:48 2007 +0100

hhctrl.ocx: Correctly handle URLs in SetChmPath.

---

 dlls/hhctrl.ocx/chm.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/dlls/hhctrl.ocx/chm.c b/dlls/hhctrl.ocx/chm.c
index 493ed5b..d65d766 100644
--- a/dlls/hhctrl.ocx/chm.c
+++ b/dlls/hhctrl.ocx/chm.c
@@ -249,11 +249,29 @@ done:
     return SUCCEEDED(hr);
 }
 
+static LPCWSTR skip_schema(LPCWSTR url)
+{
+    static const WCHAR its_schema[] = {'i','t','s',':'};
+    static const WCHAR msits_schema[] = {'m','s','-','i','t','s',':'};
+    static const WCHAR mk_schema[] = {'m','k',':','@','M','S','I','T','S','t','o','r','e',':'};
+
+    if(!strncmpiW(its_schema, url, sizeof(its_schema)/sizeof(WCHAR)))
+        return url+sizeof(its_schema)/sizeof(WCHAR);
+    if(!strncmpiW(msits_schema, url, sizeof(msits_schema)/sizeof(WCHAR)))
+        return url+sizeof(msits_schema)/sizeof(WCHAR);
+    if(!strncmpiW(mk_schema, url, sizeof(mk_schema)/sizeof(WCHAR)))
+        return url+sizeof(mk_schema)/sizeof(WCHAR);
+
+    return url;
+}
+
 void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path)
 {
     LPCWSTR ptr;
     static const WCHAR separatorW[] = {':',':',0};
 
+    path = skip_schema(path);
+
     ptr = strstrW(path, separatorW);
     if(ptr) {
         WCHAR chm_file[MAX_PATH];




More information about the wine-cvs mailing list