- Remove the STATUS_PENDING case in UnlockAndMaybeComplete so we can catch pending IRPs which didn't get queued in the PendingIrpList

svn path=/trunk/; revision=43297
This commit is contained in:
Cameron Gutman 2009-10-05 02:31:16 +00:00
parent 29eda3e5dc
commit 605efdf3f2

View file

@ -290,22 +290,12 @@ VOID SocketStateUnlock( PAFD_FCB FCB ) {
NTSTATUS NTAPI UnlockAndMaybeComplete NTSTATUS NTAPI UnlockAndMaybeComplete
( PAFD_FCB FCB, NTSTATUS Status, PIRP Irp, ( PAFD_FCB FCB, NTSTATUS Status, PIRP Irp,
UINT Information ) { UINT Information ) {
Irp->IoStatus.Status = Status; Irp->IoStatus.Status = Status;
Irp->IoStatus.Information = Information; Irp->IoStatus.Information = Information;
if ( Irp->MdlAddress ) UnlockRequest( Irp, IoGetCurrentIrpStackLocation( Irp ) );
if( Status == STATUS_PENDING ) { (void)IoSetCancelRoutine(Irp, NULL);
/* We should firstly mark this IRP as pending, because SocketStateUnlock( FCB );
otherwise it may be completed by StreamSocketConnectComplete() IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
before we return from SocketStateUnlock(). */
IoMarkIrpPending( Irp );
SocketStateUnlock( FCB );
} else {
if ( Irp->MdlAddress ) UnlockRequest( Irp, IoGetCurrentIrpStackLocation( Irp ) );
(void)IoSetCancelRoutine(Irp, NULL);
SocketStateUnlock( FCB );
IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
}
return Status; return Status;
} }
@ -325,5 +315,6 @@ NTSTATUS LeaveIrpUntilLater( PAFD_FCB FCB, PIRP Irp, UINT Function ) {
&Irp->Tail.Overlay.ListEntry ); &Irp->Tail.Overlay.ListEntry );
IoMarkIrpPending(Irp); IoMarkIrpPending(Irp);
(void)IoSetCancelRoutine(Irp, AfdCancelHandler); (void)IoSetCancelRoutine(Irp, AfdCancelHandler);
return UnlockAndMaybeComplete( FCB, STATUS_PENDING, Irp, 0 ); SocketStateUnlock( FCB );
return STATUS_PENDING;
} }