Question on preventing my driver from filtering it's own transactions...

Howdy!

I have been working to resolve this problem without much success. The
issue is as follows:

* My filter driver filters out IRP_MJ_CREATEs to perform work relative to
specific types of creates
* In the course of events, I need to create a folder on a volume, so I use
IoCreateFile(…) and the directory gets created.

The problem is that the IoCreateFile(…) generates an IRP_MJ_CREATE irp
that my driver is then going to filter.

I tried to prevent the driver from filtering any IRP that had
tail.overlay.thread == PsGetCurrentThread(), but this doesn’t work
properly. This is because when my driver is operating in the same thread
as an IRP issued from user-land, it can potentially ignore these IRPs as
well as the ones I create.

How do I go about “tagging” an IRP with information showing that it has
been generated by my own driver (and thus I should ignore it)? In other
transactions I would roll my own IRP, but in previous e-mails on another
issue it was recommended that I do not attempt to roll a create irp as
these are quite complex. So, as you can see I am a bit stuck.

thanks. - jb


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

Create a linked list or some other similar structure in the driver’s unpaged
pool. Before you call IoCreateFile, add the thread ID to the linked list.
At the start of IRP_MJ_CREATE, check the linked list for a matching thread
ID. If a match is found, pass the call down, otherwise intercept.

This works just great until you work with another driver that makes a
similar re-entrant request but in a different thread. Then this technique
won’t work. This has been discussed in the past, and I don’t know if a
clean resolution has been found. From what I recall, rolling your own IRPs
is the best technique to avoid such issues, but is also the hardest to
implement.

----- Original Message -----
From:
To: “File Systems Developers”
Sent: Wednesday, February 14, 2001 2:59 PM
Subject: [ntfsd] Question on preventing my driver from filtering it’s own
transactions…

> Howdy!
>
> I have been working to resolve this problem without much success. The
> issue is as follows:
>
> * My filter driver filters out IRP_MJ_CREATEs to perform work relative to
> specific types of creates
> * In the course of events, I need to create a folder on a volume, so I use
> IoCreateFile(…) and the directory gets created.
>
> The problem is that the IoCreateFile(…) generates an IRP_MJ_CREATE irp
> that my driver is then going to filter.
>
> I tried to prevent the driver from filtering any IRP that had
> tail.overlay.thread == PsGetCurrentThread(), but this doesn’t work
> properly. This is because when my driver is operating in the same thread
> as an IRP issued from user-land, it can potentially ignore these IRPs as
> well as the ones I create.
>
> How do I go about “tagging” an IRP with information showing that it has
> been generated by my own driver (and thus I should ignore it)? In other
> transactions I would roll my own IRP, but in previous e-mails on another
> issue it was recommended that I do not attempt to roll a create irp as
> these are quite complex. So, as you can see I am a bit stuck.
>
> thanks. - jb
>
> —
> You are currently subscribed to ntfsd as: xxxxx@texar.com
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


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