rpcrt4: Errors in sending or receiving packets should result in RPC_S_CALL_FAILED being returned, not RPC_S_PROTOCOL_ERROR.

This commit is contained in:
Rob Shearman 2007-11-29 15:42:20 +00:00 committed by Alexandre Julliard
parent defbdf76e5
commit 34522de870

View File

@ -532,7 +532,7 @@ write:
if (count<0) {
WARN("rpcrt4_conn_write failed (auth)\n");
RPCRT4_SetThreadCurrentConnection(NULL);
return RPC_S_PROTOCOL_ERROR;
return RPC_S_CALL_FAILED;
}
buffer_pos += Header->common.frag_len - hdr_size - alen - auth_pad_len;
@ -708,7 +708,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header,
dwRead = rpcrt4_conn_read(Connection, &common_hdr, sizeof(common_hdr));
if (dwRead != sizeof(common_hdr)) {
WARN("Short read of header, %d bytes\n", dwRead);
status = RPC_S_PROTOCOL_ERROR;
status = RPC_S_CALL_FAILED;
goto fail;
}
@ -734,7 +734,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header,
dwRead = rpcrt4_conn_read(Connection, &(*Header)->common + 1, hdr_length - sizeof(common_hdr));
if (dwRead != hdr_length - sizeof(common_hdr)) {
WARN("bad header length, %d bytes, hdr_length %d\n", dwRead, hdr_length);
status = RPC_S_PROTOCOL_ERROR;
status = RPC_S_CALL_FAILED;
goto fail;
}
@ -760,7 +760,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header,
if (auth_length) {
auth_data = HeapAlloc(GetProcessHeap(), 0, RPC_AUTH_VERIFIER_LEN(&common_hdr));
if (!auth_data) {
status = RPC_S_PROTOCOL_ERROR;
status = RPC_S_OUT_OF_RESOURCES;
goto fail;
}
}
@ -806,7 +806,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header,
(unsigned char *)pMsg->Buffer + buffer_length, data_length);
if (dwRead != data_length) {
WARN("bad data length, %d/%ld\n", dwRead, data_length);
status = RPC_S_PROTOCOL_ERROR;
status = RPC_S_CALL_FAILED;
goto fail;
}
@ -826,7 +826,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header,
if (dwRead != header_auth_len) {
WARN("bad authentication data length, %d/%d\n", dwRead,
header_auth_len);
status = RPC_S_PROTOCOL_ERROR;
status = RPC_S_CALL_FAILED;
goto fail;
}
@ -854,7 +854,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header,
dwRead = rpcrt4_conn_read(Connection, *Header, hdr_length);
if (dwRead != hdr_length) {
WARN("invalid packet header size (%d)\n", dwRead);
status = RPC_S_PROTOCOL_ERROR;
status = RPC_S_CALL_FAILED;
goto fail;
}