From cc0209690e2b583a419b70e6cc5082d77dc6fce3 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Fri, 18 Jan 2008 11:38:47 +0000 Subject: [PATCH] Rob Shearman : rpcrt4: Handle complex arrays in calc_arg_size. svn path=/trunk/; revision=31859 --- reactos/dll/win32/rpcrt4/ndr_marshall.c | 4 ++-- reactos/dll/win32/rpcrt4/ndr_misc.h | 2 ++ reactos/dll/win32/rpcrt4/ndr_stubless.c | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/rpcrt4/ndr_marshall.c b/reactos/dll/win32/rpcrt4/ndr_marshall.c index 8a8fbfb3ee1..e18f59cb627 100644 --- a/reactos/dll/win32/rpcrt4/ndr_marshall.c +++ b/reactos/dll/win32/rpcrt4/ndr_marshall.c @@ -2655,8 +2655,8 @@ static unsigned long ComplexStructMemorySize(PMIDL_STUB_MESSAGE pStubMsg, return size; } -static unsigned long ComplexStructSize(PMIDL_STUB_MESSAGE pStubMsg, - PFORMAT_STRING pFormat) +unsigned long ComplexStructSize(PMIDL_STUB_MESSAGE pStubMsg, + PFORMAT_STRING pFormat) { PFORMAT_STRING desc; unsigned long size = 0; diff --git a/reactos/dll/win32/rpcrt4/ndr_misc.h b/reactos/dll/win32/rpcrt4/ndr_misc.h index ebd70b8d826..b6dfaffe768 100644 --- a/reactos/dll/win32/rpcrt4/ndr_misc.h +++ b/reactos/dll/win32/rpcrt4/ndr_misc.h @@ -62,4 +62,6 @@ extern const NDR_BUFFERSIZE NdrBufferSizer[]; extern const NDR_MEMORYSIZE NdrMemorySizer[]; extern const NDR_FREE NdrFreer[]; +unsigned long ComplexStructSize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat); + #endif /* __WINE_NDR_MISC_H */ diff --git a/reactos/dll/win32/rpcrt4/ndr_stubless.c b/reactos/dll/win32/rpcrt4/ndr_stubless.c index c21b8098198..1a1141138e5 100644 --- a/reactos/dll/win32/rpcrt4/ndr_stubless.c +++ b/reactos/dll/win32/rpcrt4/ndr_stubless.c @@ -849,6 +849,12 @@ static DWORD calc_arg_size(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat) case RPC_FC_LGFARRAY: size = *(const DWORD*)(pFormat + 2); break; + case RPC_FC_BOGUS_ARRAY: + pFormat = ComputeConformance(pStubMsg, NULL, pFormat + 4, *(const WORD*)&pFormat[2]); + TRACE("conformance = %ld\n", pStubMsg->MaxCount); + pFormat = ComputeVariance(pStubMsg, NULL, pFormat, pStubMsg->MaxCount); + size = ComplexStructSize(pStubMsg, pFormat); + size *= pStubMsg->MaxCount; default: FIXME("Unhandled type %02x\n", *pFormat); /* fallthrough */