Module: wine Branch: master Commit: 98cdd828b64ba0b30eddba3950a1005d3468544b URL: https://gitlab.winehq.org/wine/wine/-/commit/98cdd828b64ba0b30eddba3950a1005...
Author: Paul Gofman pgofman@codeweavers.com Date: Fri May 26 20:36:53 2023 -0600
ws2_32: Make wait in WSAPoll() alertable.
---
dlls/ws2_32/socket.c | 2 +- dlls/ws2_32/tests/sock.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 267830cc88c..710ec8cbb26 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2994,7 +2994,7 @@ int WINAPI WSAPoll( WSAPOLLFD *fds, ULONG count, int timeout ) params, params_size, params, params_size ); if (status == STATUS_PENDING) { - if (WaitForSingleObject( sync_event, INFINITE ) == WAIT_FAILED) + if (wait_event_alertable( sync_event ) == WAIT_FAILED) { free( params ); return -1; diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 31e9baf31c8..b47922c645a 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -8122,7 +8122,11 @@ static void test_WSAPoll(void) fds[0].fd = client; fds[0].events = POLLRDNORM | POLLRDBAND; fds[0].revents = 0xdead; + apc_count = 0; + ret = QueueUserAPC(apc_func, GetCurrentThread(), (ULONG_PTR)&apc_count); + ok(ret, "QueueUserAPC returned %d\n", ret); ret = pWSAPoll(fds, 1, 2000); + ok(apc_count == 1, "APC was called %u times\n", apc_count); ok(ret == 1, "got %d\n", ret); ok(fds[0].revents == POLLNVAL, "got events %#x\n", fds[0].revents); ret = WaitForSingleObject(thread_handle, 1000);