Commit b5f38799 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

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

parent e5321be5
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment