Robert Shearman : rpcrt4: Change ComputeConformance and ComputeVariance from macros to

Alexandre Julliard julliard at wine.codeweavers.com
Sat Jun 3 05:24:36 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: ebcd6b6a24430cb556d1637d90678cb3d3b99fed
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=ebcd6b6a24430cb556d1637d90678cb3d3b99fed

Author: Robert Shearman <rob at codeweavers.com>
Date:   Fri Jun  2 20:46:16 2006 +0100

rpcrt4: Change ComputeConformance and ComputeVariance from macros to
inline functions. Clear pStubMsg->Offset in ComputeVariance since it
isn't set by ComputeConformanceOrVariance and so could be left filled
with garbage.

---

 dlls/rpcrt4/ndr_misc.h |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/dlls/rpcrt4/ndr_misc.h b/dlls/rpcrt4/ndr_misc.h
index 008839f..a1560b9 100644
--- a/dlls/rpcrt4/ndr_misc.h
+++ b/dlls/rpcrt4/ndr_misc.h
@@ -30,12 +30,21 @@ #include "rpcndr.h"
 
 struct IPSFactoryBuffer;
 
-#define ComputeConformance(pStubMsg, pMemory, pFormat, def) ComputeConformanceOrVariance(pStubMsg, pMemory, pFormat, def, &pStubMsg->MaxCount)
-#define ComputeVariance(pStubMsg, pMemory, pFormat, def) ComputeConformanceOrVariance(pStubMsg, pMemory, pFormat, def, &pStubMsg->ActualCount)
 PFORMAT_STRING ComputeConformanceOrVariance(
     MIDL_STUB_MESSAGE *pStubMsg, unsigned char *pMemory,
     PFORMAT_STRING pFormat, ULONG_PTR def, ULONG *pCount);
 
+static inline PFORMAT_STRING ComputeConformance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, ULONG def)
+{
+    return ComputeConformanceOrVariance(pStubMsg, pMemory, pFormat, def, &pStubMsg->MaxCount);
+}
+
+static inline PFORMAT_STRING ComputeVariance(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *pMemory, PFORMAT_STRING pFormat, ULONG def)
+{
+    pStubMsg->Offset = 0;
+    return ComputeConformanceOrVariance(pStubMsg, pMemory, pFormat, def, &pStubMsg->ActualCount);
+}
+
 typedef unsigned char* (WINAPI *NDR_MARSHALL)  (PMIDL_STUB_MESSAGE, unsigned char*, PFORMAT_STRING);
 typedef unsigned char* (WINAPI *NDR_UNMARSHALL)(PMIDL_STUB_MESSAGE, unsigned char**,PFORMAT_STRING, unsigned char);
 typedef void           (WINAPI *NDR_BUFFERSIZE)(PMIDL_STUB_MESSAGE, unsigned char*, PFORMAT_STRING);




More information about the wine-cvs mailing list