From: Paul Gofman pgofman@codeweavers.com
--- 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 70618408e90..ff2364b9d1d 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -8127,7 +8127,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);