Multiple IRP_MN_QUERY_DIRECTORY requests

Hi,

I need to query a directory contents from my filter.

How I can maintain the query state for open instance of
a directory between requests?

On the FAT volume the FileIndex for each entry is returned,
but on NTFS it is always zero. It there any other ways?

I will be very appreciated for any help. Thanks in advance.

Leonid.

Track per file object state. That’s how the file systems do it. In our own
filters of this type we end up tracking both per file (FsContext) as well as
per open instance (file object) based state.

Regards,

Tony

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

-----Original Message-----
From: Leonid Zhigunov [mailto:xxxxx@progate.spb.ru]
Sent: Wednesday, July 17, 2002 4:52 AM
To: File Systems Developers
Subject: [ntfsd] Multiple IRP_MN_QUERY_DIRECTORY requests

Hi,

I need to query a directory contents from my filter.

How I can maintain the query state for open instance of
a directory between requests?

On the FAT volume the FileIndex for each entry is returned,
but on NTFS it is always zero. It there any other ways?

I will be very appreciated for any help. Thanks in advance.

Leonid.


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

Thank you Tony,

Sorry, but I do not understand what exactly you mean?
I keep an analog of FCB and CCB for each opened file.

The situation is following:
I receive a QUERY_DIRECTORY request for some directory
which I’m interested in. For such directory there is another,
“shadow”, directory. First, I need to query original directory
and then to query “shadow” directory in order to add some
entries from it to the original request.

What can I do is to open “shadow” with ZwCreateFile and
use the handle for querying its contents with ZwQueryDirectoryFile.
In order to preserve query context between different QUERY_DIRECTORY
requests for the original directory object I need to keep this handle opened
until the CLEANUP of the original directory object.

It works ok, but I am affraid that some potential problems can arrise.

For example, a driver can issue an QUERY_DIRECTORY IRP with
FileIndex specified. It can lead to inorrect behavior.

I would be great if you could comment it and/or suggest other
ways to to this.

Thanks in advance,
Leonid.

“Tony Mason” wrote in message news:xxxxx@ntfsd…
>
> Track per file object state. That’s how the file systems do it. In our
own
> filters of this type we end up tracking both per file (FsContext) as well
as
> per open instance (file object) based state.
>
> Regards,
>
> Tony
>
> Tony Mason
> Consulting Partner
> OSR Open Systems Resources, Inc.
> http://www.osr.com
>
>
> -----Original Message-----
> From: Leonid Zhigunov [mailto:xxxxx@progate.spb.ru]
> Sent: Wednesday, July 17, 2002 4:52 AM
> To: File Systems Developers
> Subject: [ntfsd] Multiple IRP_MN_QUERY_DIRECTORY requests
>
> Hi,
>
> I need to query a directory contents from my filter.
>
> How I can maintain the query state for open instance of
> a directory between requests?
>
> On the FAT volume the FileIndex for each entry is returned,
> but on NTFS it is always zero. It there any other ways?
>
> I will be very appreciated for any help. Thanks in advance.
>
> Leonid.
>
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@osr.com
> To unsubscribe send a blank email to %%email.unsub%%
>
>

Leonid,

For each new file object, open the underlying directory. That way you have
a unique handle for each open instance in the application.

Regards,

Tony

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

Hope to see you at the next OSR file systems class in San Jose, CA September
16, 2002!

-----Original Message-----
From: Leonid Zhigunov [mailto:xxxxx@progate.spb.ru]
Sent: Wednesday, July 17, 2002 9:25 AM
To: File Systems Developers
Subject: [ntfsd] Re: Multiple IRP_MN_QUERY_DIRECTORY requests

Thank you Tony,

Sorry, but I do not understand what exactly you mean?
I keep an analog of FCB and CCB for each opened file.

The situation is following:
I receive a QUERY_DIRECTORY request for some directory
which I’m interested in. For such directory there is another,
“shadow”, directory. First, I need to query original directory
and then to query “shadow” directory in order to add some
entries from it to the original request.

What can I do is to open “shadow” with ZwCreateFile and
use the handle for querying its contents with ZwQueryDirectoryFile.
In order to preserve query context between different QUERY_DIRECTORY
requests for the original directory object I need to keep this handle opened
until the CLEANUP of the original directory object.

It works ok, but I am affraid that some potential problems can arrise.

For example, a driver can issue an QUERY_DIRECTORY IRP with
FileIndex specified. It can lead to inorrect behavior.

I would be great if you could comment it and/or suggest other
ways to to this.

Thanks in advance,
Leonid.

“Tony Mason” wrote in message news:xxxxx@ntfsd…
>
> Track per file object state. That’s how the file systems do it. In our
own
> filters of this type we end up tracking both per file (FsContext) as well
as
> per open instance (file object) based state.
>
> Regards,
>
> Tony
>
> Tony Mason
> Consulting Partner
> OSR Open Systems Resources, Inc.
> http://www.osr.com
>
>
> -----Original Message-----
> From: Leonid Zhigunov [mailto:xxxxx@progate.spb.ru]
> Sent: Wednesday, July 17, 2002 4:52 AM
> To: File Systems Developers
> Subject: [ntfsd] Multiple IRP_MN_QUERY_DIRECTORY requests
>
> Hi,
>
> I need to query a directory contents from my filter.
>
> How I can maintain the query state for open instance of
> a directory between requests?
>
> On the FAT volume the FileIndex for each entry is returned,
> but on NTFS it is always zero. It there any other ways?
>
> I will be very appreciated for any help. Thanks in advance.
>
> Leonid.
>
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@osr.com
> To unsubscribe send a blank email to %%email.unsub%%
>
>


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