共用方式為


2.1.5.11 Server Requests Change Notifications for a Directory

The server provides:

  • Open: An Open of a DirectoryStream or ViewIndexStream.

  • OutputBufferSize: The maximum number of bytes to return in OutputBuffer.

  • WatchTree: A Boolean indicating whether the directory is monitored recursively.

  • CompletionFilter: A 32-bit unsigned integer composed of flags indicating the types of changes to monitor as specified in [MS-SMB2] section 2.2.35.

On completion, the object store MUST return:

  • Status: An NTSTATUS code that specifies the result.

  • OutputBuffer: An array of bytes containing the notification data.

  • ByteCount: The count of the bytes in the array.

Pseudocode for the operation is as follows:

  • The Open.File.Volume.ChangeNotifyList MUST be searched for a ChangeNotifyEntry where ChangeNotifyEntry.OpenedDirectory matches Open.

  • If there were no matching ChangeNotifyEntries, one MUST be constructed so that:

    • ChangeNotifyEntry.OpenedDirectory points to Open.

    • ChangeNotifyEntry.WatchTree is set to WatchTree.

    • ChangeNotifyEntry.CompletionFilter is set to CompletionFilter.

    • ChangeNotifyEntry.NotifyEventList is initialized to an empty list.

    • Insert ChangeNotifyEntry at the end of Open.File.Volume.ChangeNotifyList.

  • EndIf

  • Insert operation into CancelableOperations.CancelableOperationList.

  • Wait for a Change Notify as specified in section 2.1.5.11.1