Tech Support > Microsoft Windows > Drivers > What to do with RemoveLock if Irp is Canceled?
What to do with RemoveLock if Irp is Canceled?
Posted by Dennis Burns on October 16th, 2004


I create an Irp (and an associated Urb). Before passing Irp/Urb down the
stack, I set a completion routine and I acquire a RemoveLock with
IoAcquireRemoveLock. I release the lock in the completion routine with
IoReleaseRemoveLock.
But there are situations when I'd like to cancel the Irp. If I do, how can I
be sure that the lock is released? Is the reference to the lock
automatically removed if the Irp is canceled?

By the way, I use Oney's generic.sys as a base, which does initialize the
RemoveLock. I don't know if it does anything special to release "orphan"
locks.

Thanks in advance,
Dennis


Posted by Alexander Grigoriev on October 16th, 2004


If you cancel the IRP, its completion routine will be eventually called.

"Dennis Burns" <dburns@rtessentials.com> wrote in message
news:OIpnE54sEHA.3580@TK2MSFTNGP10.phx.gbl...


Posted by Dennis Burns on October 16th, 2004


Hello Alexander,
Thanks for the help,
Dennis

"Alexander Grigoriev" <alegr@earthlink.net> wrote in message
news:u6XOAh5sEHA.1216@TK2MSFTNGP10.phx.gbl...



Similar Posts