urlmon: Added PI_APARTMENTTHREADED support to BindProtocol::ReportProgress.

This commit is contained in:
Jacek Caban 2009-05-11 22:00:13 +02:00 committed by Alexandre Julliard
parent 2dee8bb79d
commit 8ca4a4a3a4
1 changed files with 32 additions and 0 deletions

View File

@ -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);
}