Module: wine Branch: master Commit: 1975398bd154be8ef677142902627caafc49b58d URL: https://gitlab.winehq.org/wine/wine/-/commit/1975398bd154be8ef677142902627ca...
Author: Zebediah Figura zfigura@codeweavers.com Date: Thu Jul 21 19:56:28 2022 -0500
ws2_32: Translate AFD_POLL_RESET to FD_CLOSE plus WSAECONNABORTED in WSAEnumNetworkEvents().
---
dlls/ws2_32/socket.c | 5 ++++- dlls/ws2_32/tests/sock.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 9da3ccb285f..6aab249a1b8 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -3629,7 +3629,10 @@ int WINAPI WSAEnumNetworkEvents( SOCKET s, WSAEVENT event, WSANETWORKEVENTS *ret if (ret_events->lNetworkEvents & FD_CLOSE) { if (!(ret_events->iErrorCode[FD_CLOSE_BIT] = NtStatusToWSAError( params.status[AFD_POLL_BIT_HUP] ))) - ret_events->iErrorCode[FD_CLOSE_BIT] = NtStatusToWSAError( params.status[AFD_POLL_BIT_RESET] ); + { + if (params.flags & AFD_POLL_RESET) + ret_events->iErrorCode[FD_CLOSE_BIT] = WSAECONNABORTED; + } } } SetLastError( NtStatusToWSAError( status ) ); diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 73eaeab734a..c2345c1fa60 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -6290,7 +6290,7 @@ static void check_events_(int line, struct event_test_ctx *ctx, for (i = 0; i < ARRAY_SIZE(events.iErrorCode); ++i) { if ((1u << i) == LOWORD(flag1) && (events.lNetworkEvents & LOWORD(flag1))) - todo_wine_if (HIWORD(flag1)) ok_(__FILE__, line)(events.iErrorCode[i] == HIWORD(flag1), + ok_(__FILE__, line)(events.iErrorCode[i] == HIWORD(flag1), "got error code %d for event %#x\n", events.iErrorCode[i], 1u << i); if ((1u << i) == LOWORD(flag2) && (events.lNetworkEvents & LOWORD(flag2))) ok_(__FILE__, line)(events.iErrorCode[i] == HIWORD(flag2),