Partager via


2.2.35 SMB2 CHANGE_NOTIFY Request

The SMB2 CHANGE_NOTIFY Request packet is sent by the client to request change notifications on a directory. This request consists of an SMB2 header, as specified in section 2.2.1, followed by this request structure:


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

StructureSize

Flags

OutputBufferLength

FileId

...

...

...

CompletionFilter

Reserved

StructureSize (2 bytes): The client MUST set this field to 32, indicating the size of the request structure, not including the header.

Flags (2 bytes): Flags indicating how the operation MUST be processed. This field MUST be either zero or the following value:

Value

Meaning

SMB2_WATCH_TREE

0x0001

The request MUST monitor changes on any file or directory contained beneath the directory specified by FileId.

OutputBufferLength (4 bytes): The maximum number of bytes the server is allowed to return in the SMB2 CHANGE_NOTIFY Response (section 2.2.36).

FileId (16 bytes): An SMB2_FILEID identifier of the directory to monitor for changes.

CompletionFilter (4 bytes): Specifies the types of changes to monitor. It is valid to choose multiple trigger conditions. In this case, if any condition is met, the client is notified of the change and the CHANGE_NOTIFY operation is completed. This field MUST be constructed using the following values:

Value

Meaning

FILE_NOTIFY_CHANGE_FILE_NAME

0x00000001

The client is notified if a file-name changes.

FILE_NOTIFY_CHANGE_DIR_NAME

0x00000002

The client is notified if a directory name changes.

FILE_NOTIFY_CHANGE_ATTRIBUTES

0x00000004

The client is notified if a file's attributes change. Possible file attribute values are specified in [MS-FSCC] section 2.6.

FILE_NOTIFY_CHANGE_SIZE

0x00000008

The client is notified if a file's size changes.

FILE_NOTIFY_CHANGE_LAST_WRITE

0x00000010

The client is notified if the last write time of a file changes.

FILE_NOTIFY_CHANGE_LAST_ACCESS

0x00000020

The client is notified if the last access time of a file changes.

FILE_NOTIFY_CHANGE_CREATION

0x00000040

The client is notified if the creation time of a file changes.

FILE_NOTIFY_CHANGE_EA

0x00000080

The client is notified if a file's extended attributes (EAs) change.

FILE_NOTIFY_CHANGE_SECURITY

0x00000100

The client is notified of a file's access control list (ACL) settings change.

FILE_NOTIFY_CHANGE_STREAM_NAME

0x00000200

The client is notified if a named stream is added to a file.

FILE_NOTIFY_CHANGE_STREAM_SIZE

0x00000400

The client is notified if the size of a named stream is changed.

FILE_NOTIFY_CHANGE_STREAM_WRITE

0x00000800

The client is notified if a named stream is modified.

Reserved (4 bytes): This field MUST NOT be used and MUST be reserved. The client MUST set this field to 0, and the server MUST ignore it on receipt.