From: Rose Hellsing <rose@pinkro.se> This copies the test for NtCreatePort, creating a port with name MyWPort instead of MyPort. --- dlls/ntdll/tests/port.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/tests/port.c b/dlls/ntdll/tests/port.c index 80c60d09683..9a18e050daf 100644 --- a/dlls/ntdll/tests/port.c +++ b/dlls/ntdll/tests/port.c @@ -102,6 +102,7 @@ union lpc_message #define LPC_CONNECTION_REQUEST 10 static const WCHAR PORTNAME[] = {'\\','M','y','P','o','r','t',0}; +static const WCHAR WAITABLEPORTNAME[] = {'\\','M','y','W','P','o','r','t',0}; #define REQUEST1 "Request1" #define REQUEST2 "Request2" @@ -120,6 +121,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 +146,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 +154,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 +390,25 @@ 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); + } + + pRtlInitUnicodeString(&port, WAITABLEPORTNAME); + + obj.ObjectName = &port; + + 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