From fa847909f2ae6a8118c300809c77d12e317dea3a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 14 Jun 2011 12:57:30 +0200 Subject: [PATCH] rpcrt4: Preserve the previous MaxCount value when computing variance through a callback. --- dlls/rpcrt4/ndr_marshall.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 1e99c2e7013..c62675d915d 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -590,6 +590,8 @@ PFORMAT_STRING ComputeConformanceOrVariance( case RPC_FC_CALLBACK: { unsigned char *old_stack_top = pStubMsg->StackTop; + ULONG_PTR max_count, old_max_count = pStubMsg->MaxCount; + pStubMsg->StackTop = ptr; /* ofs is index into StubDesc->apfnExprEval */ @@ -599,7 +601,9 @@ PFORMAT_STRING ComputeConformanceOrVariance( pStubMsg->StackTop = old_stack_top; /* the callback function always stores the computed value in MaxCount */ - *pCount = pStubMsg->MaxCount; + max_count = pStubMsg->MaxCount; + pStubMsg->MaxCount = old_max_count; + *pCount = max_count; goto finish_conf; } default: