2.2.10 SMB2 TREE_CONNECT Response
The SMB2 TREE_CONNECT Response packet is sent by the server when an SMB2 TREE_CONNECT request is processed successfully by the server. The server MUST set the TreeId of the newly created tree connect in the SMB 2 Protocol header of the response. This response is composed of an SMB2 Packet Header (section 2.2.1) that is followed by this response structure.
StructureSize (2 bytes): The server MUST set this field to 16, indicating the size of the response structure, not including the header.
ShareType (1 byte): The type of share being accessed. This field MUST contain one of the following values.
Physical disk share.
Named pipe share.
Reserved (1 byte): This field MUST NOT be used and MUST be reserved. The server MUST set this to 0, and the client MUST ignore it on receipt.
ShareFlags (4 bytes): This field contains properties for this share.
This field MUST contain one of the following offline caching properties: SMB2_SHAREFLAG_MANUAL_CACHING, SMB2_SHAREFLAG_AUTO_CACHING, SMB2_SHAREFLAG_VDO_CACHING and SMB2_SHAREFLAG_NO_CACHING.
For more information about offline caching, see [OFFLINE].
This field MUST contain zero or more of the following values: SMB2_SHAREFLAG_DFS, SMB2_SHAREFLAG_DFS_ROOT, SMB2_SHAREFLAG_RESTRICT_EXCLUSIVE_OPENS, SMB2_SHAREFLAG_FORCE_SHARED_DELETE, SMB2_SHAREFLAG_ALLOW_NAMESPACE_CACHING, SMB2_SHAREFLAG_ACCESS_BASED_DIRECTORY_ENUM, SMB2_SHAREFLAG_FORCE_LEVELII_OPLOCK and SMB2_SHAREFLAG_ENABLE_HASH.
Descriptions of the individual flags follow.
The client can cache files that are explicitly selected by the user for offline use.
The client can automatically cache files that are used by the user for offline access.
The client can automatically cache files that are used by the user for offline access and can use those files in an offline mode even if the share is available.
Offline caching MUST NOT occur.
The specified share is present in a Distributed File System (DFS) tree structure. The server SHOULD set the SMB2_SHAREFLAG_DFS bit in the ShareFlags field if the per-share property Share.IsDfs is TRUE.
The specified share is present in a DFS tree structure. The server SHOULD set the SMB2_SHAREFLAG_DFS_ROOT bit in the ShareFlags field if the per-share property Share.IsDfs is TRUE.
The specified share disallows exclusive file opens that deny reads to an open file.
The specified share disallows clients from opening files on the share in an exclusive mode that prevents the file from being deleted until the client closes the file.
The client MUST ignore this flag.
The server will filter directory entries based on the access permissions of the client.
The server will not issue exclusive caching rights on this share.<29>
The share supports hash generation for branch cache retrieval of data. For more information, see section 184.108.40.206. This flag is not valid for the SMB 2.0.2 dialect.
The share supports v2 hash generation for branch cache retrieval of data. For more information, see section 220.127.116.11. This flag is not valid for the SMB 2.0.2 and SMB 2.1 dialects.
The server requires encryption of remote file access messages on this share, per the conditions specified in section 18.104.22.168.11. This flag is only valid for the SMB 3.x dialect family.
Capabilities (4 bytes): Indicates various capabilities for this share. This field MUST be constructed using the following values.
The specified share is present in a DFS tree structure. The server MUST set the SMB2_SHARE_CAP_DFS bit in the Capabilities field if the per-share property Share.IsDfs is TRUE.
The specified share is continuously available. This flag is only valid for the SMB 3.x dialect family.
The specified share is present on a server configuration which facilitates faster recovery of durable handles. This flag is only valid for the SMB 3.x dialect family.
The specified share is present on a server configuration which provides monitoring of the availability of share through the Witness service specified in [MS-SWN]. This flag is only valid for the SMB 3.x dialect family.
The specified share is present on a server configuration that allows dynamic changes in the ownership of the share. This flag is not valid for the SMB 2.0.2, 2.1, and 3.0 dialects.
MaximalAccess (4 bytes): Contains the maximal access for the user that establishes the tree connect on the share based on the share's permissions. This value takes the form as specified in section 22.214.171.124.