- Always set Irp->IoStatus.Status

- Clear the cancel routine only when completing

svn path=/branches/aicom-network-fixes/; revision=35340
This commit is contained in:
Cameron Gutman 2008-08-14 15:14:32 +00:00
parent e8c5f099c5
commit 5cf6890ee7

View file

@ -27,14 +27,14 @@ NTSTATUS IRPFinish( PIRP Irp, NTSTATUS Status ) {
UntrackFL( __FILE__, __LINE__, Irp ); UntrackFL( __FILE__, __LINE__, Irp );
#endif #endif
(void)IoSetCancelRoutine( Irp, NULL ); Irp->IoStatus.Status = Status;
if( Status == STATUS_PENDING ) if( Status == STATUS_PENDING )
IoMarkIrpPending( Irp ); IoMarkIrpPending( Irp );
else { else {
Irp->IoStatus.Status = Status;
Irql = KeGetCurrentIrql(); Irql = KeGetCurrentIrql();
(void)IoSetCancelRoutine( Irp, NULL );
IoCompleteRequest( Irp, IO_NETWORK_INCREMENT ); IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
if (KeGetCurrentIrql() != Irql) { if (KeGetCurrentIrql() != Irql) {
DbgPrint("WARNING: IO COMPLETION RETURNED AT WRONG IRQL:\n"); DbgPrint("WARNING: IO COMPLETION RETURNED AT WRONG IRQL:\n");