From 5ed6d7f55c6f0581bfdf0a7e2afcc29989ba9e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Mon, 15 Aug 2011 21:45:12 +0000 Subject: [PATCH] [RPCRT4] - reduce difference with WINE : use their implementation of RpcMgmtStopServerListening svn path=/trunk/; revision=53268 --- reactos/dll/win32/rpcrt4/rpc_server.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/reactos/dll/win32/rpcrt4/rpc_server.c b/reactos/dll/win32/rpcrt4/rpc_server.c index c5d2224b69d..438338bdd22 100644 --- a/reactos/dll/win32/rpcrt4/rpc_server.c +++ b/reactos/dll/win32/rpcrt4/rpc_server.c @@ -1475,7 +1475,7 @@ RPC_STATUS WINAPI RpcServerListen( UINT MinimumCallThreads, UINT MaxCalls, UINT */ RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) { - RpcServerProtseq *cps; + HANDLE event; TRACE("()\n"); @@ -1485,15 +1485,20 @@ RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) LeaveCriticalSection(&listen_cs); return RPC_S_NOT_LISTENING; } - do { - LeaveCriticalSection(&listen_cs); - LIST_FOR_EACH_ENTRY(cps, &protseqs, RpcServerProtseq, entry) - WaitForSingleObject(cps->server_ready_event, INFINITE); - - EnterCriticalSection(&listen_cs); - } while (!std_listen); + if (listen_done_event) { + LeaveCriticalSection(&listen_cs); + return RPC_S_ALREADY_LISTENING; + } + event = CreateEventW( NULL, TRUE, FALSE, NULL ); + listen_done_event = event; LeaveCriticalSection(&listen_cs); + + TRACE( "waiting for server calls to finish\n" ); + WaitForSingleObject( event, INFINITE ); + TRACE( "done waiting\n" ); + + CloseHandle( event ); return RPC_S_OK; }