Module: wine Branch: master Commit: a56e0ba4d401f4ec86dae51e2c7a9178156c86fe URL: https://gitlab.winehq.org/wine/wine/-/commit/a56e0ba4d401f4ec86dae51e2c7a917...
Author: Paul Gofman pgofman@codeweavers.com Date: Fri May 26 20:37:56 2023 -0600
ws2_32: Test wait alertability in WSAGetOverlappedResult().
---
dlls/ws2_32/tests/sock.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index b47922c645a..cff4acb0b3c 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -12657,6 +12657,20 @@ static void test_WSAGetOverlappedResult(void) } }
+ overlapped.Internal = STATUS_PENDING; + overlapped.hEvent = CreateEventW(NULL, TRUE, TRUE, NULL); + + apc_count = 0; + ret = QueueUserAPC(apc_func, GetCurrentThread(), (ULONG_PTR)&apc_count); + ok(ret, "QueueUserAPC returned %d\n", ret); + ret = WSAGetOverlappedResult(s, &overlapped, &size, TRUE, &flags); + ok(ret && (GetLastError() == ERROR_IO_PENDING || !WSAGetLastError()), + "Got ret %d, err %lu.\n", ret, GetLastError()); + ok(!apc_count, "got apc_count %d.\n", apc_count); + SleepEx(0, TRUE); + ok(apc_count == 1, "got apc_count %d.\n", apc_count); + + CloseHandle(overlapped.hEvent); closesocket(s); }