Rob Shearman : rpcrt4: Improve error handling in RPCRT4_io_thread and remove commented-out code.

Alexandre Julliard julliard at winehq.org
Tue Jan 8 10:21:47 CST 2008


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

Author: Rob Shearman <rob at codeweavers.com>
Date:   Tue Jan  8 12:26:31 2008 +0000

rpcrt4: Improve error handling in RPCRT4_io_thread and remove commented-out code.

---

 dlls/rpcrt4/rpc_server.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c
index fcac3dd..9266187 100644
--- a/dlls/rpcrt4/rpc_server.c
+++ b/dlls/rpcrt4/rpc_server.c
@@ -369,15 +369,18 @@ static DWORD CALLBACK RPCRT4_io_thread(LPVOID the_arg)
       break;
     }
 
-#if 0
-    RPCRT4_process_packet(conn, hdr, msg);
-#else
     packet = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcPacket));
+    if (!packet)
+        break;
     packet->conn = conn;
     packet->hdr = hdr;
     packet->msg = msg;
-    QueueUserWorkItem(RPCRT4_worker_thread, packet, WT_EXECUTELONGFUNCTION);
-#endif
+    if (!QueueUserWorkItem(RPCRT4_worker_thread, packet, WT_EXECUTELONGFUNCTION)) {
+        ERR("couldn't queue work item for worker thread, error was %d\n", GetLastError());
+        HeapFree(GetProcessHeap(), 0, packet);
+        break;
+    }
+
     msg = NULL;
   }
   RPCRT4_DestroyConnection(conn);




More information about the wine-cvs mailing list