Is IRQL==PASSIVE_LEVEL for PreOperationCallback()?

Hi,

Is this correct assumption that PreOperationCallback function is always runs in
IRQL=PASSIVE_LEVEL?

What about PostOperationCallback()? Can we be in any IRQL level?
How do we deal with the functions that needs to be in different IRQ level that what we currently are?

Thanks for your help
Payman

Comments inline:
wrote in message news:xxxxx@ntfsd…
> Hi,
>
> Is this correct assumption that PreOperationCallback function is always
> runs in
> IRQL=PASSIVE_LEVEL?

NO

> What about PostOperationCallback()? Can we be in any IRQL level?

YES

> How do we deal with the functions that needs to be in different IRQ level
> that what we currently are?

That is why they pay people significant amounts to develop file system
filters, to design them to handle these problems.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

The pages on MSDN you’re looking for are these:

http://msdn2.microsoft.com/en-us/library/ms793814.aspx (pre-operation
callback specifics)
http://msdn2.microsoft.com/en-us/library/ms793809.aspx (post-operation
callback specifics)

The Design Guide has a bunch of info in it too:

http://msdn2.microsoft.com/en-us/library/ms793580.aspx

I’ve had these pages up just about constantly for the last several days,
I hope they bring you as much joy as they’ve brought me :wink:

~Eric

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Tuesday, August 07, 2007 2:40 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Is IRQL==PASSIVE_LEVEL for PreOperationCallback()?

Hi,

Is this correct assumption that PreOperationCallback function is always
runs in IRQL=PASSIVE_LEVEL?

What about PostOperationCallback()? Can we be in any IRQL level?
How do we deal with the functions that needs to be in different IRQ
level that what we currently are?

Thanks for your help
Payman


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars (including our new
fs mini-filter seminar) visit:
http://www.osr.com/seminars

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

Hi Payman!

<IRQL=PASSIVE_LEVEL?>>

No.

Please go through the topic “Dispatch Routine IRQL and thread context” in WDK.

<>

PostOperationCallback is called at IRQL<=DISPATCH_LEVEL in arbitrary thread context. However, Post Callback for IRP_MJ_CREATE is always called at PASSIVE_LEVEL in the same thread context that originated the operation.

<>

If you want to use functions that can be called only at an IRQL which is lower than the current IRQL, you need to post it to worker thread.
Again, this depends on certain conditions.

Regards!

Ayush Gupta
K7 Computing Pvt. Ltd.
www.k7computing.com

Guys, thanks for your replies.

So if I want to call FltQueryInformationFile() from the PreOPerattion, I need to create a worker thread and run the that function from that thread. Is this correct?
Is there any other way to do that?

Payman

Payman

Actually, it depends on what PreOp you are in. For instance CREATE is
always PASSIVE, most of the other IRP’s can reasonably be expected to be
PASSIVE, and only READ / WRITE typically end up as APC_LEVEL. So depending
on what you are intending, you can potentially do this.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

wrote in message news:xxxxx@ntfsd…
> Guys, thanks for your replies.
>
> So if I want to call FltQueryInformationFile() from the PreOPerattion, I
> need to create a worker thread and run the that function from that
> thread. Is this correct?
> Is there any other way to do that?
>
> Payman
>
>
> Payman
>
>

Hi!

<always PASSIVE, most of the other IRP’s can reasonably be expected to be
PASSIVE, and only READ / WRITE typically end up as APC_LEVEL. So depending
on what you are intending, you can potentially do this.>>

To be more specific, pre-callback for Paging READS and WRITES come at
APC_LEVEL.
If it’s a non paging Read/Write, it will be at PASSIVE_LEVEL.
In fact, pre callbacks for all paging I/Os are called at APC_LEVEL. This
includes Paging DeviceControl, paging FsControl, paging Read, paging Write.

First check the IRQL in the PreCallback routine and then decide whether to
post it to a worker thread or not. Because AFAIK, the worker threads are
limited so if you can do the work there itself you should do it instead of
posting it to a worker thread.
Also check for TopLevelIrp.

Regards!

Ayush Gupta
K7 Computing Pvt. Ltd.
www.k7computing.com

What IRQL will IRP_MJ_SET_INFORMATION and IRP_MJ_CLEANUP run at?
In general is there any documentation on which IRP runs on which IRQL?

Thank you so much again guys
Payman

Hi!

<In general is there any documentation on which IRP runs on which IRQL?>>

Read the topic “Dispatch Routine IRQL and thread context” in WDK documentation.
You will find it on MSDN site also.

Regards!

Ayush Gupta
K7 Computing Pvt. Ltd.
www.k7computing.com

Reasonably expected for a release version, or for throwing together a
proof of concept? If you call it at APC_LEVEL, it will cause a BSOD,
right?

~Eric

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Tuesday, August 07, 2007 4:00 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] Is IRQL==PASSIVE_LEVEL for PreOperationCallback()?

Actually, it depends on what PreOp you are in. For instance CREATE is
always PASSIVE, most of the other IRP’s can reasonably be expected to be
PASSIVE, and only READ / WRITE typically end up as APC_LEVEL. So
depending on what you are intending, you can potentially do this.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

Thank you very much for your replies. It was really helpful.
Payman

Work item is enough.


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

wrote in message news:xxxxx@ntfsd…
> Guys, thanks for your replies.
>
> So if I want to call FltQueryInformationFile() from the PreOPerattion, I need
to create a worker thread and run the that function from that thread. Is this
correct?
> Is there any other way to do that?
>
> Payman
>
>
> Payman
>
>