Signed-off-by: Zebediah Figura z.figura12@gmail.com --- This adds a test failure. However, this failure reflects an improvement in Wine, as we no longer incorrectly report that the following recv() call will succeed.
Moreover, it prevents a test failure that would otherwise be introduced with the following patch.
dlls/ws2_32/socket.c | 12 ++++++------ dlls/ws2_32/tests/sock.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 3a8bfa0ce41..0a23b44cc68 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2110,14 +2110,14 @@ static NTSTATUS WS2_async_recv( void *user, IO_STATUS_BLOCK *iosb, NTSTATUS stat if (result >= 0) { status = STATUS_SUCCESS; - _enable_event( wsa->hSocket, FD_READ, 0, 0 ); + _enable_event( wsa->hSocket, (wsa->flags & WS_MSG_OOB) ? FD_OOB : FD_READ, 0, 0 ); } else { if (errno == EAGAIN) { status = STATUS_PENDING; - _enable_event( wsa->hSocket, FD_READ, 0, 0 ); + _enable_event( wsa->hSocket, (wsa->flags & WS_MSG_OOB) ? FD_OOB : FD_READ, 0, 0 ); } else { @@ -6180,7 +6180,7 @@ static int WS2_recv_base( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, } else NtQueueApcThread( GetCurrentThread(), (PNTAPCFUNC)ws2_async_apc, (ULONG_PTR)wsa, (ULONG_PTR)iosb, 0 ); - _enable_event(SOCKET2HANDLE(s), FD_READ, 0, 0); + _enable_event(SOCKET2HANDLE(s), (wsa->flags & WS_MSG_OOB) ? FD_OOB : FD_READ, 0, 0); return 0; }
@@ -6209,13 +6209,13 @@ static int WS2_recv_base( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, { err = WSAETIMEDOUT; /* a timeout is not fatal */ - _enable_event(SOCKET2HANDLE(s), FD_READ, 0, 0); + _enable_event(SOCKET2HANDLE(s), (wsa->flags & WS_MSG_OOB) ? FD_OOB : FD_READ, 0, 0); goto error; } } else { - _enable_event(SOCKET2HANDLE(s), FD_READ, 0, 0); + _enable_event(SOCKET2HANDLE(s), (wsa->flags & WS_MSG_OOB) ? FD_OOB : FD_READ, 0, 0); err = WSAEWOULDBLOCK; goto error; } @@ -6224,7 +6224,7 @@ static int WS2_recv_base( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, TRACE(" -> %i bytes\n", n); if (wsa != &localwsa) HeapFree( GetProcessHeap(), 0, wsa ); release_sock_fd( s, fd ); - _enable_event(SOCKET2HANDLE(s), FD_READ, 0, 0); + _enable_event(SOCKET2HANDLE(s), (wsa->flags & WS_MSG_OOB) ? FD_OOB : FD_READ, 0, 0); SetLastError(ERROR_SUCCESS);
return 0; diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 1732c9bf3ee..596e1ec1a21 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -4413,7 +4413,7 @@ static void test_oob_events(struct event_test_ctx *ctx) ret = recv(server, buffer, 1, MSG_OOB); ok(ret == 1, "got %d\n", ret);
- check_events_todo_msg(ctx, FD_OOB, 0, 200); + check_events_todo(ctx, FD_OOB, 0, 200); check_events_todo_msg(ctx, 0, 0, 0);
ret = recv(server, buffer, 1, MSG_OOB);