Commit 4aa48041 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Moved QueryService call to hlink_frame_navigate.

parent ae6fed5c
......@@ -607,7 +607,7 @@ BOOL install_wine_gecko(BOOL);
HRESULT nsuri_to_url(LPCWSTR,BOOL,BSTR*);
void hlink_frame_navigate(HTMLDocument*,IHlinkFrame*,LPCWSTR,nsIInputStream*,DWORD);
HRESULT hlink_frame_navigate(HTMLDocument*,LPCWSTR,nsIInputStream*,DWORD);
void call_property_onchanged(ConnectionPoint*,DISPID);
HRESULT call_set_active_object(IOleInPlaceUIWindow*,IOleInPlaceActiveObject*);
......
......@@ -1160,14 +1160,27 @@ void channelbsc_set_channel(nsChannelBSC *This, nsChannel *channel, nsIStreamLis
}
}
void hlink_frame_navigate(HTMLDocument *doc, IHlinkFrame *hlink_frame,
LPCWSTR uri, nsIInputStream *post_data_stream, DWORD hlnf)
HRESULT hlink_frame_navigate(HTMLDocument *doc, LPCWSTR url,
nsIInputStream *post_data_stream, DWORD hlnf)
{
IHlinkFrame *hlink_frame;
IServiceProvider *sp;
BSCallback *callback;
IBindCtx *bindctx;
IMoniker *mon;
IHlink *hlink;
HRESULT hr;
HRESULT hres;
hres = IOleClientSite_QueryInterface(doc->doc_obj->client, &IID_IServiceProvider,
(void**)&sp);
if(FAILED(hres))
return hres;
hres = IServiceProvider_QueryService(sp, &IID_IHlinkFrame, &IID_IHlinkFrame,
(void**)&hlink_frame);
IServiceProvider_Release(sp);
if(FAILED(hres))
return hres;
callback = &create_channelbsc(NULL)->bsc;
......@@ -1178,21 +1191,15 @@ void hlink_frame_navigate(HTMLDocument *doc, IHlinkFrame *hlink_frame,
debugstr_an(callback->post_data, callback->post_data_len));
}
hr = CreateAsyncBindCtx(0, STATUSCLB(callback), NULL, &bindctx);
if (FAILED(hr)) {
IBindStatusCallback_Release(STATUSCLB(callback));
return;
}
hres = CreateAsyncBindCtx(0, STATUSCLB(callback), NULL, &bindctx);
if(SUCCEEDED(hres))
hres = CoCreateInstance(&CLSID_StdHlink, NULL, CLSCTX_INPROC_SERVER,
&IID_IHlink, (LPVOID*)&hlink);
hr = CoCreateInstance(&CLSID_StdHlink, NULL, CLSCTX_INPROC_SERVER, &IID_IHlink, (LPVOID*)&hlink);
if (FAILED(hr)) {
IBindCtx_Release(bindctx);
IBindStatusCallback_Release(STATUSCLB(callback));
return;
}
if(SUCCEEDED(hres))
hres = CreateURLMoniker(NULL, url, &mon);
hr = CreateURLMoniker(NULL, uri, &mon);
if (SUCCEEDED(hr)) {
if(SUCCEEDED(hres)) {
IHlink_SetMonikerReference(hlink, 0, mon, NULL);
if(hlnf & HLNF_OPENINNEWWINDOW) {
......@@ -1200,11 +1207,13 @@ void hlink_frame_navigate(HTMLDocument *doc, IHlinkFrame *hlink_frame,
IHlink_SetTargetFrameName(hlink, wszBlank); /* FIXME */
}
IHlinkFrame_Navigate(hlink_frame, hlnf, bindctx, STATUSCLB(callback), hlink);
hres = IHlinkFrame_Navigate(hlink_frame, hlnf, bindctx, STATUSCLB(callback), hlink);
IMoniker_Release(mon);
}
IHlinkFrame_Release(hlink_frame);
IBindCtx_Release(bindctx);
IBindStatusCallback_Release(STATUSCLB(callback));
return hres;
}
......@@ -128,7 +128,6 @@ static BOOL exec_shldocvw_67(HTMLDocumentObj *doc, LPCWSTR url)
static BOOL before_async_open(nsChannel *channel, NSContainer *container)
{
HTMLDocumentObj *doc = container->doc;
IServiceProvider *service_provider;
DWORD hlnf = 0;
LPCWSTR uri;
HRESULT hres;
......@@ -154,23 +153,8 @@ static BOOL before_async_open(nsChannel *channel, NSContainer *container)
if(!hlnf && !exec_shldocvw_67(doc, uri))
return FALSE;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IServiceProvider,
(void**)&service_provider);
if(SUCCEEDED(hres)) {
IHlinkFrame *hlink_frame;
hres = IServiceProvider_QueryService(service_provider, &IID_IHlinkFrame,
&IID_IHlinkFrame, (void**)&hlink_frame);
IServiceProvider_Release(service_provider);
if(SUCCEEDED(hres)) {
hlink_frame_navigate(&doc->basedoc, hlink_frame, uri, channel->post_data_stream, hlnf);
IHlinkFrame_Release(hlink_frame);
return FALSE;
}
}
return TRUE;
hres = hlink_frame_navigate(&doc->basedoc, uri, channel->post_data_stream, hlnf);
return hres != S_OK;
}
#define NSCHANNEL_THIS(iface) DEFINE_THIS(nsChannel, HttpChannel, iface)
......
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