Jacek Caban : shdocvw: Use BindToObject to load document (except for http, https and ftp protocols).

Alexandre Julliard julliard at winehq.org
Fri Jan 4 07:12:40 CST 2008


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Jan  3 16:40:38 2008 +0100

shdocvw: Use BindToObject to load document (except for http, https and ftp protocols).

---

 dlls/shdocvw/navigate.c |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/dlls/shdocvw/navigate.c b/dlls/shdocvw/navigate.c
index a3a0e24..da45694 100644
--- a/dlls/shdocvw/navigate.c
+++ b/dlls/shdocvw/navigate.c
@@ -537,15 +537,37 @@ static HRESULT http_load_hack(DocHost *This, IMoniker *mon, IBindStatusCallback
 static HRESULT bind_to_object(DocHost *This, IMoniker *mon, LPCWSTR url, IBindCtx *bindctx,
                               IBindStatusCallback *callback)
 {
+    WCHAR schema[30];
+    DWORD schema_len;
     HRESULT hres;
 
+    static const WCHAR httpW[] = {'h','t','t','p',0};
+    static const WCHAR httpsW[] = {'h','t','t','p','s',0};
+    static const WCHAR ftpW[]= {'f','t','p',0};
+
     IBindCtx_RegisterObjectParam(bindctx, (LPOLESTR)SZ_HTML_CLIENTSITE_OBJECTPARAM,
                                  (IUnknown*)CLIENTSITE(This));
 
     if(This->frame)
         IOleInPlaceFrame_EnableModeless(This->frame, FALSE);
 
-    hres = http_load_hack(This, mon, callback, bindctx);
+    hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, schema, sizeof(schema)/sizeof(schema[0]),
+            &schema_len, 0);
+    if(SUCCEEDED(hres) &&
+       (!strcmpW(schema, httpW) || !strcmpW(schema, httpsW) || !strcmpW(schema, ftpW))) {
+        hres = http_load_hack(This, mon, callback, bindctx);
+    }else {
+        IUnknown *unk = NULL;
+
+        hres = IMoniker_BindToObject(mon, bindctx, NULL, &IID_IUnknown, (void**)&unk);
+        if(SUCCEEDED(hres)) {
+            hres = S_OK;
+            if(unk)
+                IUnknown_Release(unk);
+        }else {
+            FIXME("BindToObject failed: %08x\n", hres);
+        }
+    }
 
     if(This->frame)
         IOleInPlaceFrame_EnableModeless(This->frame, TRUE);




More information about the wine-cvs mailing list