Robert Shearman : rpcrt4: Align conformances and variances correctly, according the the DCE/RPC spec.

Alexandre Julliard julliard at wine.codeweavers.com
Wed May 10 12:56:55 CDT 2006


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

Author: Robert Shearman <rob at codeweavers.com>
Date:   Wed May 10 13:13:25 2006 +0100

rpcrt4: Align conformances and variances correctly, according the the DCE/RPC spec.

---

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

diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index a3bdcf5..bbf9dd3 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -308,6 +308,7 @@ static inline BOOL IsConformanceOrVarian
 
 PFORMAT_STRING ReadConformance(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat)
 {
+  ALIGN_POINTER(pStubMsg->Buffer, 4);
   pStubMsg->MaxCount = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer);
   pStubMsg->Buffer += 4;
   TRACE("unmarshalled conformance is %ld\n", pStubMsg->MaxCount);
@@ -326,6 +327,7 @@ static inline PFORMAT_STRING ReadVarianc
     goto done;
   }
 
+  ALIGN_POINTER(pStubMsg->Buffer, 4);
   pStubMsg->Offset      = NDR_LOCAL_UINT32_READ(pStubMsg->Buffer);
   pStubMsg->Buffer += 4;
   TRACE("offset is %ld\n", pStubMsg->Offset);
@@ -343,6 +345,7 @@ done:
 /* writes the conformance value to the buffer */
 static inline void WriteConformance(MIDL_STUB_MESSAGE *pStubMsg)
 {
+    ALIGN_POINTER(pStubMsg->Buffer, 4);
     NDR_LOCAL_UINT32_WRITE(pStubMsg->Buffer, pStubMsg->MaxCount);
     pStubMsg->Buffer += 4;
 }
@@ -350,6 +353,7 @@ static inline void WriteConformance(MIDL
 /* writes the variance values to the buffer */
 static inline void WriteVariance(MIDL_STUB_MESSAGE *pStubMsg)
 {
+    ALIGN_POINTER(pStubMsg->Buffer, 4);
     NDR_LOCAL_UINT32_WRITE(pStubMsg->Buffer, pStubMsg->Offset);
     pStubMsg->Buffer += 4;
     NDR_LOCAL_UINT32_WRITE(pStubMsg->Buffer, pStubMsg->ActualCount);
@@ -359,12 +363,14 @@ static inline void WriteVariance(MIDL_ST
 /* requests buffer space for the conformance value */
 static inline void SizeConformance(MIDL_STUB_MESSAGE *pStubMsg)
 {
+    ALIGN_LENGTH(pStubMsg->BufferLength, 4);
     pStubMsg->BufferLength += 4;
 }
 
 /* requests buffer space for the variance values */
 static inline void SizeVariance(MIDL_STUB_MESSAGE *pStubMsg)
 {
+    ALIGN_LENGTH(pStubMsg->BufferLength, 4);
     pStubMsg->BufferLength += 8;
 }
 




More information about the wine-cvs mailing list