Re: Necessary to pend IRP_MN_QUERY_CAPABILITIES? by BubbaGump
BubbaGump
Sun Nov 26 18:42:42 CST 2006
Okay, I guess no one's going to answer. This question was actually a
little rhetorical.
I was already guessing the information returned in handling an
IRP_MN_QUERY_CAPABILITIES can usually or always be filled in by a few
assignment statements that take almost no time, which would mean there
would be no reason to pend it. Contrarily the driver model allows any
IRP to be pended, so if for example a bus driver servicing this IRP
for one of its child devices sends a similar IRP to its parent device
stack, it has to safely handle the case of getting STATUS_PENDING
back, and it's a little simpler to wait for the IRP to complete than
to use a completion routine. (Although, I would argue that if an IRP
can be pended, it can technically take an arbitrarily long time so
it'd probably be good not to wait for it.)
So, all I was really looking for was some admission that the code in
the sample was motivated by a desire for simplicity, and if that guess
was wrong then I was hoping to find out the real motivation.
On Wed, 22 Nov 2006 14:13:46 -0500, BubbaGump <> wrote:
>By the way, I'm taking this conclusion partly from the "Passive in
>arbitrary context?" thread from a while ago. I am curious to know
>whether this is valid and how much it applies to
>IRP_MN_QUERY_CAPABILITIES.
>
>
>
>
>On Tue, 21 Nov 2006 18:09:41 -0500, BubbaGump <> wrote:
>
>>I thought thread context was related to waiting but differently from
>>the way IRQL is. I thought thread context was concerned with
>>politeness, while IRQL was concerned with stability. Isn't waiting in
>>a thread context unrelated to what the driver is currently doing
>>impolite because it will steal that other thread's CPU time? (while
>>waiting at an IRQL that is too high could cause some sort of deadlock)