Module: wine Branch: master Commit: 8ca4a4a3a45194de1a7b54191e6f3b081c543521 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8ca4a4a3a45194de1a7b54191e...
Author: Jacek Caban jacek@codeweavers.com Date: Mon May 11 22:00:13 2009 +0200
urlmon: Added PI_APARTMENTTHREADED support to BindProtocol::ReportProgress.
---
dlls/urlmon/bindprot.c | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/dlls/urlmon/bindprot.c b/dlls/urlmon/bindprot.c index de00e94..13e9b98 100644 --- a/dlls/urlmon/bindprot.c +++ b/dlls/urlmon/bindprot.c @@ -666,6 +666,23 @@ static HRESULT WINAPI BPInternetProtocolSink_ReportProgress(IInternetProtocolSin return S_OK; }
+typedef struct { + task_header_t header; + DWORD bscf; + ULONG progress; + ULONG progress_max; +} report_data_task_t; + +static void report_data_proc(BindProtocol *This, task_header_t *t) +{ + report_data_task_t *task = (report_data_task_t*)t; + + if(This->protocol_sink) + IInternetProtocolSink_ReportData(This->protocol_sink, task->bscf, task->progress, task->progress_max); + + heap_free(task); +} + static HRESULT WINAPI BPInternetProtocolSink_ReportData(IInternetProtocolSink *iface, DWORD grfBSCF, ULONG ulProgress, ULONG ulProgressMax) { @@ -676,6 +693,21 @@ static HRESULT WINAPI BPInternetProtocolSink_ReportData(IInternetProtocolSink *i 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, grfBSCF, ulProgress, ulProgressMax); }