Change Notifications on Dokan

85 views
Skip to first unread message

Arnett

unread,
Apr 23, 2012, 10:31:20 AM4/23/12
to do...@googlegroups.com
Hi guys, I am changing Dokan for a file system that I am working on and using IFS Test to test it. There is a test that tests the notification about the deletion of a file, the NotificationDeleteTest. I took a look in FastFAT implementation, and I found that FastFAT does that with these calls:


* This happens when a directory is removed:

FatNotifyReportChange( IrpContext,
                                                   Vcb,
                                                   Fcb,
                                                   FILE_NOTIFY_CHANGE_DIR_NAME,
                                                   FILE_ACTION_REMOVED );

* This happens when a file is removed:

FatNotifyReportChange( IrpContext,
                                                   Vcb,
                                                   Fcb,
                                                   FILE_NOTIFY_CHANGE_FILE_NAME,
                                                   FILE_ACTION_REMOVED );


FatNotifyReportChange is implemented as a macro:


#define FatNotifyReportChange(I,V,F,FL,A) {                                                         \
    if ((F)->FullFileName.Buffer == NULL) {                                                         \
        FatSetFullFileNameInFcb((I),(F));                                                           \
    }                                                                                               \
    ASSERT( (F)->FullFileName.Length != 0 );                                                        \
    ASSERT( (F)->FinalNameLength != 0 );                                                            \
    ASSERT( (F)->FullFileName.Length > (F)->FinalNameLength );                                      \
    ASSERT( (F)->FullFileName.Buffer[((F)->FullFileName.Length - (F)->FinalNameLength)/sizeof(WCHAR) - 1] == L'\\' ); \
    FsRtlNotifyFullReportChange( (V)->NotifySync,                                                   \
                                 &(V)->DirNotifyList,                                               \
                                 (PSTRING)&(F)->FullFileName,                                       \
                                 (USHORT) ((F)->FullFileName.Length -                               \
                                           (F)->FinalNameLength),                                   \
                                 (PSTRING)NULL,                                                     \
                                 (PSTRING)NULL,                                                     \
                                 (ULONG)FL,                                                         \
                                 (ULONG)A,                                                          \
                                 (PVOID)NULL );                                                     \
}

Dokan has this procedure called DokanNotifyReportChange that is similar to FatNotifyReportChange. I called this procedure following the behavior of FastFAT but the notification is still not being sent. Has anyone worked with an issue related to this one? Should I do something else to send the notification?

Thanks in advance,
Arnett.
Reply all
Reply to author
Forward
0 new messages