Huw Davies : rpcrt4: Set CorrDespIncrement to the size of the (non-range) /robust payload.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 13 09:30:04 CDT 2015


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon Jul 13 13:11:36 2015 +0100

rpcrt4: Set CorrDespIncrement to the size of the (non-range) /robust payload.

fHasNewCorrDesc is only set on older versions of Windows that don't
set CorrDespIncrement, but it can't hurt to continue to set it.

---

 dlls/rpcrt4/ndr_marshall.c       |  6 +++++-
 dlls/rpcrt4/tests/ndr_marshall.c | 22 ++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index 0ba5b00..35c15a1 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -7206,7 +7206,11 @@ NDR_SCONTEXT WINAPI NdrServerContextNewUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
  */
 void WINAPI NdrCorrelationInitialize(PMIDL_STUB_MESSAGE pStubMsg, void *pMemory, ULONG CacheSize, ULONG Flags)
 {
-    FIXME("(%p, %p, %d, 0x%x): stub\n", pStubMsg, pMemory, CacheSize, Flags);
+    FIXME("(%p, %p, %d, 0x%x): semi-stub\n", pStubMsg, pMemory, CacheSize, Flags);
+
+    if (pStubMsg->CorrDespIncrement == 0)
+        pStubMsg->CorrDespIncrement = 2; /* size of the normal (non-range) /robust payload */
+
     pStubMsg->fHasNewCorrDesc = TRUE;
 }
 
diff --git a/dlls/rpcrt4/tests/ndr_marshall.c b/dlls/rpcrt4/tests/ndr_marshall.c
index a9c16b2..d6befe5 100644
--- a/dlls/rpcrt4/tests/ndr_marshall.c
+++ b/dlls/rpcrt4/tests/ndr_marshall.c
@@ -2468,6 +2468,27 @@ if (status == RPC_S_OK)
     ok(status == RPC_S_OK, "got %d\n", status);
 }
 
+static void test_NdrCorrelationInitialize(void)
+{
+    MIDL_STUB_MESSAGE stub_msg;
+    BYTE buf[256];
+
+    memset( &stub_msg, 0, sizeof(stub_msg) );
+    memset( buf, 0, sizeof(buf) );
+
+    NdrCorrelationInitialize( &stub_msg, buf, sizeof(buf), 0 );
+    ok( stub_msg.CorrDespIncrement == 2 ||
+        broken(stub_msg.CorrDespIncrement == 0), /* <= Win 2003 */
+        "got %d\n", stub_msg.CorrDespIncrement );
+
+    memset( &stub_msg, 0, sizeof(stub_msg) );
+    memset( buf, 0, sizeof(buf) );
+
+    stub_msg.CorrDespIncrement = 1;
+    NdrCorrelationInitialize( &stub_msg, buf, sizeof(buf), 0 );
+    ok( stub_msg.CorrDespIncrement == 1, "got %d\n", stub_msg.CorrDespIncrement );
+}
+
 START_TEST( ndr_marshall )
 {
     determine_pointer_marshalling_style();
@@ -2489,4 +2510,5 @@ START_TEST( ndr_marshall )
     test_NdrMapCommAndFaultStatus();
     test_NdrGetUserMarshalInfo();
     test_MesEncodeFixedBufferHandleCreate();
+    test_NdrCorrelationInitialize();
 }




More information about the wine-cvs mailing list