rpcrt4: Implement NdrComplexArrayMemorySize.

This commit is contained in:
Robert Shearman 2006-05-13 16:59:20 +01:00 committed by Alexandre Julliard
parent 7ea0b860c5
commit cedbddbfde
1 changed files with 26 additions and 6 deletions

View File

@ -2374,8 +2374,13 @@ void WINAPI NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
unsigned long WINAPI NdrComplexArrayMemorySize(PMIDL_STUB_MESSAGE pStubMsg, unsigned long WINAPI NdrComplexArrayMemorySize(PMIDL_STUB_MESSAGE pStubMsg,
PFORMAT_STRING pFormat) PFORMAT_STRING pFormat)
{ {
DWORD size = 0; ULONG count, esize;
FIXME("(%p,%p): stub\n", pStubMsg, pFormat); unsigned char alignment;
unsigned char *Buffer;
unsigned long SavedMemorySize;
unsigned long MemorySize;
TRACE("(%p,%p)\n", pStubMsg, pFormat);
if (pFormat[0] != RPC_FC_BOGUS_ARRAY) if (pFormat[0] != RPC_FC_BOGUS_ARRAY)
{ {
@ -2384,15 +2389,30 @@ unsigned long WINAPI NdrComplexArrayMemorySize(PMIDL_STUB_MESSAGE pStubMsg,
return 0; return 0;
} }
alignment = pFormat[1] + 1;
pFormat += 4; pFormat += 4;
pFormat = ReadConformance(pStubMsg, pFormat); pFormat = ReadConformance(pStubMsg, pFormat);
size = pStubMsg->MaxCount; pFormat = ReadVariance(pStubMsg, pFormat);
TRACE("conformance=%ld\n", size);
pFormat += 4; ALIGN_POINTER(pStubMsg->Buffer, alignment);
return 0; SavedMemorySize = pStubMsg->MemorySize;
Buffer = pStubMsg->Buffer;
esize = ComplexStructSize(pStubMsg, pFormat);
pStubMsg->Buffer = Buffer;
MemorySize = esize * pStubMsg->MaxCount;
for (count = 0; count < pStubMsg->ActualCount; count++)
ComplexStructSize(pStubMsg, pFormat);
pStubMsg->MemorySize = SavedMemorySize;
pStubMsg->MemorySize += MemorySize;
return MemorySize;
} }
/*********************************************************************** /***********************************************************************