From 3e103dcabeeed6403fcad1584be3ce5715619f5c Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Mon, 19 Apr 2004 02:56:12 +0000 Subject: [PATCH] Prevent crashes in I_RpcSend on Windows XP. --- dlls/rpcrt4/rpc_message.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c index 476e2d39d21..798ee2d204f 100644 --- a/dlls/rpcrt4/rpc_message.c +++ b/dlls/rpcrt4/rpc_message.c @@ -92,6 +92,7 @@ RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg) UUID* act; RPC_STATUS status; RpcPktHdr hdr; + DWORD count; TRACE("(%p)\n", pMsg); if (!bind) return RPC_S_INVALID_BINDING; @@ -131,7 +132,7 @@ RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg) hdr.len = pMsg->BufferLength; /* transmit packet */ - if (!WriteFile(conn->conn, &hdr, sizeof(hdr), NULL, NULL)) { + if (!WriteFile(conn->conn, &hdr, sizeof(hdr), &count, NULL)) { WARN("WriteFile failed with error %ld\n", GetLastError()); status = RPC_S_PROTOCOL_ERROR; goto fail; @@ -143,7 +144,7 @@ RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg) goto fail; } - if (!WriteFile(conn->conn, pMsg->Buffer, pMsg->BufferLength, NULL, NULL)) { + if (!WriteFile(conn->conn, pMsg->Buffer, pMsg->BufferLength, &count, NULL)) { WARN("WriteFile failed with error %ld\n", GetLastError()); status = RPC_S_PROTOCOL_ERROR; goto fail;