- IRQL / Multitasking
- Posted by David on December 4th, 2003
Question I can't find a straight answer to...
If I'm running at DISPATCH_LEVEL (in a filter driver) and decide to create
several irp's via IoBuildAsynchronousFsdRequest, setup a completion
routine), send it down via IoCallDriver -- Is it at all possible that those
requests could be serviced at all *before* I return from the dispatch
routine returning STATUS_PENDING ?? (Even on multi-processor machines?)
The concern being I need to release the original IRP when a counter setup in
the original irp (passed to completion routine) is decremented to zero and
don't want to add one have it complete before I add the next ones (if there
was a next one).
TIA!!
- Posted by Calvin Guan on December 4th, 2003
"David" <xx70751.3507@compuserve.cxx> wrote in message
news:O35T#6ruDHA.2072@TK2MSFTNGP10.phx.gbl...
You can't make such assumption.
This can happen, especially for interrupt-driven device on MP system
because the interrupt for the IO might have fired, DPC then executing on the
CPU_B and had completed the IRP before CPU_A returning STATUS_PENDING from
its dispatch routine.
For UP system, I think it wouldn't happen since you are at DISPATCH_LEVEL
and the DpcForIsr won't get executed until the IRQL is about to drop below
DISPATCH_LEVEL. (well, unless the IRP is complete in ISR, but that's simply
wrong.)
--
Calvin Guan, Software Engineer cguan@nospam.ati.com
ATI Technologies Inc. Tel: (905) 882-2600 Ext. 8654
- Posted by Ray Trent on December 4th, 2003
I'm not 100% sure I understand your question, but yes, IRPs can be
processed before you return from your dispatch routine. In fact, that's
normally what will happen. Calling IoCallDriver results in the dispatch
routine in the lower driver being called synchronously. It won't return
until the lower driver has done something with the IRP (either pending
or completing it). I don't remember off the top of my head whether
there's any guarantee about when the completion routine might be called
in all of this, but there's an MS knowledge base article on handling
IRPs that contains a "cheat sheet".
David wrote:
--
.../ray\..
- Posted by David on December 5th, 2003
The KB articles 320275 and 326315. I'll check them out. Thanks.
"Ray Trent" <rat@synaptics.com.spamblock> wrote in message
news:%230DIcmsuDHA.1788@tk2msftngp13.phx.gbl...
- Posted by Maxim S. Shatskih on December 5th, 2003
Yes, it is possible.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com