From 3e01da183864acd14c4cfaa659fd8b7fa7cf61fe Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Tue, 29 Aug 2006 21:14:42 +0100 Subject: [PATCH] rpcrt4: Fix NdrStubGetBuffer to use the IRpcChannelBuffer object since IRpcChannelBuffer_GetBuffer may put extra data onto the wire for ORPC calls. --- dlls/rpcrt4/cstub.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/rpcrt4/cstub.c b/dlls/rpcrt4/cstub.c index 5b61da40bbd..259956aa63e 100644 --- a/dlls/rpcrt4/cstub.c +++ b/dlls/rpcrt4/cstub.c @@ -280,14 +280,24 @@ void WINAPI NdrStubInitialize(PRPC_MESSAGE pRpcMsg, /*********************************************************************** * NdrStubGetBuffer [RPCRT4.@] */ -void WINAPI NdrStubGetBuffer(LPRPCSTUBBUFFER This, +void WINAPI NdrStubGetBuffer(LPRPCSTUBBUFFER iface, LPRPCCHANNELBUFFER pRpcChannelBuffer, PMIDL_STUB_MESSAGE pStubMsg) { - TRACE("(%p,%p)\n", This, pStubMsg); - pStubMsg->pRpcChannelBuffer = pRpcChannelBuffer; + CStdStubBuffer *This = (CStdStubBuffer *)iface; + HRESULT hr; + + TRACE("(%p, %p, %p)\n", This, pRpcChannelBuffer, pStubMsg); + pStubMsg->RpcMsg->BufferLength = pStubMsg->BufferLength; - I_RpcGetBuffer(pStubMsg->RpcMsg); /* ? */ + hr = IRpcChannelBuffer_GetBuffer(pRpcChannelBuffer, + (RPCOLEMESSAGE *)pStubMsg->RpcMsg, STUB_HEADER(This).piid); + if (FAILED(hr)) + { + RpcRaiseException(hr); + return; + } + pStubMsg->BufferStart = pStubMsg->RpcMsg->Buffer; pStubMsg->BufferEnd = pStubMsg->BufferStart + pStubMsg->BufferLength; pStubMsg->Buffer = pStubMsg->BufferStart;