mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
- Fix handling of cancelled IRPs
svn path=/branches/aicom-network-fixes/; revision=35481
This commit is contained in:
parent
6159e6d129
commit
9b492699af
3 changed files with 25 additions and 7 deletions
|
@ -87,15 +87,15 @@ static NTSTATUS NTAPI ListenComplete
|
|||
PAFD_FCB FCB = (PAFD_FCB)Context;
|
||||
PAFD_TDI_OBJECT_QELT Qelt;
|
||||
|
||||
if( Irp->Cancel ) {
|
||||
if( FCB ) FCB->ListenIrp.InFlightRequest = NULL;
|
||||
return STATUS_CANCELLED;
|
||||
}
|
||||
|
||||
if( !SocketAcquireStateLock( FCB ) ) return Status;
|
||||
|
||||
FCB->ListenIrp.InFlightRequest = NULL;
|
||||
|
||||
if( Irp->Cancel ) {
|
||||
SocketStateUnlock( FCB );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if( FCB->State == SOCKET_STATE_CLOSED ) {
|
||||
SocketStateUnlock( FCB );
|
||||
DestroySocket( FCB );
|
||||
|
|
|
@ -233,6 +233,11 @@ NTSTATUS NTAPI ReceiveComplete
|
|||
|
||||
ASSERT_IRQL(APC_LEVEL);
|
||||
|
||||
if( Irp->Cancel ) {
|
||||
if( FCB ) FCB->ReceiveIrp.InFlightRequest = NULL;
|
||||
return STATUS_CANCELLED;
|
||||
}
|
||||
|
||||
if( !SocketAcquireStateLock( FCB ) ) return Status;
|
||||
|
||||
FCB->ReceiveIrp.InFlightRequest = NULL;
|
||||
|
@ -448,12 +453,15 @@ PacketSocketRecvComplete(
|
|||
|
||||
AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB));
|
||||
|
||||
if( Irp->Cancel ) {
|
||||
if( FCB ) FCB->ReceiveIrp.InFlightRequest = NULL;
|
||||
return STATUS_CANCELLED;
|
||||
}
|
||||
|
||||
if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED;
|
||||
|
||||
FCB->ReceiveIrp.InFlightRequest = NULL;
|
||||
|
||||
if( !SocketAcquireStateLock( FCB ) ) return STATUS_UNSUCCESSFUL;
|
||||
|
||||
if( FCB->State == SOCKET_STATE_CLOSED ) {
|
||||
SocketStateUnlock( FCB );
|
||||
return STATUS_SUCCESS;
|
||||
|
|
|
@ -40,6 +40,11 @@ static NTSTATUS NTAPI SendComplete
|
|||
|
||||
ASSERT_IRQL(APC_LEVEL);
|
||||
|
||||
if( Irp->Cancel ) {
|
||||
if( FCB ) FCB->SendIrp.InFlightRequest = NULL;
|
||||
return STATUS_CANCELLED;
|
||||
}
|
||||
|
||||
if( !SocketAcquireStateLock( FCB ) ) return Status;
|
||||
|
||||
FCB->SendIrp.InFlightRequest = NULL;
|
||||
|
@ -169,6 +174,11 @@ static NTSTATUS NTAPI PacketSocketSendComplete
|
|||
Irp->IoStatus.Status,
|
||||
Irp->IoStatus.Information));
|
||||
|
||||
if( Irp->Cancel ) {
|
||||
if( FCB ) FCB->SendIrp.InFlightRequest = NULL;
|
||||
return STATUS_CANCELLED;
|
||||
}
|
||||
|
||||
/* It's ok if the FCB already died */
|
||||
if( !SocketAcquireStateLock( FCB ) ) return STATUS_SUCCESS;
|
||||
|
||||
|
|
Loading…
Reference in a new issue