Zebediah Figura : ws2_32/tests: Test polling for AFD_POLL_CONNECT with UDP sockets.
Alexandre Julliard
julliard at winehq.org
Tue Jul 19 15:55:01 CDT 2022
Module: wine
Branch: master
Commit: 568a715378c6afca2b0999a42f7a3705ab486f6a
URL: https://gitlab.winehq.org/wine/wine/-/commit/568a715378c6afca2b0999a42f7a3705ab486f6a
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Sun May 29 17:19:14 2022 -0500
ws2_32/tests: Test polling for AFD_POLL_CONNECT with UDP sockets.
---
dlls/ws2_32/tests/afd.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/dlls/ws2_32/tests/afd.c b/dlls/ws2_32/tests/afd.c
index 334c2c41be6..f2dccd465a3 100644
--- a/dlls/ws2_32/tests/afd.c
+++ b/dlls/ws2_32/tests/afd.c
@@ -829,6 +829,37 @@ static void test_poll(void)
ok(out_params->sockets[0].flags == AFD_POLL_READ, "got flags %#x\n", out_params->sockets[0].flags);
ok(!out_params->sockets[0].status, "got status %#x\n", out_params->sockets[0].status);
+ in_params->timeout = -1000 * 10000;
+ in_params->count = 1;
+ in_params->sockets[0].socket = server;
+ in_params->sockets[0].flags = AFD_POLL_CONNECT;
+ params_size = offsetof(struct afd_poll_params, sockets[1]);
+
+ ret = NtDeviceIoControlFile((HANDLE)server, event, NULL, NULL, &io,
+ IOCTL_AFD_POLL, in_params, params_size, out_params, params_size);
+ ok(ret == STATUS_PENDING, "got %#x\n", ret);
+
+ ret = connect(server, (struct sockaddr *)&addr, sizeof(addr));
+ ok(!ret, "got error %lu\n", GetLastError());
+
+ ret = WaitForSingleObject(event, 100);
+ todo_wine ok(!ret, "got %#x\n", ret);
+ if (!ret)
+ {
+ ok(!io.Status, "got %#lx\n", io.Status);
+ ok(io.Information == offsetof(struct afd_poll_params, sockets[1]), "got %#Ix\n", io.Information);
+ ok(out_params->count == 1, "got count %u\n", out_params->count);
+ ok(out_params->sockets[0].socket == server, "got socket %#Ix\n", out_params->sockets[0].socket);
+ ok(out_params->sockets[0].flags == AFD_POLL_CONNECT, "got flags %#x\n", out_params->sockets[0].flags);
+ ok(!out_params->sockets[0].status, "got status %#x\n", out_params->sockets[0].status);
+ }
+ else
+ {
+ CancelIo((HANDLE)server);
+ ret = WaitForSingleObject(event, 100);
+ ok(!ret, "wait timed out\n");
+ }
+
closesocket(client);
closesocket(server);
More information about the wine-cvs
mailing list