Robert Shearman : rpcrt4: Fix race condition in RpcServerListen.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 3 06:37:30 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 196829663aeea7c67cd9d7c7d9a39ee428acc8a1
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=196829663aeea7c67cd9d7c7d9a39ee428acc8a1

Author: Robert Shearman <rob at codeweavers.com>
Date:   Tue Jan  3 12:07:04 2006 +0100

rpcrt4: Fix race condition in RpcServerListen.
The DontWait parameter is used for forcing the function not to wait
for the server to finish.

---

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

diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c
index 0408bca..87171f5 100644
--- a/dlls/rpcrt4/rpc_server.c
+++ b/dlls/rpcrt4/rpc_server.c
@@ -977,6 +977,9 @@ RPC_STATUS WINAPI RpcServerListen( UINT 
 
   status = RPCRT4_start_listen(FALSE);
 
+  if (status == RPC_S_OK)
+    RPCRT4_sync_with_server_thread();
+
   if (DontWait || (status != RPC_S_OK)) return status;
 
   return RpcMgmtWaitServerListen();
@@ -998,8 +1001,6 @@ RPC_STATUS WINAPI RpcMgmtWaitServerListe
   
   LeaveCriticalSection(&listen_cs);
 
-  RPCRT4_sync_with_server_thread();
-
   return RPC_S_OK;
 }
 




More information about the wine-cvs mailing list