mirror of
https://github.com/reactos/reactos.git
synced 2024-11-04 22:00:55 +00:00
[RPCTR4]
- Take NetworkAddr into account when a named pipe client is opened. - Return RPC_S_SERVER_UNAVAILABLE when an attempt to create a named pipe client fails with an ERROR_BAD_NETPATH error. This fixes the first test failure in the advapi32 service winetest. svn path=/trunk/; revision=53630
This commit is contained in:
parent
d78423aadc
commit
13f41d74b9
1 changed files with 20 additions and 3 deletions
|
@ -224,6 +224,9 @@ static RPC_STATUS rpcrt4_conn_open_pipe(RpcConnection *Connection, LPCSTR pname,
|
|||
if (err == ERROR_PIPE_BUSY) {
|
||||
TRACE("connection failed, error=%x\n", err);
|
||||
return RPC_S_SERVER_TOO_BUSY;
|
||||
} else if (err == ERROR_BAD_NETPATH) {
|
||||
TRACE("connection failed, error=%x\n", err);
|
||||
return RPC_S_SERVER_UNAVAILABLE;
|
||||
}
|
||||
if (!wait || !WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) {
|
||||
err = GetLastError();
|
||||
|
@ -305,17 +308,31 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq
|
|||
static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection)
|
||||
{
|
||||
RpcConnection_np *npc = (RpcConnection_np *) Connection;
|
||||
static const char prefix[] = "\\\\.";
|
||||
static const char prefix[] = "\\\\";
|
||||
static const char local[] =".";
|
||||
RPC_STATUS r;
|
||||
LPSTR pname;
|
||||
INT size;
|
||||
|
||||
/* already connected? */
|
||||
if (npc->pipe)
|
||||
return RPC_S_OK;
|
||||
|
||||
/* protseq=ncacn_np: named pipes */
|
||||
pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1);
|
||||
strcat(strcpy(pname, prefix), Connection->Endpoint);
|
||||
size = strlen(prefix);
|
||||
if (Connection->NetworkAddr == NULL || strlen(Connection->NetworkAddr) == 0)
|
||||
size += strlen(local);
|
||||
else
|
||||
size += strlen(Connection->NetworkAddr);
|
||||
size += strlen(Connection->Endpoint) + 1;
|
||||
|
||||
pname = I_RpcAllocate(size);
|
||||
strcpy(pname, prefix);
|
||||
if (Connection->NetworkAddr == NULL || strlen(Connection->NetworkAddr) == 0)
|
||||
strcat(pname, local);
|
||||
else
|
||||
strcat(pname, Connection->NetworkAddr);
|
||||
strcat(pname, Connection->Endpoint);
|
||||
r = rpcrt4_conn_open_pipe(Connection, pname, TRUE);
|
||||
I_RpcFree(pname);
|
||||
|
||||
|
|
Loading…
Reference in a new issue