Hi all,
I am implementing a virtual file system, that is, there is no associated h/w
device, and no VDOs or VPBs, only one CDO. From an NT service I define
drive letters, like P:, that points to the CDO by calling DefineDosDevice().
I am running on XP SP2.
The CDO is named “\Pifs”. The NT service defines drive letters like this:
DefineDosDevice( DDD_RAW, “P:”, “\Pifs\contextP;” )
DefineDosDevice( DDD_RAW, “Q:”, “\Pifs\contextQ;” )
When a win32 app opens “P:\test.txt”, my driver’s CREATE IRP sees
“\contextP;\test.txt”. And when a win32 app opens “Q:\test.txt”, my
driver’s CREATE IRP sees “\contextQ;\test.txt”. This seems good.
However, notifications don’t work. That is, if I have an Explorer open on
"P:", when I save to “P:\test.txt”, it does not get a file system
notification. I have the same results with fwatch (ReadDirectoryChangeW
sample app). Other than that, files can be opened, read, written to,
renamed, copied, closed. Directories can be enumerated.
I noticed that when Explorer browses to “P:", it sends a DIR_CRTL IRP with
IRP_MN_NOTIFY_CHANGE_DIRECTORY, and I call FsRtlNotifyFullChangeDirectory()
with the full directory name=”\contextP;", filter=0x17, watchtree=no. When
“P:\test.txt” is saved to, I call FsRtlNotifyFullReportChange() with the
full target name=“\contextP;\test.txt”, target name offset=11, filter=0x34,
action=3. Since the filter mask bits overlap and the path of the changed
file “descends” from the directory, I would expect
FsRtlNotifyFullReportChange() to complete the DIR_CTRL IRP.
However, if I define a drive letter in the NT service like this:
DefineDosDevice( DDD_RAW, “P:”, “\Pifs” )
notifications work. Create IRPs sees paths like “\test.txt”. In the
example above, FsRtlNotifyFullChangeDirectory() is called with the full
directory path=“", and FsRtlNotifyFullReportChange() with the full target
path=”\test.txt" and target name offset=1. But I don’t want to do this
because then I can’t have more than one drive letter.
Why would a symbolic link for a drive letter that points to the CDO itself
cause notifications to behave differently from a symbolic link that points
“into” the namespace of that CDO?
Thanks.
=================================================
Roger Tawa
http://tawacentral.net/
[One thing about paradigms: shift happens.]
[When you stop, you’re done.]