From: Zebediah Figura zfigura@codeweavers.com
--- 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 9d51fef1adb..3171f0cd5ca 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -3584,7 +3584,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 d777be96df3..c652534890c 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -5602,7 +5602,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),