From: Zhiyi Zhang <zzhang@codeweavers.com> --- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/signal_arm64ec.c | 1 + dlls/ntdll/unix/alpc.c | 11 +++++++++++ dlls/wow64/syscall.c | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 9c486240b81..05160b37a14 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -155,6 +155,7 @@ @ stdcall -syscall NtAllocateUuids(ptr ptr ptr ptr) @ stdcall -syscall=0x0018 NtAllocateVirtualMemory(long ptr long ptr long long) @ stdcall -syscall NtAllocateVirtualMemoryEx(long ptr ptr long long ptr long) +@ stdcall -syscall NtAlpcAcceptConnectPort(ptr ptr long ptr ptr ptr ptr ptr long) @ stdcall -syscall NtAlpcConnectPort(ptr ptr ptr ptr long ptr ptr ptr ptr ptr ptr) @ stdcall -syscall NtAlpcCreatePort(ptr ptr ptr) @ stub -syscall=0x004c NtApphelpCacheControl diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index 922a410f636..3d4ef72fdda 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -364,6 +364,7 @@ DEFINE_SYSCALL(NtAllocateReserveObject, (HANDLE *handle, const OBJECT_ATTRIBUTES DEFINE_SYSCALL(NtAllocateUuids, (ULARGE_INTEGER *time, ULONG *delta, ULONG *sequence, UCHAR *seed)) DEFINE_WRAPPED_SYSCALL(NtAllocateVirtualMemory, (HANDLE process, PVOID *ret, ULONG_PTR zero_bits, SIZE_T *size_ptr, ULONG type, ULONG protect)) DEFINE_WRAPPED_SYSCALL(NtAllocateVirtualMemoryEx, (HANDLE process, PVOID *ret, SIZE_T *size_ptr, ULONG type, ULONG protect, MEM_EXTENDED_PARAMETER *parameters, ULONG count)) +DEFINE_SYSCALL(NtAlpcAcceptConnectPort, (HANDLE *communication_port, HANDLE connection_port, DWORD flags, OBJECT_ATTRIBUTES *obj_attr, ALPC_PORT_ATTRIBUTES *port_attr, void *port_context, ALPC_PORT_MESSAGE *send_msg, ALPC_MESSAGE_ATTRIBUTES *send_msg_attr, BOOLEAN accept)) DEFINE_SYSCALL(NtAlpcConnectPort, (HANDLE *port_handle, UNICODE_STRING *port_name, OBJECT_ATTRIBUTES *obj_attr, ALPC_PORT_ATTRIBUTES *port_attr, DWORD flags, PSID required_server_sid, ALPC_PORT_MESSAGE *connect_msg, SIZE_T *connect_msg_size, ALPC_MESSAGE_ATTRIBUTES *send_msg_attr, ALPC_MESSAGE_ATTRIBUTES *recv_msg_attr, LARGE_INTEGER *timeout)) DEFINE_SYSCALL(NtAlpcCreatePort, (HANDLE *port_handle, OBJECT_ATTRIBUTES *obj_attr, ALPC_PORT_ATTRIBUTES *port_attr)) DEFINE_SYSCALL(NtApphelpCacheControl, (ULONG class, void *context)) diff --git a/dlls/ntdll/unix/alpc.c b/dlls/ntdll/unix/alpc.c index 3a55e6cc8fd..2e2d6e4c137 100644 --- a/dlls/ntdll/unix/alpc.c +++ b/dlls/ntdll/unix/alpc.c @@ -28,6 +28,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(alpc); +NTSTATUS WINAPI NtAlpcAcceptConnectPort( HANDLE *communication_port, HANDLE connection_port, + DWORD flags, OBJECT_ATTRIBUTES *obj_attr, + ALPC_PORT_ATTRIBUTES *port_attr, void *port_context, + ALPC_PORT_MESSAGE *send_msg, + ALPC_MESSAGE_ATTRIBUTES *send_msg_attr, BOOLEAN accept ) +{ + FIXME( "%p, %p, %#x, %p, %p, %p, %p, %p, %d stub!\n", communication_port, connection_port, + (unsigned int)flags, obj_attr, port_attr, port_context, send_msg, send_msg_attr, accept ); + return STATUS_NOT_IMPLEMENTED; +} + NTSTATUS WINAPI NtAlpcConnectPort( HANDLE *port_handle, UNICODE_STRING *port_name, OBJECT_ATTRIBUTES *obj_attr, ALPC_PORT_ATTRIBUTES *port_attr, DWORD flags, PSID required_server_sid, diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index c8d3c387522..5b7faa9dcd4 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -463,6 +463,39 @@ NTSTATUS WINAPI wow64_NtAllocateUuids( UINT *args ) return NtAllocateUuids( time, delta, sequence, seed ); } +/********************************************************************** + * wow64_NtAlpcAcceptConnectPort + */ +NTSTATUS WINAPI wow64_NtAlpcAcceptConnectPort( UINT *args ) +{ + ULONG *communication_port_ptr = get_ptr( &args ); + HANDLE connection_port = get_handle( &args ); + ULONG flags = get_ulong( &args ); + OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args ); + ALPC_PORT_ATTRIBUTES32 *port_attr32 = get_ptr( &args ); + void *context = get_ptr( &args ); + ALPC_PORT_MESSAGE32 *msg32 = get_ptr( &args ); + ALPC_MESSAGE_ATTRIBUTES32 *msg_attr32 = get_ptr( &args ); + BOOLEAN accept = get_ulong( &args ); + NTSTATUS status; + + HANDLE communication_port = 0; + struct object_attr64 attr; + ALPC_PORT_ATTRIBUTES port_attr; + ALPC_PORT_MESSAGE *msg; + ALPC_MESSAGE_ATTRIBUTES *msg_attr; + + status = NtAlpcAcceptConnectPort( communication_port_ptr ? &communication_port : NULL, + connection_port, flags, objattr_32to64( &attr, attr32 ), + alpc_port_attributes_32to64( &port_attr, port_attr32 ), context, + alpc_port_message_32to64( &msg, msg32 ? (sizeof(*msg) + msg32->DataLength) : 0, msg32, TRUE ), + alpc_port_message_attributes_32to64( &msg_attr, msg_attr32, TRUE ), + accept); + if (status == STATUS_SUCCESS && accept && communication_port_ptr) + put_handle( communication_port_ptr, communication_port ); + return status; +} + /********************************************************************** * wow64_NtAlpcConnectPort */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10932