Sending IRP to lower drivers at APC level

Since I haven’t received any responses, I’m trying
to formulate my question better.

In a filter driver at APC level (paging IO
read/write),
if I create and send a read or write IRP to the
driver below me using FltPerformSynchronousIo(),
will it work?

Thank you, and sorry for repeating my question here.

Seva


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

> In a filter driver at APC level (paging IO

read/write),
if I create and send a read or write IRP to the
driver below me using FltPerformSynchronousIo(),
will it work?

You should not block in paging IO paths, this can lead to deadlocks.

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

Thanks, Maxim.

Do I understand correctly that it is not possible
to do any additional (generated by me) IO
in a paging IO path?

Thanks,
Seva

— “Maxim S. Shatskih”
wrote:

> > In a filter driver at APC level (paging IO
> > read/write),
> > if I create and send a read or write IRP to the
> > driver below me using FltPerformSynchronousIo(),
> > will it work?
>
> You should not block in paging IO paths, this can
> lead to deadlocks.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

You can perform additional I/O. Drivers below you should be prepared to
receive paging I/O operations (at APC level or with special kernel APCs
disabled).

I/O completion processing is “special” for paging I/O however, so you
need to be careful (paging I/O does not use an APC to perform
completion, but rather signals an event directly.)

What you cannot do is call any functions that restrict themselves to <
APC_LEVEL (e.g., ZwReadFile) because those rely upon APCs for completion
when the call is posted. Indeed, the purpose of
FltPerformSynchronousIo is for exactly those cases (it does not depend
upon APCs for completion.)

Interestingly, FltReadFile is documented as being usable at IRQL ==
PASSIVE_LEVEL, so I’m guessing either there is a bug in the
documentation (because it requires special kernel APCs be enabled) or
this call can be used in the Paging I/O path for W2K3 (where IRQL =
PASSIVE_LEVEL but special kernel APCs are disabled.)

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

> Do I understand correctly that it is not possible

to do any additional (generated by me) IO
in a paging IO path?

Do it async - i.e. register the completion routine and pass your IO down. Then
queue the work item from the completion routine and do the post-processing,
including the original paging IO.

You cannot wait (block) in paging IO paths - this stalls the OS’s MPW thread,
which can lead to a deadlock.

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

When I pass my IO down, should I keep
the PAGING_IO flag?
And if yes, should I do my IO in multiples of 4K?

Thanks,
Seva

— “Maxim S. Shatskih”
wrote:

> > Do I understand correctly that it is not possible
> > to do any additional (generated by me) IO
> > in a paging IO path?
>
> Do it async - i.e. register the completion routine
> and pass your IO down. Then
> queue the work item from the completion routine and
> do the post-processing,
> including the original paging IO.
>
> You cannot wait (block) in paging IO paths - this
> stalls the OS’s MPW thread,
> which can lead to a deadlock.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com