Commit e7e209da authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

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

parent 5c6f7287
...@@ -116,6 +116,10 @@ static RPC_STATUS rpcrt4_ncalrpc_open(RpcConnection* Connection) ...@@ -116,6 +116,10 @@ static RPC_STATUS rpcrt4_ncalrpc_open(RpcConnection* Connection)
RPC_STATUS r; RPC_STATUS r;
LPSTR pname; LPSTR pname;
/* already connected? */
if (Connection->conn)
return RPC_S_OK;
/* protseq=ncalrpc: supposed to use NT LPC ports, /* protseq=ncalrpc: supposed to use NT LPC ports,
* but we'll implement it with named pipes for now */ * but we'll implement it with named pipes for now */
pname = HeapAlloc(GetProcessHeap(), 0, strlen(prefix) + strlen(Connection->Endpoint) + 1); pname = HeapAlloc(GetProcessHeap(), 0, strlen(prefix) + strlen(Connection->Endpoint) + 1);
...@@ -136,6 +140,10 @@ static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection) ...@@ -136,6 +140,10 @@ static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection)
RPC_STATUS r; RPC_STATUS r;
LPSTR pname; LPSTR pname;
/* already connected? */
if (Connection->conn)
return RPC_S_OK;
/* protseq=ncacn_np: named pipes */ /* protseq=ncacn_np: named pipes */
pname = HeapAlloc(GetProcessHeap(), 0, strlen(prefix) + strlen(Connection->Endpoint) + 1); pname = HeapAlloc(GetProcessHeap(), 0, strlen(prefix) + strlen(Connection->Endpoint) + 1);
strcat(strcpy(pname, prefix), Connection->Endpoint); strcat(strcpy(pname, prefix), Connection->Endpoint);
...@@ -218,10 +226,6 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection) ...@@ -218,10 +226,6 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection)
{ {
TRACE("(Connection == ^%p)\n", Connection); TRACE("(Connection == ^%p)\n", Connection);
/* already connected? */
if (Connection->conn)
return RPC_S_OK;
return Connection->ops->open_connection(Connection); return Connection->ops->open_connection(Connection);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment