From b5f387997c582fa35bb9186b0504701bb4cfd299 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 3 Jan 2008 16:40:38 +0100 Subject: [PATCH] shdocvw: Use BindToObject to load document (except for http, https and ftp protocols). --- dlls/shdocvw/navigate.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/dlls/shdocvw/navigate.c b/dlls/shdocvw/navigate.c index a3a0e248733..da45694a5de 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); -- 2.11.4.GIT