By calling IoCancelIrp, you are telling the driver currently owning the IRP that you wish to cancel it. It is up to the owning driver what it does with such an IRP. Eventually, it should complete it with STATUS_CANCELLED (or some other error status), so your completion routine is called (if you instructed the system to invoke it also on cancelled IRPs). So, nothing should change for you here.
The cancel routine may be registered only by the driver that currently owns the IRP. For example, such a driver stores the IRP in a queue where it waits for being serviced. The cancel operation may be implemented as removing the IRP from the queue and completing it with STATUS_CANCELLED.
To determine whether an IRP is cancelled, you may check its Cancel field.
The cancel routine may be registered only by the driver that currently owns the IRP. For example, such a driver stores the IRP in a queue where it waits for being serviced. The cancel operation may be implemented as removing the IRP from the queue and completing it with STATUS_CANCELLED.
To determine whether an IRP is cancelled, you may check its Cancel field.