rpcrt4: Translate STATUS_ACCESS_VIOLATION exceptions caught whilst executing the stub function to ERROR_NOACCESS to prevent confusing exceptions occurring in the client.

This commit is contained in:
Rob Shearman 2007-06-25 14:24:23 +01:00 committed by Alexandre Julliard
parent c411d95e20
commit 2de3d31a7a
1 changed files with 5 additions and 1 deletions

View File

@ -235,6 +235,7 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
sif = RPCRT4_find_interface(object_uuid, &conn->ActiveInterface, TRUE);
if (!sif) {
WARN("interface %s no longer registered, returning fault packet\n", debugstr_guid(&conn->ActiveInterface.SyntaxGUID));
response = RPCRT4_BuildFaultHeader(NDR_LOCAL_DATA_REPRESENTATION,
RPC_S_UNKNOWN_IF);
@ -278,7 +279,10 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA
msg->RpcFlags |= WINE_RPCFLAG_EXCEPTION;
msg->BufferLength = sizeof(DWORD);
I_RpcGetBuffer(msg);
*(DWORD*)msg->Buffer = GetExceptionCode();
if (GetExceptionCode() == STATUS_ACCESS_VIOLATION)
*(DWORD*)msg->Buffer = ERROR_NOACCESS;
else
*(DWORD*)msg->Buffer = GetExceptionCode();
} __ENDTRY
/* send response packet */