From 5f6ac9c484da75fd8aec4f8dfe249adf85e98934 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Thu, 20 Apr 2006 01:02:19 +0900 Subject: [PATCH] rpcrt4: Use rpcrt4_conn_read in RPCRT4_OpenBinding. --- dlls/rpcrt4/rpc_binding.c | 10 ++-------- dlls/rpcrt4/rpc_binding.h | 3 +++ dlls/rpcrt4/rpc_message.c | 4 ++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/dlls/rpcrt4/rpc_binding.c b/dlls/rpcrt4/rpc_binding.c index 8c8d8c69c9e..63f0259ad1a 100644 --- a/dlls/rpcrt4/rpc_binding.c +++ b/dlls/rpcrt4/rpc_binding.c @@ -435,7 +435,7 @@ RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection, /* we need to send a binding packet if we are client. */ if (!(*Connection)->server) { RpcPktHdr *hdr; - DWORD count; + LONG count; BYTE *response; RpcPktHdr *response_hdr; @@ -458,13 +458,7 @@ RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection, return E_OUTOFMEMORY; } - /* get a reply */ - if (!ReadFile(NewConnection->conn, response, RPC_MAX_PACKET_SIZE, &count, NULL)) { - WARN("ReadFile failed with error %ld\n", GetLastError()); - RPCRT4_DestroyConnection(*Connection); - return RPC_S_PROTOCOL_ERROR; - } - + count = rpcrt4_conn_read(NewConnection, response, RPC_MAX_PACKET_SIZE); if (count < sizeof(response_hdr->common)) { WARN("received invalid header\n"); RPCRT4_DestroyConnection(*Connection); diff --git a/dlls/rpcrt4/rpc_binding.h b/dlls/rpcrt4/rpc_binding.h index 5a65e4881a5..52cff5482c9 100644 --- a/dlls/rpcrt4/rpc_binding.h +++ b/dlls/rpcrt4/rpc_binding.h @@ -83,4 +83,7 @@ BOOL RPCRT4_RPCSSOnDemandCall(PRPCSS_NP_MESSAGE msg, char *vardata_payload, PRPC HANDLE RPCRT4_GetMasterMutex(void); HANDLE RPCRT4_RpcssNPConnect(void); +int rpcrt4_conn_read(RpcConnection *Connection, + void *buffer, unsigned int count); + #endif diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c index 6e89acedf0f..1e1c20ca4d7 100644 --- a/dlls/rpcrt4/rpc_message.c +++ b/dlls/rpcrt4/rpc_message.c @@ -306,8 +306,8 @@ RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header, * * Reads data from a connection */ -static int rpcrt4_conn_read(RpcConnection *Connection, - void *buffer, unsigned int count) +int rpcrt4_conn_read(RpcConnection *Connection, + void *buffer, unsigned int count) { DWORD dwRead = 0; if (!ReadFile(Connection->conn, buffer, count, &dwRead, NULL) && -- 2.11.4.GIT