Sure …
Suppose Windgit Inc, sells a device driver that attaches to your driver so
they can control their Frammis 4000. Now, Widget’s driver writer, being the
genius that the boss’s sister said her son was, decides that his driver just
has to call IoCallDriver from DISPATCH_LEVEL. If your read dispatch routine
then does a simple ExAllocatePool(PagedPool, …) you will be looking at a
BSOD and everything points to you. You can test IRQL and allocate from
NonPagedPool, but I’d rather return an error code, since we all know that
Widget’s boss’s sister’s son is a pimply faced nerd.
Seriously, testing IRQL levels is really up to you and how you foresee your
driver being used. The general feeling is that your dispatch routines such
as Read/Write should be transparent to a call originating from a driver or
an application, and calling IoCallDriver at elevated IRQL is NOT
transparent. That means the third scenario is to field the support call and
then tell Widget that their call is out of spec since your documentation
specifically states that inter-driver communication must be done at
PASSIVE_LEVEL.
Gary
-----Original Message-----
From: Barak Mandelovich [mailto:xxxxx@mercury.co.il]
Sent: Tuesday, January 09, 2001 6:05 AM
To: NT Developers Interest List
Subject: [ntdev] IRQL question
Hi, Guys!
I did some “research” about IRQ levels etc., and I think I understand it
better now.
Just one thing that I still do not understand:
Let’s say that I read from my driver using ReadFile().
This function is called in IRQ_PASSIVE_LEVEL.
Now, why should I check the IRQL in the function that takes care of ReadFile
inside
the driver? I mean - is there a chance that this function would be called in
IRQL > IRQ_PASSIVE_LEVEL ?
How?
If it cannot happen - can you please give an example of when it CAN happen
(A general case, with any kind of IoCtl )?
Now, let’s say that I check IRQL, and it’s not the correct level - what
should I do next?
After all - I should return an answer to the user, and I don’t think that a
“failure” message is the correct one to return.
thanks in advance,
Barak Mandelovich xxxxx@mercury.co.il
Mercury Interactive ltd.
You are currently subscribed to ntdev as: xxxxx@delphieng.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com