Hello,
I have a problem: whenever I set an IRP as pending in my
IRP_MJ_DEVICE_CONTROL dispatch function, the I/O Manager cancels it juste
after (and then calls the cancellation routine). I don’t understand why.
Any help would be welcome. Here is my code:
KIRQL CancelIrql;
Irp->IoStatus.Status=STATUS_PENDING;
IoAcquireCancelSpinLock(&CancelIrql);
IoSetCancelRoutine(Irp,CancelWaitingIrp);
InsertTailList(&Extension->WaitingQueue, &Irp->Tail.Overlay.ListEntry);
IoReleaseCancelSpinLock(CancelIrql);
IoMarkIrpPending(Irp);
return STATUS_PENDING;