static HRESULT WINAPI BindStatusCallback_QueryInterface(IBindStatusCallback *iface, REFIID riid, void **ppv) { BindStatusCallback *This = BINDSC_THIS(iface); *ppv = NULL; if(IsEqualGUID(&IID_IUnknown, riid)) { TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); *ppv = BINDSC(This); }else if(IsEqualGUID(&IID_IBindStatusCallback, riid)) { TRACE("(%p)->(IID_IBindStatusCallback %p)\n", This, ppv); *ppv = BINDSC(This); }else if(IsEqualGUID(&IID_IHttpNegotiate, riid)) { TRACE("(%p)->(IID_IHttpNegotiate %p)\n", This, ppv); *ppv = HTTPNEG(This); } if(*ppv) { IBindStatusCallback_AddRef(BINDSC(This)); return S_OK; } WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); return E_NOINTERFACE; }
static HRESULT navigate_bsc(DocHost *This, BindStatusCallback *bsc, IMoniker *mon) { IBindCtx *bindctx; VARIANT_BOOL cancel = VARIANT_FALSE; HRESULT hres; on_before_navigate2(This, bsc->url, bsc->post_data, bsc->post_data_len, bsc->headers, &cancel); if(cancel) { FIXME("Navigation canceled\n"); return S_OK; } if(This->document) deactivate_document(This); CreateAsyncBindCtx(0, BINDSC(bsc), 0, &bindctx); if(This->frame) IOleInPlaceFrame_EnableModeless(This->frame, FALSE); hres = bind_to_object(This, mon, bsc->url, bindctx, BINDSC(bsc)); if(This->frame) IOleInPlaceFrame_EnableModeless(This->frame, TRUE); IBindCtx_Release(bindctx); return hres; }
static void navigate_bsc_proc(DocHost *This, task_header_t *t) { task_navigate_bsc_t *task = (task_navigate_bsc_t*)t; if(!This->hwnd) create_doc_view_hwnd(This); navigate_bsc(This, task->bsc, NULL); IBindStatusCallback_Release(BINDSC(task->bsc)); }
static HRESULT WINAPI BindStatusCallback_GetBindInfo(IBindStatusCallback *iface, DWORD *grfBINDF, BINDINFO *pbindinfo) { BindStatusCallback *This = BINDSC_THIS(iface); TRACE("(%p)->(%p %p)\n", This, grfBINDF, pbindinfo); *grfBINDF = BINDF_ASYNCHRONOUS; if(This->post_data) { pbindinfo->dwBindVerb = BINDVERB_POST; pbindinfo->stgmedData.tymed = TYMED_HGLOBAL; pbindinfo->stgmedData.u.hGlobal = This->post_data; pbindinfo->cbstgmedData = This->post_data_len; pbindinfo->stgmedData.pUnkForRelease = (IUnknown*)BINDSC(This); IBindStatusCallback_AddRef(BINDSC(This)); } return S_OK; }
static HRESULT navigate_bsc(DocHost *This, BindStatusCallback *bsc, IMoniker *mon) { VARIANT_BOOL cancel = VARIANT_FALSE; SAFEARRAY *post_data = NULL; IBindCtx *bindctx; HRESULT hres; set_doc_state(This, READYSTATE_LOADING); if(bsc->post_data) { post_data = SafeArrayCreateVector(VT_UI1, 0, bsc->post_data_len); memcpy(post_data->pvData, post_data, bsc->post_data_len); } on_before_navigate2(This, bsc->url, post_data, bsc->headers, &cancel); if(post_data) SafeArrayDestroy(post_data); if(cancel) { FIXME("Navigation canceled\n"); return S_OK; } if(This->document) deactivate_document(This); CreateAsyncBindCtx(0, BINDSC(bsc), 0, &bindctx); if(This->frame) IOleInPlaceFrame_EnableModeless(This->frame, FALSE); hres = bind_to_object(This, mon, bsc->url, bindctx, BINDSC(bsc)); if(This->frame) IOleInPlaceFrame_EnableModeless(This->frame, TRUE); IBindCtx_Release(bindctx); return hres; }
static HRESULT navigate_hlink(DocHost *This, IMoniker *mon, IBindCtx *bindctx, IBindStatusCallback *callback) { IHttpNegotiate *http_negotiate; BindStatusCallback *bsc; PBYTE post_data = NULL; ULONG post_data_len = 0; LPWSTR headers = NULL, url; BINDINFO bindinfo; DWORD bindf = 0; HRESULT hres; hres = IMoniker_GetDisplayName(mon, 0, NULL, &url); if(FAILED(hres)) FIXME("GetDisplayName failed: %08x\n", hres); hres = IBindStatusCallback_QueryInterface(callback, &IID_IHttpNegotiate, (void**)&http_negotiate); if(SUCCEEDED(hres)) { static const WCHAR null_string[] = {0}; IHttpNegotiate_BeginningTransaction(http_negotiate, null_string, null_string, 0, &headers); IHttpNegotiate_Release(http_negotiate); } memset(&bindinfo, 0, sizeof(bindinfo)); bindinfo.cbSize = sizeof(bindinfo); hres = IBindStatusCallback_GetBindInfo(callback, &bindf, &bindinfo); dump_BINDINFO(&bindinfo); if(bindinfo.dwBindVerb == BINDVERB_POST) { post_data_len = bindinfo.cbstgmedData; if(post_data_len) post_data = bindinfo.stgmedData.u.hGlobal; } if(This->doc_navigate) { hres = async_doc_navigate(This, url, headers, post_data, post_data_len, FALSE); }else { bsc = create_callback(This, url, post_data, post_data_len, headers); hres = navigate_bsc(This, bsc, mon); IBindStatusCallback_Release(BINDSC(bsc)); } CoTaskMemFree(url); CoTaskMemFree(headers); ReleaseBindInfo(&bindinfo); return hres; }
static ULONG WINAPI HttpNegotiate_Release(IHttpNegotiate *iface) { BindStatusCallback *This = HTTPNEG_THIS(iface); return IBindStatusCallback_Release(BINDSC(This)); }
static HRESULT WINAPI HttpNegotiate_QueryInterface(IHttpNegotiate *iface, REFIID riid, void **ppv) { BindStatusCallback *This = HTTPNEG_THIS(iface); return IBindStatusCallback_QueryInterface(BINDSC(This), riid, ppv); }