Alexandre Julliard : rpcrt4: Always skip the conformance format, even if conformance is not present in the buffer.

Alexandre Julliard julliard at winehq.org
Tue Apr 6 11:20:04 CDT 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Apr  5 21:59:30 2010 +0200

rpcrt4: Always skip the conformance format, even if conformance is not present in the buffer.

Add an identical SkipVariance function to make the code clearer.

---

 dlls/rpcrt4/ndr_marshall.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index 3b5a340..80020ee 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -644,14 +644,16 @@ finish_conf:
 static inline PFORMAT_STRING SkipConformance(PMIDL_STUB_MESSAGE pStubMsg,
                                              PFORMAT_STRING pFormat)
 {
-  if (IsConformanceOrVariancePresent(pFormat))
-  {
     if (pStubMsg->fHasNewCorrDesc)
       pFormat += 6;
     else
       pFormat += 4;
-  }
-  return pFormat;
+    return pFormat;
+}
+
+static inline PFORMAT_STRING SkipVariance(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
+{
+    return SkipConformance( pStubMsg, pFormat );
 }
 
 /* multiply two numbers together, raising an RPC_S_INVALID_BOUND exception if
@@ -1842,7 +1844,7 @@ static inline void array_buffer_size(
     alignment = pFormat[1] + 1;
 
     pFormat = SkipConformance(pStubMsg, pFormat + 4);
-    pFormat = SkipConformance(pStubMsg, pFormat);
+    pFormat = SkipVariance(pStubMsg, pFormat);
 
     SizeVariance(pStubMsg);
 
@@ -1942,10 +1944,8 @@ static inline void array_write_variance_and_marshall(
     esize = *(const WORD*)(pFormat+2);
     alignment = pFormat[1] + 1;
 
-    /* conformance */
     pFormat = SkipConformance(pStubMsg, pFormat + 4);
-    /* variance */
-    pFormat = SkipConformance(pStubMsg, pFormat);
+    pFormat = SkipVariance(pStubMsg, pFormat);
 
     WriteVariance(pStubMsg);
 




More information about the wine-cvs mailing list