Commit a75402af authored by Alexandre Julliard's avatar Alexandre Julliard

rpcrt4: Add a wrapper for NdrAsyncClientCall too.

parent ffb8f4be
...@@ -1773,8 +1773,7 @@ struct async_call_data ...@@ -1773,8 +1773,7 @@ struct async_call_data
ULONG_PTR NdrCorrCache[256]; ULONG_PTR NdrCorrCache[256];
}; };
CLIENT_CALL_RETURN WINAPIV NdrAsyncClientCall(PMIDL_STUB_DESC pStubDesc, LONG_PTR CDECL ndr_async_client_call( PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, void **stack_top )
PFORMAT_STRING pFormat, ...)
{ {
/* pointer to start of stack where arguments start */ /* pointer to start of stack where arguments start */
PRPC_MESSAGE pRpcMsg; PRPC_MESSAGE pRpcMsg;
...@@ -1793,8 +1792,6 @@ CLIENT_CALL_RETURN WINAPIV NdrAsyncClientCall(PMIDL_STUB_DESC pStubDesc, ...@@ -1793,8 +1792,6 @@ CLIENT_CALL_RETURN WINAPIV NdrAsyncClientCall(PMIDL_STUB_DESC pStubDesc,
const NDR_PROC_HEADER * pProcHeader = (const NDR_PROC_HEADER *)&pFormat[0]; const NDR_PROC_HEADER * pProcHeader = (const NDR_PROC_HEADER *)&pFormat[0];
/* -Oif or -Oicf generated format */ /* -Oif or -Oicf generated format */
BOOL bV2Format = FALSE; BOOL bV2Format = FALSE;
LONG_PTR RetVal;
__ms_va_list args;
TRACE("pStubDesc %p, pFormat %p, ...\n", pStubDesc, pFormat); TRACE("pStubDesc %p, pFormat %p, ...\n", pStubDesc, pFormat);
...@@ -1847,9 +1844,7 @@ CLIENT_CALL_RETURN WINAPIV NdrAsyncClientCall(PMIDL_STUB_DESC pStubDesc, ...@@ -1847,9 +1844,7 @@ CLIENT_CALL_RETURN WINAPIV NdrAsyncClientCall(PMIDL_STUB_DESC pStubDesc,
/* needed for conformance of top-level objects */ /* needed for conformance of top-level objects */
pStubMsg->StackTop = I_RpcAllocate(async_call_data->stack_size); pStubMsg->StackTop = I_RpcAllocate(async_call_data->stack_size);
__ms_va_start( args, pFormat ); memcpy(pStubMsg->StackTop, stack_top, async_call_data->stack_size);
memcpy(pStubMsg->StackTop, va_arg( args, unsigned char * ), async_call_data->stack_size);
__ms_va_end( args );
pAsync = *(RPC_ASYNC_STATE **)pStubMsg->StackTop; pAsync = *(RPC_ASYNC_STATE **)pStubMsg->StackTop;
pAsync->StubInfo = async_call_data; pAsync->StubInfo = async_call_data;
...@@ -1984,8 +1979,7 @@ CLIENT_CALL_RETURN WINAPIV NdrAsyncClientCall(PMIDL_STUB_DESC pStubDesc, ...@@ -1984,8 +1979,7 @@ CLIENT_CALL_RETURN WINAPIV NdrAsyncClientCall(PMIDL_STUB_DESC pStubDesc,
done: done:
TRACE("returning 0\n"); TRACE("returning 0\n");
RetVal = 0; return 0;
return *(CLIENT_CALL_RETURN *)&RetVal;
} }
RPC_STATUS NdrpCompleteAsyncClientCall(RPC_ASYNC_STATE *pAsync, void *Reply) RPC_STATUS NdrpCompleteAsyncClientCall(RPC_ASYNC_STATE *pAsync, void *Reply)
...@@ -2087,6 +2081,37 @@ cleanup: ...@@ -2087,6 +2081,37 @@ cleanup:
return status; return status;
} }
#ifdef __x86_64__
__ASM_GLOBAL_FUNC( NdrAsyncClientCall,
"movq %r8,0x18(%rsp)\n\t"
"movq %r9,0x20(%rsp)\n\t"
"leaq 0x18(%rsp),%r8\n\t"
"subq $0x28,%rsp\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 0x28\n\t")
"call " __ASM_NAME("ndr_async_client_call") "\n\t"
"addq $0x28,%rsp\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset -0x28\n\t")
"ret" );
#else /* __x86_64__ */
/***********************************************************************
* NdrAsyncClientCall [RPCRT4.@]
*/
CLIENT_CALL_RETURN WINAPIV NdrAsyncClientCall( PMIDL_STUB_DESC desc, PFORMAT_STRING format, ... )
{
__ms_va_list args;
LONG_PTR ret;
__ms_va_start( args, format );
ret = ndr_async_client_call( desc, format, va_arg( args, void ** ));
__ms_va_end( args );
return *(CLIENT_CALL_RETURN *)&ret;
}
#endif /* __x86_64__ */
RPCRTAPI LONG RPC_ENTRY NdrAsyncStubCall(struct IRpcStubBuffer* pThis, RPCRTAPI LONG RPC_ENTRY NdrAsyncStubCall(struct IRpcStubBuffer* pThis,
struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg, struct IRpcChannelBuffer* pChannel, PRPC_MESSAGE pRpcMsg,
DWORD * pdwStubPhase) DWORD * pdwStubPhase)
......
...@@ -238,6 +238,8 @@ typedef struct _NDR_EHD_CONTEXT ...@@ -238,6 +238,8 @@ typedef struct _NDR_EHD_CONTEXT
LONG_PTR CDECL ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, LONG_PTR CDECL ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat,
void **stack_top, void **fpu_stack ) DECLSPEC_HIDDEN; void **stack_top, void **fpu_stack ) DECLSPEC_HIDDEN;
LONG_PTR CDECL ndr_async_client_call( PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat,
void **stack_top ) DECLSPEC_HIDDEN;
void client_do_args_old_format(PMIDL_STUB_MESSAGE pStubMsg, void client_do_args_old_format(PMIDL_STUB_MESSAGE pStubMsg,
PFORMAT_STRING pFormat, int phase, unsigned char *args, PFORMAT_STRING pFormat, int phase, unsigned char *args,
unsigned short stack_size, unsigned char *pRetVal, BOOL object_proc, unsigned short stack_size, unsigned char *pRetVal, BOOL object_proc,
......
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