Jacek Caban : rpcrt4: Remove connection from list in RPCRT4_ReleaseConnection.

Alexandre Julliard julliard at winehq.org
Tue May 23 18:01:27 CDT 2017


Module: wine
Branch: master
Commit: dae30652e61e62ce999a357ff1ea2a428d09b229
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=dae30652e61e62ce999a357ff1ea2a428d09b229

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue May 23 17:39:30 2017 +0200

rpcrt4: Remove connection from list in RPCRT4_ReleaseConnection.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/rpcrt4/rpc_binding.h   |  1 +
 dlls/rpcrt4/rpc_transport.c | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/dlls/rpcrt4/rpc_binding.h b/dlls/rpcrt4/rpc_binding.h
index 4a24692..ff14bbd 100644
--- a/dlls/rpcrt4/rpc_binding.h
+++ b/dlls/rpcrt4/rpc_binding.h
@@ -91,6 +91,7 @@ typedef struct _RpcConnection
   RPC_SYNTAX_IDENTIFIER ActiveInterface;
   USHORT NextCallId;
   struct list protseq_entry;
+  struct _RpcServerProtseq *protseq;
   struct _RpcBinding *server_binding;
 } RpcConnection;
 
diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c
index f7d4f78..6b308c8 100644
--- a/dlls/rpcrt4/rpc_transport.c
+++ b/dlls/rpcrt4/rpc_transport.c
@@ -227,6 +227,7 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq
 
   EnterCriticalSection(&protseq->cs);
   list_add_head(&protseq->listeners, &Connection->protseq_entry);
+  Connection->protseq = protseq;
   LeaveCriticalSection(&protseq->cs);
 
   return r;
@@ -288,6 +289,7 @@ static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protse
 
   EnterCriticalSection(&protseq->cs);
   list_add_head(&protseq->listeners, &Connection->protseq_entry);
+  Connection->protseq = protseq;
   LeaveCriticalSection(&protseq->cs);
 
   return r;
@@ -1323,6 +1325,7 @@ static RPC_STATUS rpcrt4_protseq_ncacn_ip_tcp_open_endpoint(RpcServerProtseq *pr
 
         EnterCriticalSection(&protseq->cs);
         list_add_tail(&protseq->listeners, &tcpc->common.protseq_entry);
+        tcpc->common.protseq = protseq;
         LeaveCriticalSection(&protseq->cs);
 
         freeaddrinfo(ai);
@@ -3343,6 +3346,13 @@ RPC_STATUS RPCRT4_ReleaseConnection(RpcConnection* Connection)
   /* server-only */
   if (Connection->server_binding) RPCRT4_ReleaseBinding(Connection->server_binding);
 
+  if (Connection->protseq)
+  {
+    EnterCriticalSection(&Connection->protseq->cs);
+    list_remove(&Connection->protseq_entry);
+    LeaveCriticalSection(&Connection->protseq->cs);
+  }
+
   HeapFree(GetProcessHeap(), 0, Connection);
   return RPC_S_OK;
 }




More information about the wine-cvs mailing list