Commit 3e103dca authored by Filip Navara's avatar Filip Navara Committed by Alexandre Julliard

Prevent crashes in I_RpcSend on Windows XP.

parent d1051870
...@@ -92,6 +92,7 @@ RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg) ...@@ -92,6 +92,7 @@ RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg)
UUID* act; UUID* act;
RPC_STATUS status; RPC_STATUS status;
RpcPktHdr hdr; RpcPktHdr hdr;
DWORD count;
TRACE("(%p)\n", pMsg); TRACE("(%p)\n", pMsg);
if (!bind) return RPC_S_INVALID_BINDING; if (!bind) return RPC_S_INVALID_BINDING;
...@@ -131,7 +132,7 @@ RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg) ...@@ -131,7 +132,7 @@ RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg)
hdr.len = pMsg->BufferLength; hdr.len = pMsg->BufferLength;
/* transmit packet */ /* 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()); WARN("WriteFile failed with error %ld\n", GetLastError());
status = RPC_S_PROTOCOL_ERROR; status = RPC_S_PROTOCOL_ERROR;
goto fail; goto fail;
...@@ -143,7 +144,7 @@ RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg) ...@@ -143,7 +144,7 @@ RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg)
goto fail; 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()); WARN("WriteFile failed with error %ld\n", GetLastError());
status = RPC_S_PROTOCOL_ERROR; status = RPC_S_PROTOCOL_ERROR;
goto fail; goto fail;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment