Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45699 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/rpcrt4/ndr_stubless.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index cc52ee27e8..0ef421daf2 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -210,6 +210,12 @@ static DWORD calc_arg_size(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat) pStubMsg->MaxCount = 0; size *= pStubMsg->MaxCount; break; + case FC_NON_ENCAPSULATED_UNION: + { + DWORD offset = *(const WORD *)(pFormat + 6 + pStubMsg->CorrDespIncrement); + size = *(const WORD *)(pFormat + 8 + pStubMsg->CorrDespIncrement + offset); + break; + } default: FIXME("Unhandled type %02x\n", *pFormat); /* fallthrough */
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45699 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/rpcrt4/ndr_stubless.c | 63 ++++++++++++++++++++++++++++++++++++++ dlls/rpcrt4/rpcrt4.spec | 1 + include/rpcndr.h | 4 ++- 3 files changed, 67 insertions(+), 1 deletion(-)
diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index 0ef421daf2..13a60522fe 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -2210,3 +2210,66 @@ RPC_STATUS NdrpCompleteAsyncServerCall(RPC_ASYNC_STATE *pAsync, void *Reply)
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 diff --git a/dlls/rpcrt4/rpcrt4.spec b/dlls/rpcrt4/rpcrt4.spec index 5d558bff75..2673771ef5 100644 --- a/dlls/rpcrt4/rpcrt4.spec +++ b/dlls/rpcrt4/rpcrt4.spec @@ -128,6 +128,7 @@ @ stdcall NdrClearOutParameters(ptr ptr ptr) @ varargs NdrClientCall2(ptr ptr) @ varargs -arch=i386 NdrClientCall(ptr ptr) NdrClientCall2 +@ varargs -arch=win64 NdrClientCall3(ptr long ptr) @ stdcall NdrClientContextMarshall(ptr ptr long) @ stdcall NdrClientContextUnmarshall(ptr ptr ptr) @ stub NdrClientInitialize diff --git a/include/rpcndr.h b/include/rpcndr.h index ac9da115ca..729b881c9b 100644 --- a/include/rpcndr.h +++ b/include/rpcndr.h @@ -663,10 +663,12 @@ RPCRTAPI void RPC_ENTRY RPCRTAPI unsigned char* RPC_ENTRY 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 NdrClientCall2( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); 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 NdrAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); CLIENT_CALL_RETURN RPC_VAR_ENTRY
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45699 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/rpcrt4/ndr_stubless.c | 60 ++++++++++++++++++++++++++++++++++++++ dlls/rpcrt4/rpcrt4.spec | 1 + include/rpcndr.h | 2 ++ 3 files changed, 63 insertions(+)
diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index 13a60522fe..3a38137f7f 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -2273,3 +2273,63 @@ CLIENT_CALL_RETURN WINAPIV NdrClientCall3( MIDL_STUBLESS_PROXY_INFO *info, ULONG }
#endif + +LONG_PTR CDECL DECLSPEC_HIDDEN ndr64_async_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_async_client_call( info->pStubDesc, + syntax_info->ProcString + syntax_info->FmtStringOffset[proc], stack_top ); + } + } + + FIXME("NDR64 syntax is not supported.\n"); + return 0; +} + +#ifdef __x86_64__ + +__ASM_GLOBAL_FUNC( Ndr64AsyncClientCall, + "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_async_client_call") "\n\t" + "addq $0x28,%rsp\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset -0x28\n\t") + "ret" ); + +#elif defined(_WIN64) + +/*********************************************************************** + * Ndr64AsyncClientCall [RPCRT4.@] + */ +CLIENT_CALL_RETURN WINAPIV Ndr64AsyncClientCall( MIDL_STUBLESS_PROXY_INFO *info, ULONG proc, void *retval, ... ) +{ + __ms_va_list args; + LONG_PTR ret; + + __ms_va_start( args, retval ); + ret = ndr64_async_client_call( info, proc, retval, va_arg( args, void ** ), NULL ); + __ms_va_end( args ); + return *(CLIENT_CALL_RETURN *)&ret; +} + +#endif diff --git a/dlls/rpcrt4/rpcrt4.spec b/dlls/rpcrt4/rpcrt4.spec index 2673771ef5..04927764ef 100644 --- a/dlls/rpcrt4/rpcrt4.spec +++ b/dlls/rpcrt4/rpcrt4.spec @@ -115,6 +115,7 @@ @ stdcall NDRSContextUnmarshall(ptr long) @ stdcall NDRSContextUnmarshallEx(ptr ptr long) @ stub NDRcopy +@ varargs -arch=win64 Ndr64AsyncClientCall(ptr long ptr) @ stdcall NdrAllocate(ptr long) @ varargs NdrAsyncClientCall(ptr ptr) @ stdcall NdrAsyncServerCall(ptr) diff --git a/include/rpcndr.h b/include/rpcndr.h index 729b881c9b..86cbe5f6c6 100644 --- a/include/rpcndr.h +++ b/include/rpcndr.h @@ -671,6 +671,8 @@ CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrClientCall3( MIDL_STUBLESS_PROXY_INFO *info, ULONG proc, void *retval, ... ); CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); +CLIENT_CALL_RETURN RPC_VAR_ENTRY + Ndr64AsyncClientCall( MIDL_STUBLESS_PROXY_INFO *info, ULONG proc, void *retval, ... ); CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrDcomAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... );
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45699 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/rpcrt4/ndr_stubless.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index 3a38137f7f..9f579fcfd4 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -1614,7 +1614,7 @@ static void do_ndr_async_client_call( const MIDL_STUB_DESC *pStubDesc, PFORMAT_S RPC_STATUS status;
/* Later NDR language versions probably won't be backwards compatible */ - if (pStubDesc->Version > 0x50002) + if (pStubDesc->Version > 0x60001) { FIXME("Incompatible stub description version: 0x%x\n", pStubDesc->Version); RpcRaiseException(RPC_X_WRONG_STUB_VERSION);