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.
This commit is contained in:
Huw Davies 2015-07-13 13:11:36 +01:00 committed by Alexandre Julliard
parent 6518b72889
commit 76dc3b64ae
2 changed files with 27 additions and 1 deletions

View File

@ -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;
}

View File

@ -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();
}