From e745f93c79404b166f45eefcb883ff4d761f90fe Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Sun, 30 Dec 2007 16:46:05 +0000 Subject: [PATCH] rpcrt4: Fix the MIDL_STUB_MESSAGE fields set by NdrServerInitializeNew. --- dlls/rpcrt4/ndr_clientserver.c | 44 ++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/dlls/rpcrt4/ndr_clientserver.c b/dlls/rpcrt4/ndr_clientserver.c index fe424a63cc0..a43b92058a6 100644 --- a/dlls/rpcrt4/ndr_clientserver.c +++ b/dlls/rpcrt4/ndr_clientserver.c @@ -106,22 +106,42 @@ unsigned char* WINAPI NdrServerInitializeNew( PRPC_MESSAGE pRpcMsg, PMIDL_STUB_M { TRACE("(pRpcMsg == ^%p, pStubMsg == ^%p, pStubDesc == ^%p)\n", pRpcMsg, pStubMsg, pStubDesc); - assert( pRpcMsg && pStubMsg && pStubDesc ); - - /* not everyone allocates stack space for w2kReserved */ - memset(pStubMsg, 0, FIELD_OFFSET(MIDL_STUB_MESSAGE,pCSInfo)); - - pStubMsg->ReuseBuffer = TRUE; - pStubMsg->IsClient = FALSE; - pStubMsg->StubDesc = pStubDesc; - pStubMsg->pfnAllocate = pStubDesc->pfnAllocate; - pStubMsg->pfnFree = pStubDesc->pfnFree; pStubMsg->RpcMsg = pRpcMsg; pStubMsg->Buffer = pStubMsg->BufferStart = pRpcMsg->Buffer; + pStubMsg->BufferEnd = pStubMsg->Buffer + pRpcMsg->BufferLength; pStubMsg->BufferLength = pRpcMsg->BufferLength; - pStubMsg->BufferEnd = pStubMsg->Buffer + pStubMsg->BufferLength; + pStubMsg->IsClient = FALSE; + pStubMsg->ReuseBuffer = FALSE; + pStubMsg->pAllocAllNodesContext = NULL; + pStubMsg->pPointerQueueState = NULL; + pStubMsg->IgnoreEmbeddedPointers = 0; + pStubMsg->PointerBufferMark = NULL; + pStubMsg->uFlags = 0; + pStubMsg->pfnAllocate = pStubDesc->pfnAllocate; + pStubMsg->pfnFree = pStubDesc->pfnFree; + pStubMsg->StackTop = NULL; + pStubMsg->StubDesc = pStubDesc; + pStubMsg->FullPtrXlatTables = NULL; + pStubMsg->FullPtrRefId = 0; + pStubMsg->PointerLength = 0; + pStubMsg->fInDontFree = 0; + pStubMsg->fDontCallFreeInst = 0; + pStubMsg->fInOnlyParam = 0; + pStubMsg->fHasReturn = 0; + pStubMsg->fHasExtensions = 0; + pStubMsg->fHasNewCorrDesc = 0; + pStubMsg->fUnused = 0; + pStubMsg->dwDestContext = MSHCTX_DIFFERENTMACHINE; + pStubMsg->pvDestContext = NULL; + pStubMsg->pRpcChannelBuffer = NULL; + pStubMsg->pArrayInfo = NULL; + pStubMsg->dwStubPhase = 0; + /* FIXME: LowStackMark */ + pStubMsg->pAsyncMsg = NULL; + pStubMsg->pCorrInfo = NULL; + pStubMsg->pCorrMemory = NULL; + pStubMsg->pMemoryList = NULL; - /* FIXME: determine the proper return value */ return NULL; }