Dispatch Routines and IRQLs

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/kmarch/hh/kmarch/drvcomps_1ezr.asp

From the above page, can I conclude that DispatchCreate always run at IRQL
= PASSIVE_LEVEL?

“Eric Chan” wrote in message news:xxxxx@ntfsd…
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/kmarch/hh/k
march/drvcomps_1ezr.asp
>
>
> From the above page, can I conclude that DispatchCreate always run at IRQL
> = PASSIVE_LEVEL?
>
>

Yes, but the page is not really accurate about read/write/ioctl - all of
which could, in theory, end up being run at DISPATCH_LEVEL in a
non-top-level driver. It is rude, but it happens. This generally bites
people building filter drivers for various driver stacks, without
anticipating the ‘private agreements’ within those stacks about what IRQL
can be used for IO operations.

This is wrong, dispatch routines are never called at DPC level, only
completion routines.

What I think you were trying to say is that read/write/ioctl can be
called at PASSIVE or APC level.

Neal Christiansen

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Wednesday, March 13, 2002 12:05 PM
To: File Systems Developers
Subject: [ntfsd] Re: Dispatch Routines and IRQLs

“Eric Chan” wrote in message news:xxxxx@ntfsd…
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/kmarch/
hh/k
march/drvcomps_1ezr.asp
>
>
> From the above page, can I conclude that DispatchCreate always run at
IRQL
> = PASSIVE_LEVEL?
>
>

Yes, but the page is not really accurate about read/write/ioctl - all
of
which could, in theory, end up being run at DISPATCH_LEVEL in a
non-top-level driver. It is rude, but it happens. This generally bites
people building filter drivers for various driver stacks, without
anticipating the ‘private agreements’ within those stacks about what
IRQL
can be used for IO operations.


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%

Neal Christiansen:

Subject: [ntfsd] Re: Dispatch Routines and IRQLs

This is wrong, dispatch routines are never called at DPC level, only
completion routines.

What I think you were trying to say is that read/write/ioctl can be
called at PASSIVE or APC level.

Neal Christiansen

Sorry, but you are wrong, IoCallDriver can be called at DISPATCH_LEVEL,
and there are enough cases of Microsoft code calling things at
DISPATCH_LEVEL
to blue screen well if you don’t handle the case.

Don Burn
Windows NT/2000/XP Filesystem and Device Driver Consulting

Filesystems cannot be called through their IRP major entry points at DPC
level. Do not confuse bugs where a DPC level raise has been leaked or
erroneously held to the point of such a call with a specification that
it must be handled. It does not need to be and should not be handled.

Remember, we’re talking about filesystem rules here. Yes, IoCallDriver
is nonpaged and can be called at any IRQL you want, but you have to
follow the rules that the lower driver is expecting and for filesystems
and their filters that means < DPC_LEVEL. It of course need not be a
universal rule but that is outside the scope of this discussion.


This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Don Burn [mailto:xxxxx@acm.org]
Sent: Wednesday, March 13, 2002 2:10 PM
To: File Systems Developers
Subject: [ntfsd] Re: Dispatch Routines and IRQLs

Neal Christiansen:

Subject: [ntfsd] Re: Dispatch Routines and IRQLs

This is wrong, dispatch routines are never called at DPC level, only
completion routines.

What I think you were trying to say is that read/write/ioctl can be
called at PASSIVE or APC level.

Neal Christiansen

Sorry, but you are wrong, IoCallDriver can be called at DISPATCH_LEVEL,
and there are enough cases of Microsoft code calling things at
DISPATCH_LEVEL
to blue screen well if you don’t handle the case.

Don Burn
Windows NT/2000/XP Filesystem and Device Driver Consulting


You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%

The original post was stating that dispatch routines of
any driver cannot be called at DISPATCH_LEVEL!
I concur a filesystem or other top level driver will not
be called at dispatch, but the poster was claiming
NO DRIVER DISPATCH ROUTINE would be
called that way.

Don Burn
Windows NT/2000/XP Filesystem and Device Driver Consulting

----- Original Message -----
From: “Daniel Lovinger”
To: “File Systems Developers”
Sent: Wednesday, March 13, 2002 5:23 PM
Subject: [ntfsd] Re: Dispatch Routines and IRQLs

Filesystems cannot be called through their IRP major entry points at DPC
level. Do not confuse bugs where a DPC level raise has been leaked or
erroneously held to the point of such a call with a specification that
it must be handled. It does not need to be and should not be handled.

Remember, we’re talking about filesystem rules here. Yes, IoCallDriver
is nonpaged and can be called at any IRQL you want, but you have to
follow the rules that the lower driver is expecting and for filesystems
and their filters that means < DPC_LEVEL. It of course need not be a
universal rule but that is outside the scope of this discussion.

So we would be in violent agreement then, with my statement that: “Yes,
but the page is not really accurate about read/write/ioctl - all of
which could, in theory, end up being run at DISPATCH_LEVEL in a
non-top-level driver.”
My comment was simply about the accuracy of the page cited, which page
is not specific to filesystem drivers, not about rules for writing fs
and fsf drivers.

=====================
Mark Roddy
Windows XP/2000/NT Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
xxxxx@hollistech.com
For Windows Device Driver Training: see www.azius.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Daniel Lovinger
Sent: Wednesday, March 13, 2002 5:23 PM
To: File Systems Developers
Subject: [ntfsd] Re: Dispatch Routines and IRQLs

Filesystems cannot be called through their IRP major entry
points at DPC level. Do not confuse bugs where a DPC level
raise has been leaked or erroneously held to the point of
such a call with a specification that it must be handled. It
does not need to be and should not be handled.

Remember, we’re talking about filesystem rules here. Yes,
IoCallDriver is nonpaged and can be called at any IRQL you
want, but you have to follow the rules that the lower driver
is expecting and for filesystems and their filters that means
< DPC_LEVEL. It of course need not be a universal rule but
that is outside the scope of this discussion.


This posting is provided “AS IS” with no warranties, and
confers no rights.

-----Original Message-----
From: Don Burn [mailto:xxxxx@acm.org]
Sent: Wednesday, March 13, 2002 2:10 PM
To: File Systems Developers
Subject: [ntfsd] Re: Dispatch Routines and IRQLs

Neal Christiansen:

Subject: [ntfsd] Re: Dispatch Routines and IRQLs

This is wrong, dispatch routines are never called at DPC
level, only completion routines.

What I think you were trying to say is that read/write/ioctl
can be called at PASSIVE or APC level.

Neal Christiansen

Sorry, but you are wrong, IoCallDriver can be called at
DISPATCH_LEVEL, and there are enough cases of Microsoft code
calling things at DISPATCH_LEVEL to blue screen well if you
don’t handle the case.

Don Burn
Windows NT/2000/XP Filesystem and Device Driver Consulting


You are currently subscribed to ntfsd as:
xxxxx@windows.microsoft.com To unsubscribe send a blank email
to %%email.unsub%%


You are currently subscribed to ntfsd as:
xxxxx@hollistech.com To unsubscribe send a blank email to
%%email.unsub%%

If I were trying to say that, that is what I would have said. The page
cited is less than accurate.

=====================
Mark Roddy
Windows XP/2000/NT Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
xxxxx@hollistech.com
For Windows Device Driver Training: see www.azius.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Neal
Christiansen
Sent: Wednesday, March 13, 2002 3:38 PM
To: File Systems Developers
Subject: [ntfsd] Re: Dispatch Routines and IRQLs

This is wrong, dispatch routines are never called at DPC
level, only completion routines.

What I think you were trying to say is that read/write/ioctl
can be called at PASSIVE or APC level.

Neal Christiansen

This posting is provided “AS IS” with no warranties, and
confers no rights.

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Wednesday, March 13, 2002 12:05 PM
To: File Systems Developers
Subject: [ntfsd] Re: Dispatch Routines and IRQLs

“Eric Chan” wrote in message news:xxxxx@ntfsd…
> >
> >
> http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/kmarch/
hh/k
march/drvcomps_1ezr.asp
>
>
> From the above page, can I conclude that DispatchCreate always run at
IRQL
> = PASSIVE_LEVEL?
>
>

Yes, but the page is not really accurate about read/write/ioctl - all
of which could, in theory, end up being run at DISPATCH_LEVEL in a
non-top-level driver. It is rude, but it happens. This generally bites
people building filter drivers for various driver stacks, without
anticipating the ‘private agreements’ within those stacks about what
IRQL can be used for IO operations.


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@hollistech.com To
unsubscribe send a blank email to %%email.unsub%%

Even though you and Don disagree with me on this, I think we’re at least
implicitly talking about filesystems here (its ntfsd, after all) when a
question comes by about the CREATE operation. I don’t want there to be
any confusion about the filesystem rules. < DPC, everywhere, at all
times.

What cases are you referring to outside of the filesystem space?


This posting is provided “AS IS” with no warranties, and
confers no rights.

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Wednesday, March 13, 2002 3:00 PM
To: File Systems Developers
Subject: [ntfsd] Re: Dispatch Routines and IRQLs

So we would be in violent agreement then, with my statement that: “Yes,
but the page is not really accurate about read/write/ioctl - all of
which could, in theory, end up being run at DISPATCH_LEVEL in a
non-top-level driver.”
My comment was simply about the accuracy of the page cited, which page
is not specific to filesystem drivers, not about rules for writing fs
and fsf drivers.

=====================
Mark Roddy
Windows XP/2000/NT Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
xxxxx@hollistech.com
For Windows Device Driver Training: see www.azius.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Daniel Lovinger
Sent: Wednesday, March 13, 2002 5:23 PM
To: File Systems Developers
Subject: [ntfsd] Re: Dispatch Routines and IRQLs

Filesystems cannot be called through their IRP major entry
points at DPC level. Do not confuse bugs where a DPC level
raise has been leaked or erroneously held to the point of
such a call with a specification that it must be handled. It
does not need to be and should not be handled.

Remember, we’re talking about filesystem rules here. Yes,
IoCallDriver is nonpaged and can be called at any IRQL you
want, but you have to follow the rules that the lower driver
is expecting and for filesystems and their filters that means
< DPC_LEVEL. It of course need not be a universal rule but
that is outside the scope of this discussion.


This posting is provided “AS IS” with no warranties, and
confers no rights.

-----Original Message-----
From: Don Burn [mailto:xxxxx@acm.org]
Sent: Wednesday, March 13, 2002 2:10 PM
To: File Systems Developers
Subject: [ntfsd] Re: Dispatch Routines and IRQLs

Neal Christiansen:

Subject: [ntfsd] Re: Dispatch Routines and IRQLs

This is wrong, dispatch routines are never called at DPC
level, only completion routines.

What I think you were trying to say is that read/write/ioctl
can be called at PASSIVE or APC level.

Neal Christiansen

Sorry, but you are wrong, IoCallDriver can be called at
DISPATCH_LEVEL, and there are enough cases of Microsoft code
calling things at DISPATCH_LEVEL to blue screen well if you
don’t handle the case.

Don Burn
Windows NT/2000/XP Filesystem and Device Driver Consulting


You are currently subscribed to ntfsd as:
xxxxx@windows.microsoft.com To unsubscribe send a blank email
to %%email.unsub%%


You are currently subscribed to ntfsd as:
xxxxx@hollistech.com To unsubscribe send a blank email to
%%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%

For w2k the only one I’ve found so far in the ddk is cdrom, who uses
system queueing to push requests down to scsiport, and consequently does
so at dispatch_level. On the other hand, the classic chronic abuser of
this ‘feature’, the serial stack appears to no longer do this. You could
actually make the point, in fact I’ll make it for you, that only the
IRP_MJ_INTERNAL_DEVICE_CONTROL appears to be abused in this manner since
w2k, and I’ll concede.

=====================
Mark Roddy
Windows XP/2000/NT Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
xxxxx@hollistech.com
For Windows Device Driver Training: see www.azius.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Daniel Lovinger
Sent: Wednesday, March 13, 2002 6:33 PM
To: File Systems Developers
Subject: [ntfsd] Re: Dispatch Routines and IRQLs

Even though you and Don disagree with me on this, I think
we’re at least implicitly talking about filesystems here (its
ntfsd, after all) when a question comes by about the CREATE
operation. I don’t want there to be any confusion about the
filesystem rules. < DPC, everywhere, at all times.

What cases are you referring to outside of the filesystem space?


This posting is provided “AS IS” with no warranties, and
confers no rights.

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Wednesday, March 13, 2002 3:00 PM
To: File Systems Developers
Subject: [ntfsd] Re: Dispatch Routines and IRQLs

So we would be in violent agreement then, with my statement
that: “Yes, but the page is not really accurate about
read/write/ioctl - all of which could, in theory, end up
being run at DISPATCH_LEVEL in a non-top-level driver.” My
comment was simply about the accuracy of the page cited,
which page is not specific to filesystem drivers, not about
rules for writing fs and fsf drivers.

=====================
Mark Roddy
Windows XP/2000/NT Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
xxxxx@hollistech.com
For Windows Device Driver Training: see www.azius.com

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
Daniel Lovinger
> Sent: Wednesday, March 13, 2002 5:23 PM
> To: File Systems Developers
> Subject: [ntfsd] Re: Dispatch Routines and IRQLs
>
>
> Filesystems cannot be called through their IRP major entry
> points at DPC level. Do not confuse bugs where a DPC level
> raise has been leaked or erroneously held to the point of
> such a call with a specification that it must be handled. It
> does not need to be and should not be handled.
>
> Remember, we’re talking about filesystem rules here. Yes,
> IoCallDriver is nonpaged and can be called at any IRQL you
> want, but you have to follow the rules that the lower driver
> is expecting and for filesystems and their filters that means
> < DPC_LEVEL. It of course need not be a universal rule but
> that is outside the scope of this discussion.
>
> –
> This posting is provided “AS IS” with no warranties, and
> confers no rights.
>
> -----Original Message-----
> From: Don Burn [mailto:xxxxx@acm.org]
> Sent: Wednesday, March 13, 2002 2:10 PM
> To: File Systems Developers
> Subject: [ntfsd] Re: Dispatch Routines and IRQLs
>
> Neal Christiansen:
>
> Subject: [ntfsd] Re: Dispatch Routines and IRQLs
>
>
> This is wrong, dispatch routines are never called at DPC
> level, only completion routines.
>
> What I think you were trying to say is that read/write/ioctl
> can be called at PASSIVE or APC level.
>
> Neal Christiansen
>
> Sorry, but you are wrong, IoCallDriver can be called at
> DISPATCH_LEVEL, and there are enough cases of Microsoft code
> calling things at DISPATCH_LEVEL to blue screen well if you
> don’t handle the case.
>
> Don Burn
> Windows NT/2000/XP Filesystem and Device Driver Consulting
>
>
>
>
>
>
> —
> You are currently subscribed to ntfsd as:
> xxxxx@windows.microsoft.com To unsubscribe send a blank email
> to %%email.unsub%%
>
> —
> You are currently subscribed to ntfsd as:
> xxxxx@hollistech.com To unsubscribe send a blank email to
> %%email.unsub%%
>
>
>


You are currently subscribed to ntfsd as:
xxxxx@windows.microsoft.com To unsubscribe send a blank email
to %%email.unsub%%


You are currently subscribed to ntfsd as:
xxxxx@hollistech.com To unsubscribe send a blank email to
%%email.unsub%%