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