DispatchRead/DispatchWrite IRQL

Hello,

I am writing a non PnP driver that creates virtual volumes that use files
as backing store. Since these virtual volumes will not be in
the paging path, can it be said that DispatchRead/DispatchWrite
routines will be called at IRQL = PASSIVE_LEVEL only? Or is it ever
possible for these routines to be called at a higher IRQL ?

Thanks,

  • Gary

Hello!

can it be said that DispatchRead/DispatchWrite routines will be
called at IRQL = PASSIVE_LEVEL only? Or is it ever possible for
these routines to be called at a higher IRQL ?

Since any application can call ReadFile/WriteFile/DeviceIoControl from
the APC (a completion routine, for example), your Dispatch routines
can be called with IRQL == APC_LEVEL. But in the driver (in
kernel-mode code), the APC_LEVEL is almost identical to the
PASSIVE_LEVEL with some exceptions (KeDelayExecutionThread with
Alertable parameter set to TRUE, for example).

Regards,
Eugene

No. You cannot make this assumption. Just because the volume doesn’t have a
pagefile on it doesn’t mean that paging read/writes will not occur. You have
to test for IRQL and use worker threads to perform operations that are at
the wrong level.

=====================
Mark Roddy
Windows .NET/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gary Brown
Sent: Tuesday, March 01, 2005 12:36 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] DispatchRead/DispatchWrite IRQL

Hello,

I am writing a non PnP driver that creates virtual volumes
that use files as backing store. Since these virtual volumes
will not be in the paging path, can it be said that
DispatchRead/DispatchWrite routines will be called at IRQL =
PASSIVE_LEVEL only? Or is it ever possible for these routines
to be called at a higher IRQL ?

Thanks,

  • Gary

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

Applications never run at APC level. Even user-mode APC routines run at
passive level.

However the file system might call you at APC level, or might call you
in a DPC completion routine, so it’s better to be prepared.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Eugene Muzychenko
Sent: Tuesday, March 01, 2005 9:52 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] DispatchRead/DispatchWrite IRQL

Hello!

can it be said that DispatchRead/DispatchWrite routines will be called

at IRQL = PASSIVE_LEVEL only? Or is it ever possible for these
routines to be called at a higher IRQL ?

Since any application can call ReadFile/WriteFile/DeviceIoControl from
the APC (a completion routine, for example), your Dispatch routines can
be called with IRQL == APC_LEVEL. But in the driver (in kernel-mode
code), the APC_LEVEL is almost identical to the PASSIVE_LEVEL with some
exceptions (KeDelayExecutionThread with Alertable parameter set to TRUE,
for example).

Regards,
Eugene


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks a lot for your inputs and clearing this doubt.

“Peter Wieland” wrote in message
news:xxxxx@ntdev…
Applications never run at APC level. Even user-mode APC routines run at
passive level.

However the file system might call you at APC level, or might call you
in a DPC completion routine, so it’s better to be prepared.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Eugene Muzychenko
Sent: Tuesday, March 01, 2005 9:52 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] DispatchRead/DispatchWrite IRQL

Hello!

> can it be said that DispatchRead/DispatchWrite routines will be called

> at IRQL = PASSIVE_LEVEL only? Or is it ever possible for these
> routines to be called at a higher IRQL ?

Since any application can call ReadFile/WriteFile/DeviceIoControl from
the APC (a completion routine, for example), your Dispatch routines can
be called with IRQL == APC_LEVEL. But in the driver (in kernel-mode
code), the APC_LEVEL is almost identical to the PASSIVE_LEVEL with some
exceptions (KeDelayExecutionThread with Alertable parameter set to TRUE,
for example).

Regards,
Eugene


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

IoPageRead can call your driver at APC_LEVEL to support memory mapping
files.

“Gary Brown” wrote in message
news:xxxxx@ntdev…
> Hello,
>
> I am writing a non PnP driver that creates virtual volumes that use files
> as backing store. Since these virtual volumes will not be in
> the paging path, can it be said that DispatchRead/DispatchWrite
> routines will be called at IRQL = PASSIVE_LEVEL only? Or is it ever
> possible for these routines to be called at a higher IRQL ?
>
> Thanks,
> - Gary
>
>
>

> Since any application can call ReadFile/WriteFile/DeviceIoControl from

the APC (a completion routine, for example), your Dispatch routines
can be called with IRQL == APC_LEVEL.

User APCs run on PASSIVE_LEVEL. All user code, in fact, runs on PASSIVE_LEVEL.

kernel-mode code), the APC_LEVEL is almost identical to the
PASSIVE_LEVEL with some exceptions (KeDelayExecutionThread with
Alertable parameter set to TRUE, for example).

Another exception is being unable to use Zwxxx file IO calls on APC_LEVEL.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com