diff --git a/reactos/drivers/network/tcpip/tcpip/dispatch.c b/reactos/drivers/network/tcpip/tcpip/dispatch.c index 6bc4cc4db77..75c1cfba41d 100644 --- a/reactos/drivers/network/tcpip/tcpip/dispatch.c +++ b/reactos/drivers/network/tcpip/tcpip/dispatch.c @@ -120,6 +120,7 @@ VOID NTAPI DispCancelRequest( PTRANSPORT_CONTEXT TranContext; PFILE_OBJECT FileObject; UCHAR MinorFunction; + PCONNECTION_ENDPOINT Connection; BOOLEAN DequeuedIrp = TRUE; IoReleaseCancelSpinLock(Irp->CancelIrql); @@ -171,7 +172,16 @@ VOID NTAPI DispCancelRequest( break; case TDI_DISCONNECT: + Connection = (PCONNECTION_ENDPOINT)TranContext->Handle.ConnectionContext; + DequeuedIrp = TCPRemoveIRP(TranContext->Handle.ConnectionContext, Irp); + if (DequeuedIrp) + { + if (KeCancelTimer(&Connection->DisconnectTimer)) + { + DereferenceObject(Connection); + } + } break; default: