Mike McCormack : rpcrt4: Move the connected check inside the named pipe code.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Apr 21 05:02:38 CDT 2006


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

Author: Mike McCormack <mike at codeweavers.com>
Date:   Fri Apr 21 15:39:41 2006 +0900

rpcrt4: Move the connected check inside the named pipe code.

---

 dlls/rpcrt4/rpc_transport.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c
index fa8b5c9..be10065 100644
--- a/dlls/rpcrt4/rpc_transport.c
+++ b/dlls/rpcrt4/rpc_transport.c
@@ -116,6 +116,10 @@ static RPC_STATUS rpcrt4_ncalrpc_open(Rp
   RPC_STATUS r;
   LPSTR pname;
 
+  /* already connected? */
+  if (Connection->conn)
+    return RPC_S_OK;
+
   /* protseq=ncalrpc: supposed to use NT LPC ports,
    * but we'll implement it with named pipes for now */
   pname = HeapAlloc(GetProcessHeap(), 0, strlen(prefix) + strlen(Connection->Endpoint) + 1);
@@ -136,6 +140,10 @@ static RPC_STATUS rpcrt4_ncacn_np_open(R
   RPC_STATUS r;
   LPSTR pname;
 
+  /* already connected? */
+  if (Connection->conn)
+    return RPC_S_OK;
+
   /* protseq=ncacn_np: named pipes */
   pname = HeapAlloc(GetProcessHeap(), 0, strlen(prefix) + strlen(Connection->Endpoint) + 1);
   strcat(strcpy(pname, prefix), Connection->Endpoint);
@@ -218,10 +226,6 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConn
 {
   TRACE("(Connection == ^%p)\n", Connection);
 
-  /* already connected? */
-  if (Connection->conn)
-    return RPC_S_OK;
-
   return Connection->ops->open_connection(Connection);
 }
 




More information about the wine-cvs mailing list