From 4f6142b8d9a965ebbfeedd0341b3235e82747313 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Mon, 14 Jan 2008 11:54:32 +0000 Subject: [PATCH] rpcrt4: Handle complex arrays in calc_arg_size. --- dlls/rpcrt4/ndr_marshall.c | 4 ++-- dlls/rpcrt4/ndr_misc.h | 2 ++ dlls/rpcrt4/ndr_stubless.c | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index dbcddd2a959..6ed102fea12 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -2654,8 +2654,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/dlls/rpcrt4/ndr_misc.h b/dlls/rpcrt4/ndr_misc.h index ebd70b8d826..b6dfaffe768 100644 --- a/dlls/rpcrt4/ndr_misc.h +++ b/dlls/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/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index fb76a2f025b..bc406414d8e 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/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 */