Commit 628c5e9b authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

rpcrt4: The NDR memory sizing functions should increment the buffer pointer, so…

rpcrt4: The NDR memory sizing functions should increment the buffer pointer, so make sure to save it before calling one of these and restore it afterwards.
parent dcd0a39d
......@@ -2289,6 +2289,7 @@ unsigned char * WINAPI NdrComplexArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
ULONG count, esize;
unsigned char alignment;
unsigned char *pMemory;
unsigned char *Buffer;
TRACE("(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc);
......@@ -2306,7 +2307,9 @@ unsigned char * WINAPI NdrComplexArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
pFormat = ReadConformance(pStubMsg, pFormat);
pFormat = ReadVariance(pStubMsg, pFormat);
Buffer = pStubMsg->Buffer;
esize = ComplexStructSize(pStubMsg, pFormat);
pStubMsg->Buffer = Buffer;
if (fMustAlloc || !*ppMemory)
{
......@@ -3423,7 +3426,11 @@ static unsigned char *WINAPI NdrBaseTypeUnmarshall(
TRACE("pStubMsg: %p, ppMemory: %p, type: 0x%02x, fMustAlloc: %s\n", pStubMsg, ppMemory, *pFormat, fMustAlloc ? "true" : "false");
if (fMustAlloc || !*ppMemory)
{
unsigned char *Buffer = pStubMsg->Buffer;
*ppMemory = NdrAllocate(pStubMsg, NdrBaseTypeMemorySize(pStubMsg, pFormat));
pStubMsg->Buffer = Buffer;
}
TRACE("*ppMemory: %p\n", *ppMemory);
......
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