Author: cgutman
Date: Mon Aug 1 03:54:19 2011
New Revision: 53016
URL:
http://svn.reactos.org/svn/reactos?rev=53016&view=rev
Log:
[AFD]
- Cancel the in-flight disconnect IRP during socket closure
[TCPIP]
- Make a disconnect IRP cancelable
Modified:
trunk/reactos/drivers/network/afd/afd/main.c
trunk/reactos/drivers/network/afd/include/afd.h
trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c
Modified: trunk/reactos/drivers/network/afd/afd/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/ma…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] Mon Aug 1 03:54:19 2011
@@ -436,6 +436,7 @@
InFlightRequest[1] = &FCB->ReceiveIrp;
InFlightRequest[2] = &FCB->SendIrp;
InFlightRequest[3] = &FCB->ConnectIrp;
+ InFlightRequest[4] = &FCB->DisconnectIrp;
/* Cancel our pending requests */
for( i = 0; i < IN_FLIGHT_REQUESTS; i++ ) {
Modified: trunk/reactos/drivers/network/afd/include/afd.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/includ…
==============================================================================
--- trunk/reactos/drivers/network/afd/include/afd.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/include/afd.h [iso-8859-1] Mon Aug 1 03:54:19 2011
@@ -108,7 +108,7 @@
#define FUNCTION_CLOSE 6
#define MAX_FUNCTIONS 7
-#define IN_FLIGHT_REQUESTS 4
+#define IN_FLIGHT_REQUESTS 5
#define EXTRA_LOCK_BUFFERS 2 /* Number of extra buffers needed
* for ancillary data on packet
Modified: trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Mon Aug 1 03:54:19
2011
@@ -543,15 +543,22 @@
Status = STATUS_INVALID_PARAMETER;
goto done;
}
-
- Status = TCPDisconnect(
- TranContext->Handle.ConnectionContext,
- DisReq->RequestFlags,
- DisReq->RequestSpecific,
- DisReq->RequestConnectionInformation,
- DisReq->ReturnConnectionInformation,
- DispDataRequestComplete,
- Irp );
+
+ Status = DispPrepareIrpForCancel
+ (TranContext->Handle.ConnectionContext,
+ Irp,
+ (PDRIVER_CANCEL)DispCancelRequest);
+
+ if (NT_SUCCESS(Status))
+ {
+ Status = TCPDisconnect(TranContext->Handle.ConnectionContext,
+ DisReq->RequestFlags,
+ DisReq->RequestSpecific,
+ DisReq->RequestConnectionInformation,
+ DisReq->ReturnConnectionInformation,
+ DispDataRequestComplete,
+ Irp);
+ }
done:
if (Status != STATUS_PENDING) {