diff --git "a/modules/rostests/winetests/ws2_32/sock.c" "b/modules/rostests/winetests/ws2_32/sock.c" index 48e08eee6f1..c7840e78c96 100644 --- "a/modules/rostests/winetests/ws2_32/sock.c" +++ "b/modules/rostests/winetests/ws2_32/sock.c" @@ -6929,7 +6929,7 @@ struct write_watch_thread_args DWORD size; const char *expect; }; - +#ifndef __REACTOS__ // test_write_watch/write_watch_thread causes ReactOS hang static DWORD CALLBACK write_watch_thread( void *arg ) { struct write_watch_thread_args *args = arg; @@ -7109,7 +7109,7 @@ static void test_write_watch(void) closesocket( src ); VirtualFree( base, 0, MEM_FREE ); } - +#endif // test_write_watch/write_watch_thread #define POLL_CLEAR() ix = 0 #define POLL_SET(s, ev) {fds[ix].fd = s; fds[ix++].events = ev;} #define POLL_ISSET(s, rev) poll_isset(fds, ix, s, rev) @@ -8011,7 +8011,7 @@ static void test_getaddrinfo(void) } } } - +#ifndef __REACTOS__ // test_ConnectEx causes ReactOS to hang static void test_ConnectEx(void) { SOCKET listener = INVALID_SOCKET; @@ -8222,7 +8222,7 @@ end: if (connector != INVALID_SOCKET) closesocket(connector); } - +#endif // test_ConnectEx static void test_AcceptEx(void) { SOCKET listener = INVALID_SOCKET; @@ -11609,7 +11609,9 @@ START_TEST( sock ) test_WSASendTo(); test_WSARecv(); test_WSAPoll(); +#ifndef __REACTOS__ // Skip ReactOS hanging test test_write_watch(); +#endif test_iocp(); test_events(0); @@ -11621,7 +11623,9 @@ START_TEST( sock ) test_GetAddrInfoExW(); test_getaddrinfo(); test_AcceptEx(); +#ifndef __REACTOS__ // Skip ReactOS hanging test test_ConnectEx(); +#endif test_DisconnectEx(); test_sioRoutingInterfaceQuery(); From dd9dce0ec33e1b7f9c4e38cc591863b3e02131c9 Mon Sep 17 00:00:00 2001 From: Thamatip Chitpong Date: Sun, 1 Jan 2023 22:37:20 +0700 Subject: [PATCH] [AFD] ReceiveActivity: Don't return STATUS_FILE_CLOSED in case of FCB overread Based on patch by KRosUser CORE-18328 --- drivers/network/afd/afd/read.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/network/afd/afd/read.c b/drivers/network/afd/afd/read.c index eb9b3019325a..624885b9f4ce 100644 --- a/drivers/network/afd/afd/read.c +++ b/drivers/network/afd/afd/read.c @@ -177,14 +177,16 @@ static NTSTATUS ReceiveActivity( PAFD_FCB FCB, PIRP Irp ) { RecvReq->BufferCount, FALSE ); if (FCB->Overread && FCB->LastReceiveStatus == STATUS_SUCCESS) { - /* Overread after a graceful disconnect so complete with an error */ - Status = STATUS_FILE_CLOSED; - } - else - { - /* Unexpected disconnect by the remote host or initial read after a graceful disconnect */ - Status = FCB->LastReceiveStatus; + /* Overread after a graceful disconnect */ + AFD_DbgPrint(MID_TRACE,("FCB overread detected\n")); } + + /* Overread shall not lead to situation of "ECONNRESET" errors + * See CORE-18328 and CORE-11650 */ + + /* Unexpected disconnect by the remote host or initial read after a graceful disconnect */ + Status = FCB->LastReceiveStatus; + NextIrp->IoStatus.Status = Status; NextIrp->IoStatus.Information = 0; if( NextIrp == Irp ) RetStatus = Status;