Sync to Wine-0_9_5:
[reactos.git] / reactos / lib / rpcrt4 / rpc_server.c
index d220071..df83b65 100644 (file)
@@ -989,6 +989,9 @@ RPC_STATUS WINAPI RpcServerListen( UINT MinimumCallThreads, UINT MaxCalls, 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();
@@ -1010,8 +1013,6 @@ RPC_STATUS WINAPI RpcMgmtWaitServerListen( void )
   
   LeaveCriticalSection(&listen_cs);
 
-  RPCRT4_sync_with_server_thread();
-
   return RPC_S_OK;
 }