rpcrt4: Fix NdrStubGetBuffer to use the IRpcChannelBuffer object since

IRpcChannelBuffer_GetBuffer may put extra data onto the wire for ORPC
calls.
This commit is contained in:
Robert Shearman 2006-08-29 21:14:42 +01:00 committed by Alexandre Julliard
parent 3535b70a0b
commit 3e01da1838
1 changed files with 14 additions and 4 deletions

View File

@ -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;