Commit fdda17de authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

rpcrt4: Move the initialising of the stub message structure nearer to the top of NdrClientCall2.

Set stubMsg.StackTop after calling the initialise function.
parent 9d874474
...@@ -410,13 +410,6 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma ...@@ -410,13 +410,6 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma
TRACE("pStubDesc %p, pFormat %p, ...\n", pStubDesc, pFormat); TRACE("pStubDesc %p, pFormat %p, ...\n", pStubDesc, pFormat);
/* needed for conformance of top-level objects */
#ifdef __i386__
stubMsg.StackTop = *(unsigned char **)(&pFormat+1);
#else
# warning Stack not retrieved for your CPU architecture
#endif
/* Later NDR language versions probably won't be backwards compatible */ /* Later NDR language versions probably won't be backwards compatible */
if (pStubDesc->Version > 0x50002) if (pStubDesc->Version > 0x50002)
{ {
...@@ -439,9 +432,25 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma ...@@ -439,9 +432,25 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma
current_offset = sizeof(NDR_PROC_HEADER); current_offset = sizeof(NDR_PROC_HEADER);
} }
if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT)
{
/* object is always the first argument */
This = *(void **)ARG_FROM_OFFSET(stubMsg, 0);
NdrProxyInitialize(This, &rpcMsg, &stubMsg, pStubDesc, procedure_number);
}
else
NdrClientInitializeNew(&rpcMsg, &stubMsg, pStubDesc, procedure_number);
TRACE("Oi_flags = 0x%02x\n", pProcHeader->Oi_flags); TRACE("Oi_flags = 0x%02x\n", pProcHeader->Oi_flags);
TRACE("MIDL stub version = 0x%lx\n", pStubDesc->MIDLVersion); TRACE("MIDL stub version = 0x%lx\n", pStubDesc->MIDLVersion);
/* needed for conformance of top-level objects */
#ifdef __i386__
stubMsg.StackTop = *(unsigned char **)(&pFormat+1);
#else
# warning Stack not retrieved for your CPU architecture
#endif
/* we only need a handle if this isn't an object method */ /* we only need a handle if this isn't an object method */
if (!(pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT)) if (!(pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT))
{ {
...@@ -547,15 +556,6 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma ...@@ -547,15 +556,6 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma
current_offset += pExtensions->Size; current_offset += pExtensions->Size;
} }
if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT)
{
/* object is always the first argument */
This = *(void **)ARG_FROM_OFFSET(stubMsg, 0);
NdrProxyInitialize(This, &rpcMsg, &stubMsg, pStubDesc, procedure_number);
}
else
NdrClientInitializeNew(&rpcMsg, &stubMsg, pStubDesc, procedure_number);
/* create the full pointer translation tables, if requested */ /* create the full pointer translation tables, if requested */
if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_FULLPTR) if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_FULLPTR)
#if 0 #if 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment