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?
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.
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
~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
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.
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?
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.
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 > >
<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.
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.
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 > >