FsRtlNotifyFullChangeDirectory and FASTFAT

Hi all,

I am implementing notify change request in my file system, and I am trying
to understand the code in fastfat.

The third argument to FsRtlNotifyFullChangeDirectory() is called FsContext,
and the docs say that it is a “Pointer to a unique value assigned by the
file system to identify the notify structure to be created as belonging to a
particular file object”. What does “file object” mean? A FILE_OBJECT
instance or a unique file in my file system?

That is, if I receive IRP_MN_NOTIFY_CHANGE_DIRECTORY IRPs for different
FILE_OBJECT that share the same FCB, then should the third argument to
FsRtlNotifyFullChangeDirectory() that I will make in response to each
IRP_MN_NOTIFY_CHANGE_DIRECTORY be the same or different?

Looking at how fastfat implements this does not provide an answer. Fastfat
calls this FsRtl function in three places: cleanup.c(283), fileinfo.c(2453),
and dirctrl.c(1481) [IFS kit version 3790, WXP code]. In the first two
cases, it uses FileObject->FsContext as the third argument, but in the last
cases it uses Ccb, which is FileObject->FsContext2. Is this a bug in
fastfat, or I am missing something?

Looking at how cdfs implements this, it call
FsRtlNotifyFullChangeDirectory() only once at dirctrl.c(851), passing the
Ccb, or FileObject->FsContext2, as the third argument.

Thanks.

=================================================
Roger Tawa
http://tawacentral.net/
[One thing about paradigms: shift happens.]
[When you stop, you’re done.]