From fd460fd4a1c5c80c7c69fcc081bad3435ea0ad32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Tue, 16 Aug 2011 20:00:18 +0000 Subject: [PATCH] [RPCRT4] - do not wait for other threads in DLL_PROCESS_DETACH - fix handle leak - remove debug code svn path=/trunk/; revision=53271 --- reactos/dll/win32/rpcrt4/rpc_server.c | 2 -- reactos/dll/win32/rpcrt4/rpc_transport.c | 22 ++++++---------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/reactos/dll/win32/rpcrt4/rpc_server.c b/reactos/dll/win32/rpcrt4/rpc_server.c index 438338bdd22..e18cb5c3a7f 100644 --- a/reactos/dll/win32/rpcrt4/rpc_server.c +++ b/reactos/dll/win32/rpcrt4/rpc_server.c @@ -1071,8 +1071,6 @@ void RPCRT4_destroy_all_protseqs(void) EnterCriticalSection(&server_cs); LIST_FOR_EACH_ENTRY_SAFE(cps, cursor2, &protseqs, RpcServerProtseq, entry) { - if (listen_count != 0) - RPCRT4_sync_with_server_thread(cps); destroy_serverprotoseq(cps); } LeaveCriticalSection(&server_cs); diff --git a/reactos/dll/win32/rpcrt4/rpc_transport.c b/reactos/dll/win32/rpcrt4/rpc_transport.c index 4a8de65d9e8..dc2ae19cccf 100644 --- a/reactos/dll/win32/rpcrt4/rpc_transport.c +++ b/reactos/dll/win32/rpcrt4/rpc_transport.c @@ -103,9 +103,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(rpc); -#undef ERR -#define ERR FIXME - static RPC_STATUS RPCRT4_SpawnConnection(RpcConnection** Connection, RpcConnection* OldConnection); /**** ncacn_np support ****/ @@ -225,21 +222,13 @@ static RPC_STATUS rpcrt4_conn_open_pipe(RpcConnection *Connection, LPCSTR pname, if (pipe != INVALID_HANDLE_VALUE) break; err = GetLastError(); if (err == ERROR_PIPE_BUSY) { - ERR("connection to %s failed, error=%x\n", pname, err); + TRACE("connection failed, error=%x\n", err); return RPC_S_SERVER_TOO_BUSY; } - if(wait) ERR("Waiting for pipe instance"); - if(wait) - { - if (!WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) { - err = GetLastError(); - ERR("connection to %s failed, error=%x, wait %x\n", pname, err, wait); - return RPC_S_SERVER_UNAVAILABLE; - } - else - { - ERR("Pipe Instance Ready!!!!!!!!!!!!!!!!!!\n"); - } + if (!wait || !WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) { + err = GetLastError(); + WARN("connection failed, error=%x\n", err); + return RPC_S_SERVER_UNAVAILABLE; } } @@ -469,6 +458,7 @@ static int rpcrt4_conn_np_write(RpcConnection *Connection, bytes_left -= bytes_written; buf += bytes_written; } + CloseHandle(ovl.hEvent); return ret ? count : -1; }