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.

This commit is contained in:
Robert Shearman 2006-05-13 16:58:43 +01:00 committed by Alexandre Julliard
parent dcd0a39d4c
commit 628c5e9baf
1 changed files with 7 additions and 0 deletions

View File

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