When explaining IO_REMOVE_LOCK and how to use it, Walter Oney says in
his book:
"Whenever you receive an I/O request ***that you plan to forward down
the stack***, you call IoAcquireRemoveLock."
I even found a post that emphasizes this issue even more:
http://tinyurl.com/277aqn
In which he clarifies:
"Claim the remove lock ***before passing an IRP down the PnP stack***,
and release it when the IRP completes. It's not necessary to use the
lock for an IRP that you don't pass down."
and continues:
"What you're really doing with the remove lock is making sure you
don't call IoDetachDevice and don't return from your
IRP_MN_REMOVE_DEVICE handler while ***the lower driver*** is
processing an IRP you've sent it."
(the "***" are my own emphasis)
OK - so I understand that calling IoAcquireRemoveLock is not necessary
in every type of IRP handling but rather only for those that are
"passed down the PnP stack".
However, I am unsure what "pass IRP down the PnP stack" means in the
context of PortCls (see diagram):
http://msdn2.microsoft.com/en-us/library/ms790577.aspx
Specifically, when I call PcDispatchIrp(), does that constitute "pass
IRP down the PnP stack"?
And what is "the PnP stack" in this context? I know what an "IRP
stack" is, but this is the first time I encounter the term "PnP
stack". Could that have been a typo (in Mr. Oney's reply)?
Thanks,
Don