mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:33:16 +00:00
[RPCRT4]
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:
parent
9c0d390343
commit
71bcf04d1f
2 changed files with 990 additions and 73 deletions
|
@ -307,7 +307,10 @@ static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection)
|
||||||
{
|
{
|
||||||
RpcConnection_np *npc = (RpcConnection_np *) Connection;
|
RpcConnection_np *npc = (RpcConnection_np *) Connection;
|
||||||
static const char prefix[] = "\\\\";
|
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;
|
RPC_STATUS r;
|
||||||
LPSTR pname;
|
LPSTR pname;
|
||||||
INT size;
|
INT size;
|
||||||
|
@ -318,15 +321,39 @@ static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection)
|
||||||
|
|
||||||
/* protseq=ncacn_np: named pipes */
|
/* protseq=ncacn_np: named pipes */
|
||||||
size = strlen(prefix);
|
size = strlen(prefix);
|
||||||
|
|
||||||
if (Connection->NetworkAddr == NULL || strlen(Connection->NetworkAddr) == 0)
|
if (Connection->NetworkAddr == NULL || strlen(Connection->NetworkAddr) == 0)
|
||||||
|
{
|
||||||
|
bUseLocalName = TRUE;
|
||||||
size += strlen(local);
|
size += strlen(local);
|
||||||
|
}
|
||||||
else
|
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;
|
size += strlen(Connection->Endpoint) + 1;
|
||||||
|
|
||||||
pname = I_RpcAllocate(size);
|
pname = I_RpcAllocate(size);
|
||||||
strcpy(pname, prefix);
|
strcpy(pname, prefix);
|
||||||
if (Connection->NetworkAddr == NULL || strlen(Connection->NetworkAddr) == 0)
|
if (bUseLocalName)
|
||||||
strcat(pname, local);
|
strcat(pname, local);
|
||||||
else
|
else
|
||||||
strcat(pname, Connection->NetworkAddr);
|
strcat(pname, Connection->NetworkAddr);
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue