Detect whether we are connecting to a pipe on the local machine and use the \\.\ prefix instead of the full machine name.
This patch modifies ReactOS-specific code (that was introduced by Eric in revision 53630) (Wine still supports only local pipes), so I also update our rpcrt4_ros.diff file accordingly, r63201 with respect to the latest Wine 1.7.17 rpcrt4 code.

CORE-6561 #resolve
CORE-6562 #resolve
CORE-7562 #comment Partly solved in revision 63202. Please retest.

svn path=/trunk/; revision=63202
This commit is contained in:
Hermès Bélusca-Maïto 2014-05-09 01:57:43 +00:00
parent 9c0d390343
commit 71bcf04d1f
2 changed files with 990 additions and 73 deletions

View file

@ -307,7 +307,10 @@ static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection)
{
RpcConnection_np *npc = (RpcConnection_np *) Connection;
static const char prefix[] = "\\\\";
static const char local[] =".";
static const char local[] = ".";
BOOL bUseLocalName = TRUE;
CHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
DWORD bufLen = sizeof(ComputerName)/sizeof(ComputerName[0]);
RPC_STATUS r;
LPSTR pname;
INT size;
@ -318,15 +321,39 @@ static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection)
/* protseq=ncacn_np: named pipes */
size = strlen(prefix);
if (Connection->NetworkAddr == NULL || strlen(Connection->NetworkAddr) == 0)
{
bUseLocalName = TRUE;
size += strlen(local);
}
else
size += strlen(Connection->NetworkAddr);
{
if (GetComputerNameA(ComputerName, &bufLen))
{
if (stricmp(ComputerName, Connection->NetworkAddr) == 0)
{
bUseLocalName = TRUE;
size += strlen(local);
}
else
{
bUseLocalName = FALSE;
size += strlen(Connection->NetworkAddr);
}
}
else
{
bUseLocalName = FALSE;
size += strlen(Connection->NetworkAddr);
}
}
size += strlen(Connection->Endpoint) + 1;
pname = I_RpcAllocate(size);
strcpy(pname, prefix);
if (Connection->NetworkAddr == NULL || strlen(Connection->NetworkAddr) == 0)
if (bUseLocalName)
strcat(pname, local);
else
strcat(pname, Connection->NetworkAddr);

File diff suppressed because it is too large Load diff