Jacek Caban : urlmon: Process pending tasks before exiting Start function.

Alexandre Julliard julliard at winehq.org
Mon Sep 3 13:19:12 CDT 2012


Module: wine
Branch: master
Commit: 8bf9d8e90d870bc7a3b994864e409554bf4db01e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8bf9d8e90d870bc7a3b994864e409554bf4db01e

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Sep  3 13:58:30 2012 +0200

urlmon: Process pending tasks before exiting Start function.

---

 dlls/urlmon/bindprot.c |   48 ++++++++++++++++++++++++++++--------------------
 1 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/dlls/urlmon/bindprot.c b/dlls/urlmon/bindprot.c
index 603002d..48c9130 100644
--- a/dlls/urlmon/bindprot.c
+++ b/dlls/urlmon/bindprot.c
@@ -34,32 +34,38 @@ struct _task_header_t {
 #define WM_MK_CONTINUE   (WM_USER+101)
 #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) {
-    case WM_MK_CONTINUE: {
-        BindProtocol *This = (BindProtocol*)lParam;
-        task_header_t *task;
+    task_header_t *task;
 
-        while(1) {
-            EnterCriticalSection(&This->section);
+    while(1) {
+        EnterCriticalSection(&This->section);
 
-            task = This->task_queue_head;
-            if(task) {
-                This->task_queue_head = task->next;
-                if(!This->task_queue_head)
-                    This->task_queue_tail = NULL;
-            }
+        task = This->task_queue_head;
+        if(task) {
+            This->task_queue_head = task->next;
+            if(!This->task_queue_head)
+                This->task_queue_tail = NULL;
+        }
 
-            LeaveCriticalSection(&This->section);
+        LeaveCriticalSection(&This->section);
 
-            if(!task)
-                break;
+        if(!task)
+            break;
 
-            This->continue_call++;
-            task->proc(This, task);
-            This->continue_call--;
-        }
+        This->continue_call++;
+        task->proc(This, task);
+        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);
         return 0;
@@ -543,6 +549,8 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
                 &This->IInternetBindInfo_iface, 0, 0);
     }
 
+    if(SUCCEEDED(hres))
+        process_tasks(This);
     return hres;
 }
 




More information about the wine-cvs mailing list