Skip to content

Commit

Permalink
Unset IRP cancel routine on device unplug. Detected by Driver Verifie…
Browse files Browse the repository at this point in the history
…r. Fix courtesy of Tim Edmonds.
  • Loading branch information
cpeacock committed Apr 3, 2012
1 parent 085e5ae commit 776521b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions driver/pnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,7 @@ void complete_pending_read_irp(PPDO_DEVICE_DATA pdodata)
if(NULL==irp)
return;
irp->IoStatus.Status = STATUS_DEVICE_NOT_CONNECTED;
IoSetCancelRoutine(irp, NULL);
IoCompleteRequest (irp, IO_NO_INCREMENT);
return;
}
Expand Down Expand Up @@ -1029,6 +1030,7 @@ void complete_pending_irp(PPDO_DEVICE_DATA pdodata)
}
ExFreeToNPagedLookasideList(&g_lookaside, urb_r);
irp->IoStatus.Status = STATUS_DEVICE_NOT_CONNECTED;
IoSetCancelRoutine(irp, NULL);
IoCompleteRequest (irp, IO_NO_INCREMENT);
count++;
}while(1);
Expand Down

0 comments on commit 776521b

Please sign in to comment.