rpcrt4: Implement NdrClientCall3().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45699
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-04-04 18:15:30 -05:00 committed by Alexandre Julliard
parent ff7f92c0b0
commit 9369aea260
3 changed files with 67 additions and 1 deletions

View File

@ -2210,3 +2210,66 @@ RPC_STATUS NdrpCompleteAsyncServerCall(RPC_ASYNC_STATE *pAsync, void *Reply)
return S_OK; return S_OK;
} }
static const RPC_SYNTAX_IDENTIFIER ndr_syntax_id =
{{0x8a885d04, 0x1ceb, 0x11c9, {0x9f, 0xe8, 0x08, 0x00, 0x2b, 0x10, 0x48, 0x60}}, {2, 0}};
LONG_PTR CDECL DECLSPEC_HIDDEN ndr64_client_call( MIDL_STUBLESS_PROXY_INFO *info,
ULONG proc, void *retval, void **stack_top, void **fpu_stack )
{
ULONG_PTR i;
TRACE("info %p, proc %u, retval %p, stack_top %p, fpu_stack %p\n",
info, proc, retval, stack_top, fpu_stack);
for (i = 0; i < info->nCount; ++i)
{
const MIDL_SYNTAX_INFO *syntax_info = &info->pSyntaxInfo[i];
const RPC_SYNTAX_IDENTIFIER *id = &syntax_info->TransferSyntax;
TRACE("Found syntax %s, version %u.%u.\n", debugstr_guid(&id->SyntaxGUID),
id->SyntaxVersion.MajorVersion, id->SyntaxVersion.MinorVersion);
if (!memcmp(id, &ndr_syntax_id, sizeof(RPC_SYNTAX_IDENTIFIER)))
{
if (retval)
FIXME("Complex return types are not supported.\n");
return ndr_client_call( info->pStubDesc,
syntax_info->ProcString + syntax_info->FmtStringOffset[proc], stack_top, fpu_stack );
}
}
FIXME("NDR64 syntax is not supported.\n");
return 0;
}
#ifdef __x86_64__
__ASM_GLOBAL_FUNC( NdrClientCall3,
"movq %r9,0x20(%rsp)\n\t"
"leaq 0x20(%rsp),%r9\n\t"
"pushq $0\n\t"
"subq $0x20,%rsp\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 0x28\n\t")
"call " __ASM_NAME("ndr64_client_call") "\n\t"
"addq $0x28,%rsp\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset -0x28\n\t")
"ret" );
#elif defined(_WIN64)
/***********************************************************************
* NdrClientCall3 [RPCRT4.@]
*/
CLIENT_CALL_RETURN WINAPIV NdrClientCall3( MIDL_STUBLESS_PROXY_INFO *info, ULONG proc, void *retval, ... )
{
__ms_va_list args;
LONG_PTR ret;
__ms_va_start( args, retval );
ret = ndr64_client_call( info, proc, retval, va_arg( args, void ** ), NULL );
__ms_va_end( args );
return *(CLIENT_CALL_RETURN *)&ret;
}
#endif

View File

@ -128,6 +128,7 @@
@ stdcall NdrClearOutParameters(ptr ptr ptr) @ stdcall NdrClearOutParameters(ptr ptr ptr)
@ varargs NdrClientCall2(ptr ptr) @ varargs NdrClientCall2(ptr ptr)
@ varargs -arch=i386 NdrClientCall(ptr ptr) NdrClientCall2 @ varargs -arch=i386 NdrClientCall(ptr ptr) NdrClientCall2
@ varargs -arch=win64 NdrClientCall3(ptr long ptr)
@ stdcall NdrClientContextMarshall(ptr ptr long) @ stdcall NdrClientContextMarshall(ptr ptr long)
@ stdcall NdrClientContextUnmarshall(ptr ptr ptr) @ stdcall NdrClientContextUnmarshall(ptr ptr ptr)
@ stub NdrClientInitialize @ stub NdrClientInitialize

View File

@ -663,10 +663,12 @@ RPCRTAPI void RPC_ENTRY
RPCRTAPI unsigned char* RPC_ENTRY RPCRTAPI unsigned char* RPC_ENTRY
NdrUserMarshalSimpleTypeConvert( ULONG *pFlags, unsigned char *pBuffer, unsigned char FormatChar ); NdrUserMarshalSimpleTypeConvert( ULONG *pFlags, unsigned char *pBuffer, unsigned char FormatChar );
CLIENT_CALL_RETURN RPC_VAR_ENTRY
NdrClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
CLIENT_CALL_RETURN RPC_VAR_ENTRY CLIENT_CALL_RETURN RPC_VAR_ENTRY
NdrClientCall2( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); NdrClientCall2( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
CLIENT_CALL_RETURN RPC_VAR_ENTRY CLIENT_CALL_RETURN RPC_VAR_ENTRY
NdrClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); NdrClientCall3( MIDL_STUBLESS_PROXY_INFO *info, ULONG proc, void *retval, ... );
CLIENT_CALL_RETURN RPC_VAR_ENTRY CLIENT_CALL_RETURN RPC_VAR_ENTRY
NdrAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); NdrAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
CLIENT_CALL_RETURN RPC_VAR_ENTRY CLIENT_CALL_RETURN RPC_VAR_ENTRY