Fix return type of NdrClientCall*

svn path=/branches/cmake-bringup/; revision=50484
This commit is contained in:
Timo Kreuzer 2011-01-25 11:55:45 +00:00
parent 87ab59ef61
commit 50c1320ff9
3 changed files with 13 additions and 18 deletions

View file

@ -17,7 +17,7 @@
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
* *
* TODO: Handle non-i386 architectures * TODO: Handle non-i386 architectures
*/ */
@ -96,7 +96,7 @@ HRESULT WINAPI ObjectStubless(DWORD *args)
args[0] = *(const WORD*)(fs + 8); args[0] = *(const WORD*)(fs + 8);
TRACE("(%p)->(%d)([%d bytes]) ret=%08x\n", iface, index, args[0], args[1]); TRACE("(%p)->(%d)([%d bytes]) ret=%08x\n", iface, index, args[0], args[1]);
return NdrClientCall2(stubless->pStubDesc, fs, args + 2); return NdrClientCall2(stubless->pStubDesc, fs, args + 2).Simple;
} }
#define BLOCK_SIZE 1024 #define BLOCK_SIZE 1024

View file

@ -510,7 +510,7 @@ void client_do_args_old_format(PMIDL_STUB_MESSAGE pStubMsg,
} }
else else
{ {
const NDR_PARAM_OI_OTHER *pParamOther = const NDR_PARAM_OI_OTHER *pParamOther =
(const NDR_PARAM_OI_OTHER *)&pFormat[current_offset]; (const NDR_PARAM_OI_OTHER *)&pFormat[current_offset];
const unsigned char *pTypeFormat = const unsigned char *pTypeFormat =
@ -548,10 +548,7 @@ void client_do_args_old_format(PMIDL_STUB_MESSAGE pStubMsg,
} }
} }
/* the return type should be CLIENT_CALL_RETURN, but this is incompatible CLIENT_CALL_RETURN WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, ...)
* with the way gcc returns structures. "void *" should be the largest type
* that MIDL should allow you to return anyway */
LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, ...)
{ {
/* pointer to start of stack where arguments start */ /* pointer to start of stack where arguments start */
RPC_MESSAGE rpcMsg; RPC_MESSAGE rpcMsg;
@ -574,7 +571,7 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma
/* -Oif or -Oicf generated format */ /* -Oif or -Oicf generated format */
BOOL bV2Format = FALSE; BOOL bV2Format = FALSE;
/* the value to return to the client from the remote procedure */ /* the value to return to the client from the remote procedure */
LONG_PTR RetVal = 0; CLIENT_CALL_RETURN RetVal = {0};
/* the pointer to the object when in OLE mode */ /* the pointer to the object when in OLE mode */
void * This = NULL; void * This = NULL;
PFORMAT_STRING pHandleFormat; PFORMAT_STRING pHandleFormat;
@ -630,7 +627,7 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma
if (!(pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT)) if (!(pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT))
{ {
pFormat = client_get_handle(&stubMsg, pProcHeader, pHandleFormat, &hBinding); pFormat = client_get_handle(&stubMsg, pProcHeader, pHandleFormat, &hBinding);
if (!pFormat) return 0; if (!pFormat) return RetVal;
} }
bV2Format = (pStubDesc->Version >= 0x20000); bV2Format = (pStubDesc->Version >= 0x20000);
@ -729,7 +726,7 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma
} }
__EXCEPT_ALL __EXCEPT_ALL
{ {
RetVal = NdrProxyErrorHandler(GetExceptionCode()); RetVal.Simple = NdrProxyErrorHandler(GetExceptionCode());
} }
__ENDTRY __ENDTRY
} }
@ -830,7 +827,7 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma
client_free_handle(&stubMsg, pProcHeader, pHandleFormat, hBinding); client_free_handle(&stubMsg, pProcHeader, pHandleFormat, hBinding);
} }
TRACE("RetVal = 0x%lx\n", RetVal); TRACE("RetVal = 0x%p\n", RetVal.Pointer);
return RetVal; return RetVal;
} }
@ -1465,7 +1462,7 @@ LONG WINAPI NdrStubCall2(
pRpcMsg->BufferLength = stubMsg.BufferLength; pRpcMsg->BufferLength = stubMsg.BufferLength;
/* allocate buffer for [out] and [ret] params */ /* allocate buffer for [out] and [ret] params */
Status = I_RpcGetBuffer(pRpcMsg); Status = I_RpcGetBuffer(pRpcMsg);
if (Status) if (Status)
RpcRaiseException(Status); RpcRaiseException(Status);
stubMsg.Buffer = pRpcMsg->Buffer; stubMsg.Buffer = pRpcMsg->Buffer;

View file

@ -650,15 +650,13 @@ RPCRTAPI void RPC_ENTRY
RPCRTAPI unsigned char* RPC_ENTRY RPCRTAPI unsigned char* RPC_ENTRY
NdrUserMarshalSimpleTypeConvert( ULONG *pFlags, unsigned char *pBuffer, unsigned char FormatChar ); NdrUserMarshalSimpleTypeConvert( ULONG *pFlags, unsigned char *pBuffer, unsigned char FormatChar );
/* Note: this should return a CLIENT_CALL_RETURN, but calling convention for CLIENT_CALL_RETURN RPC_VAR_ENTRY
* returning structures/unions is different between Windows and gcc on i386. */
LONG_PTR RPC_VAR_ENTRY
NdrClientCall2( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); NdrClientCall2( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
LONG_PTR RPC_VAR_ENTRY CLIENT_CALL_RETURN RPC_VAR_ENTRY
NdrClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); NdrClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
LONG_PTR RPC_VAR_ENTRY CLIENT_CALL_RETURN RPC_VAR_ENTRY
NdrAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); NdrAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
LONG_PTR RPC_VAR_ENTRY CLIENT_CALL_RETURN RPC_VAR_ENTRY
NdrDcomAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); NdrDcomAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
RPCRTAPI void RPC_ENTRY RPCRTAPI void RPC_ENTRY