static HRESULT WINAPI BPInternetProtocolSink_ReportResult(IInternetProtocolSink *iface, HRESULT hrResult, DWORD dwError, LPCWSTR szResult) { BindProtocol *This = impl_from_IInternetProtocolSink(iface); TRACE("(%p)->(%08x %d %s)\n", This, hrResult, dwError, debugstr_w(szResult)); if(!This->protocol_sink) return E_FAIL; This->reported_result = TRUE; if(!do_direct_notif(This)) { report_result_task_t *task; task = heap_alloc(sizeof(report_result_task_t)); if(!task) return E_OUTOFMEMORY; task->hres = hrResult; task->err = dwError; task->str = heap_strdupW(szResult); push_task(This, &task->header, report_result_proc); return S_OK; } return IInternetProtocolSink_ReportResult(This->protocol_sink_handler, hrResult, dwError, szResult); }
static HRESULT WINAPI BPInternetProtocolSink_Switch(IInternetProtocolSink *iface, PROTOCOLDATA *pProtocolData) { BindProtocol *This = impl_from_IInternetProtocolSink(iface); PROTOCOLDATA *data; TRACE("(%p)->(%p)\n", This, pProtocolData); TRACE("flags %x state %x data %p cb %u\n", pProtocolData->grfFlags, pProtocolData->dwState, pProtocolData->pData, pProtocolData->cbData); data = heap_alloc(sizeof(PROTOCOLDATA)); if(!data) return E_OUTOFMEMORY; memcpy(data, pProtocolData, sizeof(PROTOCOLDATA)); if((This->pi&PI_APARTMENTTHREADED && pProtocolData->grfFlags&PI_FORCE_ASYNC) || !do_direct_notif(This)) { switch_task_t *task; task = heap_alloc(sizeof(switch_task_t)); if(!task) { heap_free(data); return E_OUTOFMEMORY; } task->data = data; push_task(This, &task->header, switch_proc); return S_OK; } return IInternetProtocolSink_Switch(This->protocol_sink_handler, data); }
static HRESULT WINAPI BPInternetProtocolSink_ReportData(IInternetProtocolSink *iface, DWORD grfBSCF, ULONG ulProgress, ULONG ulProgressMax) { BindProtocol *This = impl_from_IInternetProtocolSink(iface); TRACE("(%p)->(%x %u %u)\n", This, grfBSCF, ulProgress, ulProgressMax); if(!This->protocol_sink) return S_OK; if(!do_direct_notif(This)) { report_data_task_t *task; task = heap_alloc(sizeof(report_data_task_t)); if(!task) return E_OUTOFMEMORY; task->bscf = grfBSCF; task->progress = ulProgress; task->progress_max = ulProgressMax; push_task(This, &task->header, report_data_proc); return S_OK; } return IInternetProtocolSink_ReportData(This->protocol_sink_handler, grfBSCF, ulProgress, ulProgressMax); }
static HRESULT WINAPI BPInternetProtocolSink_ReportProgress(IInternetProtocolSink *iface, ULONG ulStatusCode, LPCWSTR szStatusText) { BindProtocol *This = impl_from_IInternetProtocolSink(iface); TRACE("(%p)->(%u %s)\n", This, ulStatusCode, debugstr_w(szStatusText)); if(do_direct_notif(This)) { IInternetProtocolSink_ReportProgress(This->protocol_sink_handler, ulStatusCode, szStatusText); }else { on_progress_task_t *task; task = heap_alloc(sizeof(on_progress_task_t)); task->status_code = ulStatusCode; task->status_text = heap_strdupW(szStatusText); push_task(This, &task->header, on_progress_proc); } return S_OK; }
static HRESULT WINAPI BPInternetProtocolSink_Switch(IInternetProtocolSink *iface, PROTOCOLDATA *pProtocolData) { BindProtocol *This = PROTSINK_THIS(iface); PROTOCOLDATA *data; TRACE("(%p)->(%p)\n", This, pProtocolData); TRACE("flags %x state %x data %p cb %u\n", pProtocolData->grfFlags, pProtocolData->dwState, pProtocolData->pData, pProtocolData->cbData); data = heap_alloc(sizeof(PROTOCOLDATA)); if(!data) return E_OUTOFMEMORY; memcpy(data, pProtocolData, sizeof(PROTOCOLDATA)); if(!do_direct_notif(This)) { switch_task_t *task; task = heap_alloc(sizeof(switch_task_t)); if(!task) return E_OUTOFMEMORY; task->data = data; push_task(This, &task->header, switch_proc); return S_OK; } if(!This->protocol_sink) { IInternetProtocol_Continue(This->protocol_handler, data); return S_OK; } return IInternetProtocolSink_Switch(This->protocol_sink, data); }