- Don't pass the PROFILE_SERVER flag in to CreateNamedPipe as it is
bogus. - Call FlushFileBuffers to make sure the other end of the pipe doesn't get cut off prematurely. - Don't call CancelIo as we should never have async I/O pending.
This commit is contained in:
parent
cdc6772017
commit
cdb3cdf3cf
|
@ -142,7 +142,7 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection)
|
||||||
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);
|
||||||
TRACE("listening on %s\n", pname);
|
TRACE("listening on %s\n", pname);
|
||||||
Connection->conn = CreateNamedPipeA(pname, PROFILE_SERVER | PIPE_ACCESS_DUPLEX,
|
Connection->conn = CreateNamedPipeA(pname, PIPE_ACCESS_DUPLEX,
|
||||||
PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, PIPE_UNLIMITED_INSTANCES,
|
PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, PIPE_UNLIMITED_INSTANCES,
|
||||||
RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL);
|
RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL);
|
||||||
HeapFree(GetProcessHeap(), 0, pname);
|
HeapFree(GetProcessHeap(), 0, pname);
|
||||||
|
@ -166,7 +166,7 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection)
|
||||||
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);
|
||||||
TRACE("listening on %s\n", pname);
|
TRACE("listening on %s\n", pname);
|
||||||
Connection->conn = CreateNamedPipeA(pname, PROFILE_SERVER | PIPE_ACCESS_DUPLEX,
|
Connection->conn = CreateNamedPipeA(pname, PIPE_ACCESS_DUPLEX,
|
||||||
PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES,
|
PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES,
|
||||||
RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL);
|
RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL);
|
||||||
HeapFree(GetProcessHeap(), 0, pname);
|
HeapFree(GetProcessHeap(), 0, pname);
|
||||||
|
@ -274,7 +274,7 @@ RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection)
|
||||||
{
|
{
|
||||||
TRACE("(Connection == ^%p)\n", Connection);
|
TRACE("(Connection == ^%p)\n", Connection);
|
||||||
if (Connection->conn) {
|
if (Connection->conn) {
|
||||||
CancelIo(Connection->conn);
|
FlushFileBuffers(Connection->conn);
|
||||||
CloseHandle(Connection->conn);
|
CloseHandle(Connection->conn);
|
||||||
Connection->conn = 0;
|
Connection->conn = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue