IRQL query

hi all,

I have a query regarding IRQLs. I am calling KeEnterCriticalRegion from a
routine which is inturn called from the dispatch routine. In the DDK it is
mentioned that KeEnterCriticalSection must be called at IRQL PASSIVE_LEVEL
only. And I suppose that the dispatch routine is called at PASSIVE_LEVEL
only. But even then the routine in which I call KeEnterCriticalRegion is
being called at DISPATCH_LEVEL! What might be going wrong?

Regards.


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

The DDK is incorrect - KeEnterCriticalRegion may be called at APC_LEVEL.

-----Original Message-----
From: xxxxx@yahoo.com [mailto:xxxxx@yahoo.com]
Sent: Tuesday, November 27, 2001 7:00 PM
To: NT Developers Interest List
Subject: [ntdev] IRQL query

hi all,

I have a query regarding IRQLs. I am calling KeEnterCriticalRegion from
a
routine which is inturn called from the dispatch routine. In the DDK it
is
mentioned that KeEnterCriticalSection must be called at IRQL
PASSIVE_LEVEL
only. And I suppose that the dispatch routine is called at PASSIVE_LEVEL

only. But even then the routine in which I call KeEnterCriticalRegion is

being called at DISPATCH_LEVEL! What might be going wrong?

Regards.


You are currently subscribed to ntdev as: xxxxx@nsisoftware.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

It is not always the case that dispatch routines will be called at
PASSIVE_LEVEL. Some device stacks have ‘understandings’ such that it is ok
for upper level drivers to call IoCallDriver at DISPATCH_LEVEL, and they do
just that. Rude, isn’t it? Only top level drivers can safely assume that
their dispatch functions are at < DISPATCH_LEVEL.

If your dispatch IRQL is too high you have to queue the irp to a worker
thread running at PASSIVE_LEVEL.

-----Original Message-----
From: xxxxx@yahoo.com [mailto:xxxxx@yahoo.com]
Sent: Tuesday, November 27, 2001 7:00 PM
To: NT Developers Interest List
Subject: [ntdev] IRQL query

hi all,

I have a query regarding IRQLs. I am calling KeEnterCriticalRegion from a
routine which is inturn called from the dispatch routine. In the DDK it is
mentioned that KeEnterCriticalSection must be called at IRQL PASSIVE_LEVEL
only. And I suppose that the dispatch routine is called at PASSIVE_LEVEL
only. But even then the routine in which I call KeEnterCriticalRegion is
being called at DISPATCH_LEVEL! What might be going wrong?

Regards.


You are currently subscribed to ntdev as: xxxxx@stratus.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

>What might be going wrong?

Ok, Murphy says: “Anything that can go wrong, will go wrong.” :->

Assuming to be called only on PASSIVE_LEVEL in a dispatch function is
only true for highest-level drivers. If your driver is not
highest-layer, then other higher layered Drivers may call your
driver at higher IRQLs ( but not higher than DISPATCH_LEVEL).

| Norbert Kawulski | mailto:xxxxx@stollmann.de |
| Stollmann T.P.GmbH, Development | http://www.stollmann.de |
–If it’s ISDN or Bluetooth, make sure it’s driven by Stollmann–

“Nobody will ever win the battle of the sexes. There’s too much
fraternizing with the enemy. - Henry Kissinger”

hi all,

I have a query regarding IRQLs. I am calling KeEnterCriticalRegion from a
routine which is inturn called from the dispatch routine. In the DDK it is
mentioned that KeEnterCriticalSection must be called at IRQL PASSIVE_LEVEL
only. And I suppose that the dispatch routine is called at PASSIVE_LEVEL
only. But even then the routine in which I call KeEnterCriticalRegion is
being called at DISPATCH_LEVEL! What might be going wrong?

Regards.


You are currently subscribed to ntdev as: xxxxx@stollmann.de
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

Your second sentence is not true. All drivers should ASSUME that their
dispatch routines are called at PASSIVE LEVEL, whether they are highest
level driver or not, unless there is a prior agreement between drivers.
The only thing that intermediate and lowest level drivers should never
assume is that they are called in the context of the user that initiated the
request.

FYI, Drivers in the storage stack know that their Dispatch routines will be
called at IRQL’s other than PASSIVE LEVEL.

Mark J. Cariddi
Consulting Associate
Open Systems Resources, Inc.
http://www.osr.com/

-----Original Message-----
From: Norbert Kawulski [mailto:xxxxx@stollmann.de]
Sent: Wednesday, November 28, 2001 9:06 AM
To: NT Developers Interest List
Subject: [ntdev] Re: IRQL query

What might be going wrong?

Ok, Murphy says: “Anything that can go wrong, will go wrong.” :->

Assuming to be called only on PASSIVE_LEVEL in a dispatch function is only
true for highest-level drivers. If your driver is not highest-layer, then
other higher layered Drivers may call your driver at higher IRQLs ( but not
higher than DISPATCH_LEVEL).

| Norbert Kawulski | mailto:xxxxx@stollmann.de |
| Stollmann T.P.GmbH, Development | http://www.stollmann.de |
–If it’s ISDN or Bluetooth, make sure it’s driven by Stollmann–

“Nobody will ever win the battle of the sexes. There’s too much fraternizing
with the enemy. - Henry Kissinger”

hi all,

I have a query regarding IRQLs. I am calling KeEnterCriticalRegion
from a
routine which is inturn called from the dispatch routine. In the DDK it is

mentioned that KeEnterCriticalSection must be called at IRQL PASSIVE_LEVEL

only. And I suppose that the dispatch routine is called at PASSIVE_LEVEL
only. But even then the routine in which I call KeEnterCriticalRegion is
being called at DISPATCH_LEVEL! What might be going wrong?

Regards.


You are currently subscribed to ntdev as: xxxxx@stollmann.de
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@osr.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

It ain’t just storage.

In fact, with the ‘filter drivers everywhere’ philosophy of wdm, I have no
idea which of the various device stacks are now candidates for ‘one can
assume PASSIVE_LEVEL except…’. For NT4 the two major transgressors were
indeed storage and serial port, but now…? Better perhaps to not assume
until after some testing?

-----Original Message-----
From: Mark Cariddi [mailto:xxxxx@osr.com]
Sent: Wednesday, November 28, 2001 9:42 AM
To: NT Developers Interest List
Subject: [ntdev] Re: IRQL query

Your second sentence is not true. All drivers should ASSUME that their
dispatch routines are called at PASSIVE LEVEL, whether they are highest
level driver or not, unless there is a prior agreement between drivers. The
only thing that intermediate and lowest level drivers should never assume is
that they are called in the context of the user that initiated the request.

FYI, Drivers in the storage stack know that their Dispatch routines will be
called at IRQL’s other than PASSIVE LEVEL.

Mark J. Cariddi
Consulting Associate
Open Systems Resources, Inc.
http://www.osr.com/

-----Original Message-----
From: Norbert Kawulski [mailto:xxxxx@stollmann.de]
Sent: Wednesday, November 28, 2001 9:06 AM
To: NT Developers Interest List
Subject: [ntdev] Re: IRQL query

What might be going wrong?

Ok, Murphy says: “Anything that can go wrong, will go wrong.” :->

Assuming to be called only on PASSIVE_LEVEL in a dispatch function is only
true for highest-level drivers. If your driver is not highest-layer, then
other higher layered Drivers may call your driver at higher IRQLs ( but not
higher than DISPATCH_LEVEL).

| Norbert Kawulski | mailto:xxxxx@stollmann.de |
| Stollmann T.P.GmbH, Development | http://www.stollmann.de |
–If it’s ISDN or Bluetooth, make sure it’s driven by Stollmann–

“Nobody will ever win the battle of the sexes. There’s too much fraternizing
with the enemy. - Henry Kissinger”

hi all,

I have a query regarding IRQLs. I am calling KeEnterCriticalRegion
from a
routine which is inturn called from the dispatch routine. In the DDK it is

mentioned that KeEnterCriticalSection must be called at IRQL
PASSIVE_LEVEL

only. And I suppose that the dispatch routine is called at
PASSIVE_LEVEL
only. But even then the routine in which I call KeEnterCriticalRegion is
being called at DISPATCH_LEVEL! What might be going wrong?

Regards.


You are currently subscribed to ntdev as: xxxxx@stollmann.de
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.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

Well, I guess that I still go by the philosophy that a filter driver cannot
break any assumptions that the driver that it filters depends on. So if if
drivers are assuming that their dispatch routines are being called at
PASSIVE_LEVEL then the insertion of filter drivers should not violation that
assumption.

–Mark

Mark J. Cariddi
Consulting Associate
Open Systems Resources, Inc.
http://www.osr.com/

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Wednesday, November 28, 2001 9:55 AM
To: NT Developers Interest List
Subject: [ntdev] Re: IRQL query

It ain’t just storage.

In fact, with the ‘filter drivers everywhere’ philosophy of wdm, I have no
idea which of the various device stacks are now candidates for ‘one can
assume PASSIVE_LEVEL except…’. For NT4 the two major transgressors were
indeed storage and serial port, but now…? Better perhaps to not assume
until after some testing?

-----Original Message-----
From: Mark Cariddi [mailto:xxxxx@osr.com]
Sent: Wednesday, November 28, 2001 9:42 AM
To: NT Developers Interest List
Subject: [ntdev] Re: IRQL query

Your second sentence is not true. All drivers should ASSUME that their
dispatch routines are called at PASSIVE LEVEL, whether they are highest
level driver or not, unless there is a prior agreement between drivers. The
only thing that intermediate and lowest level drivers should never assume is
that they are called in the context of the user that initiated the request.

FYI, Drivers in the storage stack know that their Dispatch routines will be
called at IRQL’s other than PASSIVE LEVEL.

Mark J. Cariddi
Consulting Associate
Open Systems Resources, Inc.
http://www.osr.com/

-----Original Message-----
From: Norbert Kawulski [mailto:xxxxx@stollmann.de]
Sent: Wednesday, November 28, 2001 9:06 AM
To: NT Developers Interest List
Subject: [ntdev] Re: IRQL query

What might be going wrong?

Ok, Murphy says: “Anything that can go wrong, will go wrong.” :->

Assuming to be called only on PASSIVE_LEVEL in a dispatch function is only
true for highest-level drivers. If your driver is not highest-layer, then
other higher layered Drivers may call your driver at higher IRQLs ( but not
higher than DISPATCH_LEVEL).

| Norbert Kawulski | mailto:xxxxx@stollmann.de |
| Stollmann T.P.GmbH, Development | http://www.stollmann.de |
–If it’s ISDN or Bluetooth, make sure it’s driven by Stollmann–

“Nobody will ever win the battle of the sexes. There’s too much fraternizing
with the enemy. - Henry Kissinger”

hi all,

I have a query regarding IRQLs. I am calling KeEnterCriticalRegion
from a routine which is inturn called from the dispatch routine. In
the DDK it is

mentioned that KeEnterCriticalSection must be called at IRQL
PASSIVE_LEVEL

only. And I suppose that the dispatch routine is called at
PASSIVE_LEVEL
only. But even then the routine in which I call KeEnterCriticalRegion is
being called at DISPATCH_LEVEL! What might be going wrong?

Regards.


You are currently subscribed to ntdev as: xxxxx@stollmann.de
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@osr.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

Mark,
I agree that it would be nice to be called at passive level, but how
can you rely on that ?

I guess for all architectures that use some sort of streaming the
opposite is true: You should assume that the next Data-Irp comes from the upper
completion proc ( which runs at dispatch level).

For an example see the isousb (NTDDK\src\wdm\usb\isousb\sys\isostrm.c) sample.


| Norbert Kawulski | mailto:xxxxx@stollmann.de |
| Stollmann T.P.GmbH, Development | http://www.stollmann.de |
–If it’s ISDN or Bluetooth, make sure it’s driven by Stollmann–

“Subtlety is the art of saying what you think and getting out of range
before it is understood.”

Well, I guess that I still go by the philosophy that a filter driver cannot
break any assumptions that the driver that it filters depends on. So if if
drivers are assuming that their dispatch routines are being called at
PASSIVE_LEVEL then the insertion of filter drivers should not violation that
assumption.

–Mark

Mark J. Cariddi
Consulting Associate
Open Systems Resources, Inc.
http://www.osr.com/

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Wednesday, November 28, 2001 9:55 AM
To: NT Developers Interest List
Subject: Re: IRQL query

It ain’t just storage.

In fact, with the ‘filter drivers everywhere’ philosophy of wdm, I have no
idea which of the various device stacks are now candidates for ‘one can
assume PASSIVE_LEVEL except…’. For NT4 the two major transgressors were
indeed storage and serial port, but now…? Better perhaps to not assume
until after some testing?

-----Original Message-----
From: Mark Cariddi [mailto:xxxxx@osr.com]
Sent: Wednesday, November 28, 2001 9:42 AM
To: NT Developers Interest List
Subject: Re: IRQL query

Your second sentence is not true. All drivers should ASSUME that their
dispatch routines are called at PASSIVE LEVEL, whether they are highest
level driver or not, unless there is a prior agreement between drivers. The
only thing that intermediate and lowest level drivers should never assume is
that they are called in the context of the user that initiated the request.

FYI, Drivers in the storage stack know that their Dispatch routines will be
called at IRQL’s other than PASSIVE LEVEL.

Mark J. Cariddi
Consulting Associate
Open Systems Resources, Inc.
http://www.osr.com/

-----Original Message-----
From: Norbert Kawulski [mailto:xxxxx@stollmann.de]
Sent: Wednesday, November 28, 2001 9:06 AM
To: NT Developers Interest List
Subject: Re: IRQL query

>What might be going wrong?

Ok, Murphy says: “Anything that can go wrong, will go wrong.” :->

Assuming to be called only on PASSIVE_LEVEL in a dispatch function is only
true for highest-level drivers. If your driver is not highest-layer, then
other higher layered Drivers may call your driver at higher IRQLs ( but not
higher than DISPATCH_LEVEL).

| Norbert Kawulski | mailto:xxxxx@stollmann.de |
| Stollmann T.P.GmbH, Development | http://www.stollmann.de |
–If it’s ISDN or Bluetooth, make sure it’s driven by Stollmann–

“Nobody will ever win the battle of the sexes. There’s too much fraternizing
with the enemy. - Henry Kissinger”

> hi all,

> I have a query regarding IRQLs. I am calling KeEnterCriticalRegion
> from a routine which is inturn called from the dispatch routine. In
> the DDK it is

> mentioned that KeEnterCriticalSection must be called at IRQL
> PASSIVE_LEVEL

> only. And I suppose that the dispatch routine is called at
> PASSIVE_LEVEL
> only. But even then the routine in which I call KeEnterCriticalRegion is
> being called at DISPATCH_LEVEL! What might be going wrong?

> Regards.

> —
> You are currently subscribed to ntdev as: xxxxx@stollmann.de
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stollmann.de
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