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.


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

ShareType

Reserved

ShareFlags

Capabilities

MaximalAccess

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.

Value

Meaning

SMB2_SHARE_TYPE_DISK

0x01

Physical disk share.

SMB2_SHARE_TYPE_PIPE

0x02

Named pipe share.

SMB2_SHARE_TYPE_PRINT

0x03

Printer 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.

Value

Meaning

SMB2_SHAREFLAG_MANUAL_CACHING

0x00000000

The client can cache files that are explicitly selected by the user for offline use.

SMB2_SHAREFLAG_AUTO_CACHING

0x00000010

The client can automatically cache files that are used by the user for offline access.

SMB2_SHAREFLAG_VDO_CACHING

0x00000020

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.

SMB2_SHAREFLAG_NO_CACHING

0x00000030

Offline caching MUST NOT occur.

SMB2_SHAREFLAG_DFS

0x00000001

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.

SMB2_SHAREFLAG_DFS_ROOT

0x00000002

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.

SMB2_SHAREFLAG_RESTRICT_EXCLUSIVE_OPENS

0x00000100

The specified share disallows exclusive file opens that deny reads to an open file.

SMB2_SHAREFLAG_FORCE_SHARED_DELETE

0x00000200

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.

SMB2_SHAREFLAG_ALLOW_NAMESPACE_CACHING

0x00000400

The client MUST ignore this flag.

SMB2_SHAREFLAG_ACCESS_BASED_DIRECTORY_ENUM

0x00000800

The server will filter directory entries based on the access permissions of the client.

SMB2_SHAREFLAG_FORCE_LEVELII_OPLOCK

0x00001000

The server will not issue exclusive caching rights on this share.<29>

SMB2_SHAREFLAG_ENABLE_HASH_V1

0x00002000

The share supports hash generation for branch cache retrieval of data. For more information, see section 2.2.31.2. This flag is not valid for the SMB 2.0.2 dialect.

SMB2_SHAREFLAG_ENABLE_HASH_V2

0x00004000

The share supports v2 hash generation for branch cache retrieval of data. For more information, see section 2.2.31.2. This flag is not valid for the SMB 2.0.2 and SMB 2.1 dialects.

SMB2_SHAREFLAG_ENCRYPT_DATA

0x00008000

The server requires encryption of remote file access messages on this share, per the conditions specified in section 3.3.5.2.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.

Value

Meaning

SMB2_SHARE_CAP_DFS

0x00000008

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.

SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY

0x00000010

The specified share is continuously available. This flag is only valid for the SMB 3.x dialect family.

SMB2_SHARE_CAP_SCALEOUT

0x00000020

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.

SMB2_SHARE_CAP_CLUSTER

0x00000040

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.

SMB2_SHARE_CAP_ASYMMETRIC

0x00000080

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 2.2.13.1.

Show: