From: Rose Hellsing <rose@pinkro.se> On native Windows WoW64, 32-bit applications seemingly use the 64-bit LPC_MESSAGE structure layout directly, so the wrappers just pass through the pointers. Also fix NtReplyWaitReceivePortEx to use msg->DataSize as the receive buffer size instead of a hardcoded value. --- dlls/ntdll/tests/port.c | 7 ++----- dlls/ntdll/unix/sync.c | 2 +- dlls/wow64/sync.c | 34 +++++++++++++++++++--------------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/dlls/ntdll/tests/port.c b/dlls/ntdll/tests/port.c index 80c60d09683..302e766da4e 100644 --- a/dlls/ntdll/tests/port.c +++ b/dlls/ntdll/tests/port.c @@ -239,7 +239,7 @@ static DWORD WINAPI test_ports_client(LPVOID arg) sqos.EffectiveOnly = TRUE; status = pNtConnectPort(&PortHandle, &port, &sqos, 0, 0, &len, NULL, NULL); - todo_wine ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %lx\n", status); + ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %lx\n", status); if (status != STATUS_SUCCESS) return 1; status = pNtRegisterThreadTerminatePort(PortHandle); @@ -322,10 +322,7 @@ static void test_ports_server( HANDLE PortHandle ) while (TRUE) { status = pNtReplyWaitReceivePort(PortHandle, NULL, NULL, &LpcMessage->msg); - todo_wine - { - ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %ld(%lx)\n", status, status); - } + ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %ld(%lx)\n", status, status); /* STATUS_INVALID_HANDLE: win2k without admin rights will perform an * endless loop here */ diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 48a564545d9..48d7bc6041a 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -3529,7 +3529,7 @@ NTSTATUS WINAPI NtReplyWaitReceivePortEx( HANDLE handle, ULONG *id, LPC_MESSAGE { /* Use a reasonable max size for LPC message data. * sizeof(msg->Data) is just 1 due to ANYSIZE_ARRAY. */ - wine_server_set_reply( req, msg->Data, 0x1000 ); + wine_server_set_reply( req, msg->Data, msg->DataSize ); } ret = wine_server_call( req ); if (!ret && msg) diff --git a/dlls/wow64/sync.c b/dlls/wow64/sync.c index b083d63253e..a0633cfccae 100644 --- a/dlls/wow64/sync.c +++ b/dlls/wow64/sync.c @@ -140,8 +140,12 @@ NTSTATUS WINAPI wow64_NtAcceptConnectPort( UINT *args ) LPC_SECTION_WRITE *write = get_ptr( &args ); LPC_SECTION_READ *read = get_ptr( &args ); - FIXME( "%p %lu %p %u %p %p: stub\n", handle_ptr, id, msg, accept, write, read ); - return STATUS_NOT_IMPLEMENTED; + HANDLE handle = 0; + NTSTATUS status; + + status = NtAcceptConnectPort( &handle, id, msg, accept, write, read ); + put_handle( handle_ptr, handle ); + return status; } @@ -205,9 +209,14 @@ NTSTATUS WINAPI wow64_NtConnectPort( UINT *args ) void *info = get_ptr( &args ); ULONG *info_len = get_ptr( &args ); - FIXME( "%p %p %p %p %p %p %p %p: stub\n", - handle_ptr, name32, qos, write, read, max_len, info, info_len ); - return STATUS_NOT_IMPLEMENTED; + UNICODE_STRING name; + HANDLE handle = 0; + NTSTATUS status; + + status = NtConnectPort( &handle, unicode_str_32to64( &name, name32 ), + qos, write, read, max_len, info, info_len ); + put_handle( handle_ptr, handle ); + return status; } @@ -561,8 +570,7 @@ NTSTATUS WINAPI wow64_NtListenPort( UINT *args ) HANDLE handle = get_handle( &args ); LPC_MESSAGE *msg = get_ptr( &args ); - FIXME( "%p %p: stub\n", handle, msg ); - return STATUS_NOT_IMPLEMENTED; + return NtListenPort( handle, msg ); } @@ -1316,8 +1324,7 @@ NTSTATUS WINAPI wow64_NtReplyPort( UINT *args ) HANDLE handle = get_handle( &args ); LPC_MESSAGE *reply = get_ptr( &args ); - FIXME( "%p %p: stub\n", handle, reply ); - return STATUS_NOT_IMPLEMENTED; + return NtReplyPort( handle, reply ); } @@ -1331,8 +1338,7 @@ NTSTATUS WINAPI wow64_NtReplyWaitReceivePort( UINT *args ) LPC_MESSAGE *reply = get_ptr( &args ); LPC_MESSAGE *msg = get_ptr( &args ); - FIXME( "%p %p %p %p: stub\n", handle, id, reply, msg ); - return STATUS_NOT_IMPLEMENTED; + return NtReplyWaitReceivePort( handle, id, reply, msg ); } @@ -1347,8 +1353,7 @@ NTSTATUS WINAPI wow64_NtReplyWaitReceivePortEx( UINT *args ) LPC_MESSAGE *msg = get_ptr( &args ); LARGE_INTEGER *timeout = get_ptr( &args ); - FIXME( "%p %p %p %p %p: stub\n", handle, id, reply, msg, timeout ); - return STATUS_NOT_IMPLEMENTED; + return NtReplyWaitReceivePortEx( handle, id, reply, msg, timeout ); } @@ -1373,8 +1378,7 @@ NTSTATUS WINAPI wow64_NtRequestWaitReplyPort( UINT *args ) LPC_MESSAGE *msg_in = get_ptr( &args ); LPC_MESSAGE *msg_out = get_ptr( &args ); - FIXME( "%p %p %p: stub\n", handle, msg_in, msg_out ); - return STATUS_NOT_IMPLEMENTED; + return NtRequestWaitReplyPort( handle, msg_in, msg_out ); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10611