- 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.
oldstable
Robert Shearman 2005-06-08 18:31:38 +00:00 committed by Alexandre Julliard
parent cdc6772017
commit cdb3cdf3cf
1 changed files with 3 additions and 3 deletions

View File

@ -142,7 +142,7 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection)
pname = HeapAlloc(GetProcessHeap(), 0, strlen(prefix) + strlen(Connection->Endpoint) + 1);
strcat(strcpy(pname, prefix), Connection->Endpoint);
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,
RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL);
HeapFree(GetProcessHeap(), 0, pname);
@ -166,7 +166,7 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection)
pname = HeapAlloc(GetProcessHeap(), 0, strlen(prefix) + strlen(Connection->Endpoint) + 1);
strcat(strcpy(pname, prefix), Connection->Endpoint);
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,
RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL);
HeapFree(GetProcessHeap(), 0, pname);
@ -274,7 +274,7 @@ RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection)
{
TRACE("(Connection == ^%p)\n", Connection);
if (Connection->conn) {
CancelIo(Connection->conn);
FlushFileBuffers(Connection->conn);
CloseHandle(Connection->conn);
Connection->conn = 0;
}