Finally i found out why!

Well, seems my quest is over.
The problem was, as Neal correctly pointed out :

You can only specify the file name parameter on the first call. It
caches the information and future changes to the parameter are ignored.
You would need to close the directory handle and re-open it to change
it.

Infact, i used the same file handle (since its KERNEL_HANDLE and its
shared among all my functions, to avoid context problems) and
ZwQueryDirectoryFile was used before too with no filemask. Using a
filemask later on the same handle (which i keep open since shutdown)
results in what i’ve seen : the filemask is ignored, or (better said)
the first one with which ZwQueryDirectoryFile was called is used.
Reissuing a createfile in the my function,and using a new handle
everytime fixed the problem.

So, now a i’d like little bit of explanation :
this means such filemask stuff is chained to a specifical handle ? Is
this by design ? the information is cached in the fs itself on a handle
basis ? I bet this is a documentation issue too… nothing in the doc
tells anything about the subject.

Thanks for all, anyway! :slight_smile:

regards,
Valerio

This certainly is by design. Perhaps I’ve been doing this too long, but
I don’t even think about this at this point (the purpose of
FileObject->FsContext2 is to store file-object related instance
information, and directory enumeration info, including the search
string, is stored there.)

The file systems store away that search string. It would be nice if the
protocol had allowed that to be changed (perhaps on an SL_RESTART_SCAN,
for example) but it did not.

The piece that was missing here (for me at least) is that you sent a
chunk of code that seemed to open and then read the directory. That you
opened and read, and then read again, was missing. This often happens
when people ask questions here - they try to summarize the problem and
in so doing miss what (to them) seems an insignificant step that in fact
is very significant. It is easy to do…

Glad to hear that you found the problem.

Regards,

Tony

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

Looking forward to seeing you at the Next OSR File Systems Class October
18, 2004 in Silicon Valley!

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of valerino
Sent: Wednesday, September 29, 2004 8:19 PM
To: ntfsd redirect
Subject: [ntfsd] Finally i found out why!

Well, seems my quest is over.
The problem was, as Neal correctly pointed out :

You can only specify the file name parameter on the first call. It
caches the information and future changes to the parameter are
ignored.
You would need to close the directory handle and re-open it to change
it.

Infact, i used the same file handle (since its KERNEL_HANDLE and its
shared among all my functions, to avoid context problems) and
ZwQueryDirectoryFile was used before too with no filemask. Using a
filemask later on the same handle (which i keep open since shutdown)
results in what i’ve seen : the filemask is ignored, or (better said)
the first one with which ZwQueryDirectoryFile was called is used.
Reissuing a createfile in the my function,and using a new handle
everytime fixed the problem.

So, now a i’d like little bit of explanation :
this means such filemask stuff is chained to a specifical handle ? Is
this by design ? the information is cached in the fs itself on a handle
basis ? I bet this is a documentation issue too… nothing in the doc
tells anything about the subject.

Thanks for all, anyway! :slight_smile:

regards,
Valerio


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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