From 09f343b1355d563f998096fc92cb1db02cd62a70 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Thu, 24 Apr 2008 14:30:59 +0100 Subject: [PATCH] rpcrt4: Ignore the return value of functions when unmarshalling a pickled procedure. --- dlls/rpcrt4/ndr_es.c | 6 +++--- dlls/rpcrt4/ndr_stubless.c | 9 +++++---- dlls/rpcrt4/ndr_stubless.h | 3 ++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dlls/rpcrt4/ndr_es.c b/dlls/rpcrt4/ndr_es.c index 4f70dd10032..3423d396cb8 100644 --- a/dlls/rpcrt4/ndr_es.c +++ b/dlls/rpcrt4/ndr_es.c @@ -398,7 +398,7 @@ void WINAPIV NdrMesProcEncodeDecode(handle_t Handle, const MIDL_STUB_DESC * pStu client_do_args_old_format(&pEsMsg->StubMsg, pFormat, PROXY_CALCSIZE, pEsMsg->StubMsg.StackTop, stack_size, (unsigned char *)&RetVal, - FALSE /* object_proc */); + FALSE /* object_proc */, TRUE /* ignore_retval */); pEsMsg->ByteCount = pEsMsg->StubMsg.BufferLength - mes_proc_header_buffer_size(); es_data_alloc(pEsMsg, pEsMsg->StubMsg.BufferLength); @@ -407,7 +407,7 @@ void WINAPIV NdrMesProcEncodeDecode(handle_t Handle, const MIDL_STUB_DESC * pStu client_do_args_old_format(&pEsMsg->StubMsg, pFormat, PROXY_MARSHAL, pEsMsg->StubMsg.StackTop, stack_size, (unsigned char *)&RetVal, - FALSE /* object_proc */); + FALSE /* object_proc */, TRUE /* ignore_retval */); es_data_write(pEsMsg, pEsMsg->ByteCount); break; @@ -418,7 +418,7 @@ void WINAPIV NdrMesProcEncodeDecode(handle_t Handle, const MIDL_STUB_DESC * pStu client_do_args_old_format(&pEsMsg->StubMsg, pFormat, PROXY_UNMARSHAL, pEsMsg->StubMsg.StackTop, stack_size, (unsigned char *)&RetVal, - FALSE /* object_proc */); + FALSE /* object_proc */, TRUE /* ignore_retval */); break; default: RpcRaiseException(RPC_S_INTERNAL_ERROR); diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index 9d28b362c45..275502a7e6d 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -441,7 +441,7 @@ static unsigned int type_stack_size(unsigned char fc) void client_do_args_old_format(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, int phase, unsigned char *args, unsigned short stack_size, - unsigned char *pRetVal, BOOL object_proc) + unsigned char *pRetVal, BOOL object_proc, BOOL ignore_retval) { /* current format string offset */ int current_offset = 0; @@ -492,7 +492,8 @@ void client_do_args_old_format(PMIDL_STUB_MESSAGE pStubMsg, call_marshaller(pStubMsg, pArg, pTypeFormat); break; case PROXY_UNMARSHAL: - if (pParam->param_direction == RPC_FC_RETURN_PARAM_BASETYPE) + if (!ignore_retval && + pParam->param_direction == RPC_FC_RETURN_PARAM_BASETYPE) { if (pParam->param_direction & RPC_FC_RETURN_PARAM) call_unmarshaller(pStubMsg, &pRetVal, pTypeFormat, 0); @@ -723,7 +724,7 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma else client_do_args_old_format(&stubMsg, pFormat, phase, stubMsg.StackTop, stack_size, (unsigned char *)&RetVal, - (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT)); + (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT), FALSE); break; default: ERR("shouldn't reach here. phase %d\n", phase); @@ -801,7 +802,7 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma else client_do_args_old_format(&stubMsg, pFormat, phase, stubMsg.StackTop, stack_size, (unsigned char *)&RetVal, - (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT)); + (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT), FALSE); break; default: ERR("shouldn't reach here. phase %d\n", phase); diff --git a/dlls/rpcrt4/ndr_stubless.h b/dlls/rpcrt4/ndr_stubless.h index 06b552c3388..9a6fb444783 100644 --- a/dlls/rpcrt4/ndr_stubless.h +++ b/dlls/rpcrt4/ndr_stubless.h @@ -238,4 +238,5 @@ typedef struct _NDR_EHD_CONTEXT void client_do_args_old_format(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, int phase, unsigned char *args, - unsigned short stack_size, unsigned char *pRetVal, BOOL object_proc); + unsigned short stack_size, unsigned char *pRetVal, BOOL object_proc, + BOOL ignore_retval);