Message 3 of 10
06 Jan 17 11:11
Join Date: 10 Jul 2002
Posts To This List: 982
FltCreateFile and NotifyChangeDirectory
Activity that causes directory change notifications (DCNs) to trigger when
they wouldn't otherwise can certainly cause application compatibility
issues. We have been burned by this enough times* that I have a little app I
run that tells me whenever a DCN fires, useful during development to make
sure I'm not doing something to inadvertently cause a DCN.
There's not always a good answer to this, it's not like you can get Explorer
to change its behavior for you.
With respect to your situation, I lost you a bit at the end. Are you saying
the DCN buffer indicated that \\mypc\folder\New Text Document.txt was
modified? Does this file actually get created or just the redirected files?
Have you tried reproducing the Explorer behavior without your filter? If the
problem really is that you're creating a file in a subdirectory while the
edit control is active, you should be able to reproduce this behavior
without any of your code present. While this doesn't give you an answer, it
would confirm that this is indeed a DCN problem (and that the DCN isn't just
a red herring).
*We had a bug (once!) where simply opening a file caused us to trigger a
DCN. This caused Explorer to think that the file changed and open the file
again. Which caused us to trigger a DCN...Which caused Explorer to think
that the file changed...
wrote in message news:102062@ntfsd...
I wrote a minifilter that redirects files that are new to another folder in
the same volume.
Suppose you have a new created file c:\temp\file.txt then I redirect it to
c:\temp\redirected\ABA_file.txt and at the same time I create some internal
.dat file in c:\temp\redirected\ )
What I do is to apply the reparse logic (STATUS_REPARSE/IO_REPARSE) in the
PreCreate event and I also handle the rename event.
This basically works OK. The problem is when the files are in a network
Here the redirection works pretty nice... but if the user in explorer right
clicks on a folder and select "new text document" then first explorer calls
Create with the "New Text Document.txt" (here I do the redirection from
"\\mypc\folder\New Text Document.txt" to "\\mypc\folder\Redirected\ABA_New
Text Document.txt" AND I CREATE A FILE
\\mypc\folder\Redirected\instruction.dat), then explorer shows the edit
control allowing the user to edit that, then after few seconds if the user
does not do anything, explorer finishes editing the file not allowing the
user to change it name.
I discovered the problem comes from the fact that I create the
\\mypc\folder\Redirected\instruction.dat file. This triggers a
NotifyChangeDirectory, and explorer does something that forces it to finish
editing the file. I used process monitor and I saw that the QueryDirectory
event was triggered passing the path of \\mypc\folder\New Text Document.txt
and in this case in the PRE event I create \\mypc\folder\New Text
Document.txt and in the post event I delete \\mypc\folder\New Text
Document.txt just to force explorer to believe that it exists... however
this does not help.
Any other thoughts?