From 74560c1d3995ac75eb2a6db46dfcd06018dd1f05 Mon Sep 17 00:00:00 2001 From: Erich Hoover Date: Mon, 30 Apr 2012 21:14:18 -0600 Subject: [PATCH] ws2_32/tests: Test for IOCP behavior without AcceptEx call. --- dlls/ws2_32/tests/sock.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index f2e988ea87f..b71be34af15 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -5717,6 +5717,30 @@ static void test_completion_port(void) ok(num_bytes == 0xdeadbeef, "Number of bytes transferred is %u\n", num_bytes); ok(!olp, "Overlapped structure is at %p\n", olp); + /* Test IOCP without AcceptEx */ + + if ((src = setup_iocp_src(&bindAddress)) == INVALID_SOCKET) + goto end; + + SetLastError(0xdeadbeef); + + io_port = CreateIoCompletionPort((HANDLE)src, previous_port, 125, 0); + ok(io_port != NULL, "failed to create completion port %u\n", GetLastError()); + + closesocket(src); + src = INVALID_SOCKET; + + SetLastError(0xdeadbeef); + key = 0xdeadbeef; + num_bytes = 0xdeadbeef; + olp = (WSAOVERLAPPED *)0xdeadbeef; + bret = GetQueuedCompletionStatus( io_port, &num_bytes, &key, &olp, 200 ); + ok(bret == FALSE, "failed to get completion status %u\n", bret); + ok(GetLastError() == WAIT_TIMEOUT, "Last error was %d\n", GetLastError()); + ok(key == 0xdeadbeef, "Key is %lu\n", key); + ok(num_bytes == 0xdeadbeef, "Number of bytes transferred is %u\n", num_bytes); + ok(!olp, "Overlapped structure is at %p\n", olp); + /* */ if ((src = setup_iocp_src(&bindAddress)) == INVALID_SOCKET) -- 2.11.4.GIT