Commit 8bf9d8e9 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Process pending tasks before exiting Start function.

parent 3636a252
...@@ -34,32 +34,38 @@ struct _task_header_t { ...@@ -34,32 +34,38 @@ struct _task_header_t {
#define WM_MK_CONTINUE (WM_USER+101) #define WM_MK_CONTINUE (WM_USER+101)
#define WM_MK_RELEASE (WM_USER+102) #define WM_MK_RELEASE (WM_USER+102)
static LRESULT WINAPI notif_wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) static void process_tasks(BindProtocol *This)
{ {
switch(msg) { task_header_t *task;
case WM_MK_CONTINUE: {
BindProtocol *This = (BindProtocol*)lParam;
task_header_t *task;
while(1) { while(1) {
EnterCriticalSection(&This->section); EnterCriticalSection(&This->section);
task = This->task_queue_head; task = This->task_queue_head;
if(task) { if(task) {
This->task_queue_head = task->next; This->task_queue_head = task->next;
if(!This->task_queue_head) if(!This->task_queue_head)
This->task_queue_tail = NULL; This->task_queue_tail = NULL;
} }
LeaveCriticalSection(&This->section); LeaveCriticalSection(&This->section);
if(!task) if(!task)
break; break;
This->continue_call++; This->continue_call++;
task->proc(This, task); task->proc(This, task);
This->continue_call--; This->continue_call--;
} }
}
static LRESULT WINAPI notif_wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg) {
case WM_MK_CONTINUE: {
BindProtocol *This = (BindProtocol*)lParam;
process_tasks(This);
IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface); IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
return 0; return 0;
...@@ -543,6 +549,8 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr ...@@ -543,6 +549,8 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
&This->IInternetBindInfo_iface, 0, 0); &This->IInternetBindInfo_iface, 0, 0);
} }
if(SUCCEEDED(hres))
process_tasks(This);
return hres; return hres;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment