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

This commit is contained in:
Mike McCormack 2006-04-21 15:39:41 +09:00 committed by Alexandre Julliard
parent 5c6f72873a
commit e7e209da64
1 changed files with 8 additions and 4 deletions

View File

@ -116,6 +116,10 @@ static RPC_STATUS rpcrt4_ncalrpc_open(RpcConnection* Connection)
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(RpcConnection* Connection)
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(RpcConnection* Connection)
{
TRACE("(Connection == ^%p)\n", Connection);
/* already connected? */
if (Connection->conn)
return RPC_S_OK;
return Connection->ops->open_connection(Connection);
}