FsRtlNotifyFullChangeDirectory routine

The FsRtlNotifyFullChangeDirectory routine creates a notify structure for a notification request and adds it to the specified notify list.


VOID FsRtlNotifyFullChangeDirectory(
  _In_     PNOTIFY_SYNC               NotifySync,
  _In_     PLIST_ENTRY                NotifyList,
  _In_     PVOID                      FsContext,
  _In_     PSTRING                    FullDirectoryName,
  _In_     BOOLEAN                    WatchTree,
  _In_     BOOLEAN                    IgnoreBuffer,
  _In_     ULONG                      CompletionFilter,
  _In_opt_ PIRP                       NotifyIrp,
  _In_opt_ PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback,
  _In_opt_ PSECURITY_SUBJECT_CONTEXT  SubjectContext


NotifySync [in]

A pointer to an opaque synchronization object for the notify list for the current volume.

NotifyList [in]

A pointer to the head of a notify list. Each element in the list is an opaque notify structure.

FsContext [in]

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. If a TraverseCallback routine is supplied, FsContext is passed as the NotifyContext parameter to that routine.

FullDirectoryName [in]

A pointer to an ANSI or Unicode string that contains the full name for the directory associated with this notify structure. Ignored if NotifyIrp is NULL.

WatchTree [in]

Set to TRUE if all subdirectories of this directory should also be watched. Set to FALSE if only the directory itself is to be watched. Ignored if NotifyIrp is NULL.

IgnoreBuffer [in]

Set to TRUE to ignore any user buffers and force the directory to be reenumerated. This action speeds the operation. Ignored if NotifyIrp is NULL.

CompletionFilter [in]

Bitmask of flags that specify the types of changes to files or subdirectories that should cause the queue of pending notify IRPs to be completed. The possible flag values are described following.



A file has been added, deleted, or renamed in this directory.


A subdirectory has been created, removed, or renamed.


This directory's name has changed.


The value of an attribute of this file, such as last access time, has changed.


This file's size has changed.


This file's last modification time has changed.


This file's last access time has changed.


This file's creation time has changed.


This file's extended attributes have been modified.


This file's security information has changed.


A file stream has been added, deleted, or renamed in this directory.


This file stream's size has changed.


This file stream's data has changed.


CompletionFilter is ignored if NotifyIrp is NULL.

NotifyIrp [in, optional]

A pointer to the IRP to complete on notify change. If NotifyIrp is NULL, this means that the file stream represented by this file object is being deleted.

TraverseCallback [in, optional]

Optional pointer to a callback routine to be invoked when a change occurs in a subdirectory being watched in a directory tree. This lets the file system check whether the watcher has traverse access to that directory. Such a caller-supplied routine is declared as follows:

    IN PVOID NotifyContext,                     // FsContext
    IN PVOID TargetContext,                     // Context pointer
    IN PSECURITY_SUBJECT_CONTEXT SubjectContext // SubjectContext

For more information about the TargetContext parameter, see the TargetContext parameter of FsRtlNotifyFullReportChange. TraverseCallback is ignored if NotifyIrp is NULL.

SubjectContext [in, optional]

A pointer to a context structure to be passed to TraverseCallback. FsRtlNotifyFullChangeDirectory releases the context and frees the structure after using it. Ignored if NotifyIrp is NULL. If a TraverseCallback routine is supplied, SubjectContext is passed as the SubjectContext parameter to that routine.

Return value



FsRtlNotifyFullChangeDirectory is called by a file system that has received a notify change request. This request is received as an IRP with major function code IRP_MJ_DIRECTORY_CONTROL, minor function code IRP_MN_NOTIFY_CHANGE_DIRECTORY.

If NotifyIrp is NULL, FsRtlNotifyFullChangeDirectory checks whether the notify list contains a pending IRP that refers to this file object and, if so, completes it with STATUS_DELETE_PENDING.

If NotifyIrp is not NULL, FsRtlNotifyFullChangeDirectory does the following:

  • Checks whether the file object has undergone cleanup. If so, FsRtlNotifyFullChangeDirectory completes the notify IRP with status STATUS_NOTIFY_CLEANUP.

  • If the file object has not undergone cleanup, FsRtlNotifyFullChangeDirectory checks whether the notify list for this volume already contains a notify structure for this change. If so, FsRtlNotifyFullChangeDirectory completes any pending IRPs. If not, FsRtlNotifyFullChangeDirectory marks the notify IRP as pending, creates a notify structure, and inserts it into the list.


Target platform



Rxprocs.h (include Ntifs.h)







See also




Send comments about this topic to Microsoft