From: Rose Hellsing <rose@pinkro.se> This just copies the test for NtCreatePort, but still useful to have. --- dlls/ntdll/tests/port.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/tests/port.c b/dlls/ntdll/tests/port.c index 80c60d09683..14f04873767 100644 --- a/dlls/ntdll/tests/port.c +++ b/dlls/ntdll/tests/port.c @@ -120,6 +120,7 @@ static NTSTATUS (WINAPI *pNtReplyPort)(HANDLE,PLPC_MESSAGE); static NTSTATUS (WINAPI *pNtReplyWaitReceivePort)(PHANDLE,PULONG,PLPC_MESSAGE, PLPC_MESSAGE); static NTSTATUS (WINAPI *pNtCreatePort)(PHANDLE,POBJECT_ATTRIBUTES,ULONG,ULONG,ULONG); +static NTSTATUS (WINAPI *pNtCreateWaitablePort)(PHANDLE,POBJECT_ATTRIBUTES,ULONG,ULONG,ULONG); static NTSTATUS (WINAPI *pNtRequestWaitReplyPort)(HANDLE,PLPC_MESSAGE,PLPC_MESSAGE); static NTSTATUS (WINAPI *pNtRequestPort)(HANDLE,PLPC_MESSAGE); static NTSTATUS (WINAPI *pNtRegisterThreadTerminatePort)(HANDLE); @@ -144,6 +145,7 @@ static BOOL init_function_ptrs(void) pNtReplyPort = (void *)GetProcAddress(hntdll, "NtReplyPort"); pNtReplyWaitReceivePort = (void *)GetProcAddress(hntdll, "NtReplyWaitReceivePort"); pNtCreatePort = (void *)GetProcAddress(hntdll, "NtCreatePort"); + pNtCreateWaitablePort = (void *)GetProcAddress(hntdll, "NtCreateWaitablePort"); pNtRequestWaitReplyPort = (void *)GetProcAddress(hntdll, "NtRequestWaitReplyPort"); pNtRequestPort = (void *)GetProcAddress(hntdll, "NtRequestPort"); pNtRegisterThreadTerminatePort = (void *)GetProcAddress(hntdll, "NtRegisterThreadTerminatePort"); @@ -151,7 +153,8 @@ static BOOL init_function_ptrs(void) pRtlInitUnicodeString = (void *)GetProcAddress(hntdll, "RtlInitUnicodeString"); if (!pNtCompleteConnectPort || !pNtAcceptConnectPort || - !pNtReplyWaitReceivePort || !pNtCreatePort || !pNtRequestWaitReplyPort || + !pNtReplyWaitReceivePort || !pNtCreatePort || + !pNtCreateWaitablePort || !pNtRequestWaitReplyPort || !pNtRequestPort || !pNtRegisterThreadTerminatePort || !pNtConnectPort || !pRtlInitUnicodeString) { @@ -386,6 +389,21 @@ START_TEST(port) if (status == STATUS_ACCESS_DENIED) skip("Not enough rights\n"); else ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %ld\n", status); + if (status == STATUS_SUCCESS) + { + DWORD id; + HANDLE thread = CreateThread(NULL, 0, test_ports_client, NULL, 0, &id); + ok(thread != NULL, "Expected non-NULL thread handle!\n"); + + test_ports_server( port_handle ); + ok( WaitForSingleObject( thread, 10000 ) == 0, "thread didn't exit\n" ); + CloseHandle(thread); + } + + status = pNtCreateWaitablePort(&port_handle, &obj, 100, 100, 0); + if (status == STATUS_ACCESS_DENIED) skip("Not enough rights\n"); + else ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08lx\n", status); + if (status == STATUS_SUCCESS) { DWORD id; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10571