Robert Shearman : rpcrt4: Don' t apply the offset to the pointer passed to callback conformance functions.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Apr 20 08:45:58 CDT 2006


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

Author: Robert Shearman <rob at codeweavers.com>
Date:   Thu Apr 20 11:45:40 2006 +0100

rpcrt4: Don't apply the offset to the pointer passed to callback conformance functions.

---

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

diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index 4868723..6830530 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -358,16 +358,16 @@ PFORMAT_STRING ComputeConformanceOrVaria
   switch (pFormat[0] & 0xf0) {
   case RPC_FC_NORMAL_CONFORMANCE:
     TRACE("normal conformance, ofs=%d\n", ofs);
-    ptr = pMemory + ofs;
+    ptr = pMemory;
     break;
   case RPC_FC_POINTER_CONFORMANCE:
     TRACE("pointer conformance, ofs=%d\n", ofs);
-    ptr = pStubMsg->Memory + ofs;
+    ptr = pStubMsg->Memory;
     break;
   case RPC_FC_TOP_LEVEL_CONFORMANCE:
     TRACE("toplevel conformance, ofs=%d\n", ofs);
     if (pStubMsg->StackTop) {
-      ptr = pStubMsg->StackTop + ofs;
+      ptr = pStubMsg->StackTop;
     }
     else {
       /* -Os mode, *pCount is already set */
@@ -382,7 +382,7 @@ PFORMAT_STRING ComputeConformanceOrVaria
   case RPC_FC_TOP_LEVEL_MULTID_CONFORMANCE:
     FIXME("toplevel multidimensional conformance, ofs=%d\n", ofs);
     if (pStubMsg->StackTop) {
-      ptr = pStubMsg->StackTop + ofs;
+      ptr = pStubMsg->StackTop;
     }
     else {
       /* ? */
@@ -395,7 +395,7 @@ PFORMAT_STRING ComputeConformanceOrVaria
 
   switch (pFormat[1]) {
   case RPC_FC_DEREFERENCE:
-    ptr = *(LPVOID*)ptr;
+    ptr = *(LPVOID*)((char *)ptr + ofs);
     break;
   case RPC_FC_CALLBACK:
   {
@@ -410,6 +410,7 @@ PFORMAT_STRING ComputeConformanceOrVaria
     goto finish_conf;
   }
   default:
+    ptr = (char *)ptr + ofs;
     break;
   }
 




More information about the wine-cvs mailing list