Author: jgardou Date: Mon Aug 15 21:45:12 2011 New Revision: 53268
URL: http://svn.reactos.org/svn/reactos?rev=53268&view=rev Log: [RPCRT4] - reduce difference with WINE : use their implementation of RpcMgmtStopServerListening
Modified: trunk/reactos/dll/win32/rpcrt4/rpc_server.c
Modified: trunk/reactos/dll/win32/rpcrt4/rpc_server.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_server... ============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_server.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_server.c [iso-8859-1] Mon Aug 15 21:45:12 2011 @@ -1475,7 +1475,7 @@ */ RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) { - RpcServerProtseq *cps; + HANDLE event;
TRACE("()\n");
@@ -1485,15 +1485,20 @@ 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; }