Jacek Caban : urlmon: Added PI_APARTMENTTHREADED support to BindProtocol:: ReportResult.
Alexandre Julliard
julliard at winehq.org
Tue May 12 09:08:46 CDT 2009
Module: wine
Branch: master
Commit: 7de802eb0f50e2739afa408158cc09fccbaec34d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7de802eb0f50e2739afa408158cc09fccbaec34d
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon May 11 22:00:26 2009 +0200
urlmon: Added PI_APARTMENTTHREADED support to BindProtocol::ReportResult.
---
dlls/urlmon/bindprot.c | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/dlls/urlmon/bindprot.c b/dlls/urlmon/bindprot.c
index 13e9b98..9203755 100644
--- a/dlls/urlmon/bindprot.c
+++ b/dlls/urlmon/bindprot.c
@@ -711,6 +711,25 @@ static HRESULT WINAPI BPInternetProtocolSink_ReportData(IInternetProtocolSink *i
return IInternetProtocolSink_ReportData(This->protocol_sink, grfBSCF, ulProgress, ulProgressMax);
}
+typedef struct {
+ task_header_t header;
+
+ HRESULT hres;
+ DWORD err;
+ LPWSTR str;
+} report_result_task_t;
+
+static void report_result_proc(BindProtocol *This, task_header_t *t)
+{
+ report_result_task_t *task = (report_result_task_t*)t;
+
+ if(This->protocol_sink)
+ IInternetProtocolSink_ReportResult(This->protocol_sink, task->hres, task->err, task->str);
+
+ heap_free(task->str);
+ heap_free(task);
+}
+
static HRESULT WINAPI BPInternetProtocolSink_ReportResult(IInternetProtocolSink *iface,
HRESULT hrResult, DWORD dwError, LPCWSTR szResult)
{
@@ -723,6 +742,21 @@ static HRESULT WINAPI BPInternetProtocolSink_ReportResult(IInternetProtocolSink
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, hrResult, dwError, szResult);
}
More information about the wine-cvs
mailing list