Commit 88bbbed1 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

rpcrt4: Change call_memory_sizer to preserve the buffer contents and

initialise the memory size field to zero before calling the memory sizer function.
parent d29108c3
......@@ -94,7 +94,18 @@ static inline void call_freer(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemor
static inline unsigned long call_memory_sizer(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
{
NDR_MEMORYSIZE m = NdrMemorySizer[pFormat[0] & NDR_TABLE_MASK];
if (m) return m(pStubMsg, pFormat);
if (m)
{
unsigned char *saved_buffer = pStubMsg->Buffer;
unsigned long ret;
int saved_ignore_embedded_pointers = pStubMsg->IgnoreEmbeddedPointers;
pStubMsg->MemorySize = 0;
pStubMsg->IgnoreEmbeddedPointers = 1;
ret = m(pStubMsg, pFormat);
pStubMsg->IgnoreEmbeddedPointers = saved_ignore_embedded_pointers;
pStubMsg->Buffer = saved_buffer;
return ret;
}
else
{
FIXME("format type 0x%x not implemented\n", pFormat[0]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment