DPC IRQL is not Passive?

Hello,

I am using a Custom DPC routine using (KeInitializeDpc and
KeInsertQueueDpc). The documentation for KeInsertQueueDpc says that it
Queue’s the DPC for execution when the IRQL drops below DISPATCH_LEVEL.
However, my DPC is getting executed @ DISPATCH_LEVEL (where I can’t call
IoBuildDeviceIoControlRequest()). Why is this? Am I overlooking something?

I am using: Win 2000, No Service Packs, WinDbg and the GENERIC library from
Walter Oney.

I just read the comment in Dekker/Newcomer that says that you cannot depend
on your DPC being called at below DISPATCH_LEVEL if you call
KeSetTargetProcessorDpc() in NT5.0/2000. I am not calling that function
either. I searched the archives and couldn’t find anything about this.

Thanks for your help!
Narayan

This is a day one bug in the ddk documentation. It ought to say that the dpc
is queued for execution when the IRQL *IS GOING* to drop below
DISPATCH_LEVEL. It is the attempt to transition a processor from >=
DISPATCH_LEVEL to < DISPATCH_LEVEL that results in dpc queue processing.

-----Original Message-----
From: Narayan Krishnamoorthy [mailto:xxxxx@dato.com]
Sent: Monday, March 25, 2002 2:46 PM
To: NT Developers Interest List
Subject: [ntdev] DPC IRQL is not Passive?

Hello,

I am using a Custom DPC routine using (KeInitializeDpc and
KeInsertQueueDpc). The documentation for KeInsertQueueDpc
says that it
Queue’s the DPC for execution when the IRQL drops below
DISPATCH_LEVEL.
However, my DPC is getting executed @ DISPATCH_LEVEL (where I
can’t call
IoBuildDeviceIoControlRequest()). Why is this? Am I
overlooking something?

I am using: Win 2000, No Service Packs, WinDbg and the
GENERIC library from
Walter Oney.

I just read the comment in Dekker/Newcomer that says that you
cannot depend
on your DPC being called at below DISPATCH_LEVEL if you call
KeSetTargetProcessorDpc() in NT5.0/2000. I am not calling
that function
either. I searched the archives and couldn’t find anything about this.

Thanks for your help!
Narayan


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

Hi Mark,

Thanks for your reply… That explains it.

But, if I need to do something at PASSIVE_LEVEL what do I do? What are my
options at this point?

Thanks!
Narayan.

This is a day one bug in the ddk documentation. It ought to say that the dpc
is queued for execution when the IRQL *IS GOING* to drop below
DISPATCH_LEVEL. It is the attempt to transition a processor from >=
DISPATCH_LEVEL to < DISPATCH_LEVEL that results in dpc queue processing.

> -----Original Message-----
> From: Narayan Krishnamoorthy [mailto:xxxxx@dato.com]
> Sent: Monday, March 25, 2002 2:46 PM
> To: NT Developers Interest List
> Subject: [ntdev] DPC IRQL is not Passive?
>
>
>
> Hello,
>
> I am using a Custom DPC routine using (KeInitializeDpc and
> KeInsertQueueDpc). The documentation for KeInsertQueueDpc
> says that it
> Queue’s the DPC for execution when the IRQL drops below
> DISPATCH_LEVEL.
> However, my DPC is getting executed @ DISPATCH_LEVEL (where I
> can’t call
> IoBuildDeviceIoControlRequest()). Why is this? Am I
> overlooking something?
>
> I am using: Win 2000, No Service Packs, WinDbg and the
> GENERIC library from
> Walter Oney.
>
> I just read the comment in Dekker/Newcomer that says that you
> cannot depend
> on your DPC being called at below DISPATCH_LEVEL if you call
> KeSetTargetProcessorDpc() in NT5.0/2000. I am not calling
> that function
> either. I searched the archives and couldn’t find anything about this.
>
> Thanks for your help!
> Narayan
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@stratus.com To unsubscribe send a blank email to
> %%email.unsub%%
>


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

Queue a work item from your dpc routine, or set an event for a waiting
thread of your own.

-----Original Message-----
From: Narayan Krishnamoorthy [mailto:xxxxx@dato.com]
Sent: Monday, March 25, 2002 3:03 PM
To: NT Developers Interest List
Subject: [ntdev] RE: DPC IRQL is not Passive?

Hi Mark,

Thanks for your reply… That explains it.

But, if I need to do something at PASSIVE_LEVEL what do I do?
What are my
options at this point?

Thanks!
Narayan.

>This is a day one bug in the ddk documentation. It ought to say that
>the dpc is queued for execution when the IRQL *IS GOING* to
drop below
>DISPATCH_LEVEL. It is the attempt to transition a processor from >=
>DISPATCH_LEVEL to < DISPATCH_LEVEL that results in dpc queue
>processing.
>
> > -----Original Message-----
> > From: Narayan Krishnamoorthy [mailto:xxxxx@dato.com]
> > Sent: Monday, March 25, 2002 2:46 PM
> > To: NT Developers Interest List
> > Subject: [ntdev] DPC IRQL is not Passive?
> >
> >
> >
> > Hello,
> >
> > I am using a Custom DPC routine using (KeInitializeDpc and
> > KeInsertQueueDpc). The documentation for KeInsertQueueDpc
says that
> > it Queue’s the DPC for execution when the IRQL drops below
> > DISPATCH_LEVEL.
> > However, my DPC is getting executed @ DISPATCH_LEVEL (where I
> > can’t call
> > IoBuildDeviceIoControlRequest()). Why is this? Am I
> > overlooking something?
> >
> > I am using: Win 2000, No Service Packs, WinDbg and the GENERIC
> > library from Walter Oney.
> >
> > I just read the comment in Dekker/Newcomer that says that
you cannot
> > depend on your DPC being called at below DISPATCH_LEVEL
if you call
> > KeSetTargetProcessorDpc() in NT5.0/2000. I am not calling
> > that function
> > either. I searched the archives and couldn’t find
anything about this.
> >
> > Thanks for your help!
> > Narayan
> >
> >
> > —
> > You are currently subscribed to ntdev as:
xxxxx@stratus.com To
> > unsubscribe send a blank email to %%email.unsub%%
> >
>
>—
>You are currently subscribed to ntdev as: xxxxx@dato.com
>To unsubscribe send a blank email to %%email.unsub%%


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

> Queue’s the DPC for execution when the IRQL drops below DISPATCH_LEVEL.

However, my DPC is getting executed @ DISPATCH_LEVEL (where I can’t call
IoBuildDeviceIoControlRequest()). Why is this? Am I overlooking something?

Exactly so.
When somebody want to lower the IRQL below DISPATCH - usually KeReleaseSpinLock or ISR epilog - then KiRetireDpcList is executed
just before this, which calls all queued DPCs.

DPCs always run on DISPATCH, and surely you cannot use IoBuildDeviceIoControlRequest from the DPC - use IoAllocateIrp instead.

Max

Create a driver thread, and have it service the operation. An ISR will usually have to queue a DPC to wakeup the thread.

-DH
“Narayan Krishnamoorthy” wrote in message news:xxxxx@ntdev…
>
>
> Hi Mark,
>
> Thanks for your reply… That explains it.
>
> But, if I need to do something at PASSIVE_LEVEL what do I do? What are my
> options at this point?
>
> Thanks!
> Narayan.
>
> >This is a day one bug in the ddk documentation. It ought to say that the dpc
> >is queued for execution when the IRQL IS GOING to drop below
> >DISPATCH_LEVEL. It is the attempt to transition a processor from >=
> >DISPATCH_LEVEL to < DISPATCH_LEVEL that results in dpc queue processing.
> >
> > > -----Original Message-----
> > > From: Narayan Krishnamoorthy [mailto:xxxxx@dato.com]
> > > Sent: Monday, March 25, 2002 2:46 PM
> > > To: NT Developers Interest List
> > > Subject: [ntdev] DPC IRQL is not Passive?
> > >
> > >
> > >
> > > Hello,
> > >
> > > I am using a Custom DPC routine using (KeInitializeDpc and
> > > KeInsertQueueDpc). The documentation for KeInsertQueueDpc
> > > says that it
> > > Queue’s the DPC for execution when the IRQL drops below
> > > DISPATCH_LEVEL.
> > > However, my DPC is getting executed @ DISPATCH_LEVEL (where I
> > > can’t call
> > > IoBuildDeviceIoControlRequest()). Why is this? Am I
> > > overlooking something?
> > >
> > > I am using: Win 2000, No Service Packs, WinDbg and the
> > > GENERIC library from
> > > Walter Oney.
> > >
> > > I just read the comment in Dekker/Newcomer that says that you
> > > cannot depend
> > > on your DPC being called at below DISPATCH_LEVEL if you call
> > > KeSetTargetProcessorDpc() in NT5.0/2000. I am not calling
> > > that function
> > > either. I searched the archives and couldn’t find anything about this.
> > >
> > > Thanks for your help!
> > > Narayan
> > >
> > >
> > > —
> > > You are currently subscribed to ntdev as:
> > > xxxxx@stratus.com To unsubscribe send a blank email to
> > > %%email.unsub%%
> > >
> >
> >—
> >You are currently subscribed to ntdev as: xxxxx@dato.com
> >To unsubscribe send a blank email to %%email.unsub%%
>
>
>

See IoQueueWorkItem().

Stephan

On Mon, 25 Mar 2002 12:03:03 -0800, Narayan Krishnamoorthy
wrote:

>Hi Mark,
>
>Thanks for your reply… That explains it.
>
>But, if I need to do something at PASSIVE_LEVEL what do I do? What are my
>options at this point?
>
>Thanks!
>Narayan.