Partager via


2.2.9 SMB2 TREE_CONNECT Request

The SMB2 TREE_CONNECT Request packet is sent by a client to request access to a particular share on the server. This request is composed of an SMB2 Packet Header (section 2.2.1) that is 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/Reserved

PathOffset

PathLength

Buffer (variable)

...

StructureSize (2 bytes): The client MUST set this field to 9, indicating the size of the request structure, not including the header. The client MUST set it to this value regardless of how long Buffer[] actually is in the request being sent.

Flags/Reserved (2 bytes): This field is interpreted in different ways depending on the SMB2 dialect.

In the SMB 3.1.1 dialect, this field is interpreted as the Flags field, which indicates how to process the operation. This field MUST be constructed using the following values:

Value

Meaning

SMB2_TREE_CONNECT_FLAG_CLUSTER_RECONNECT

0x0001

When set, indicates that the client has previously connected to the specified cluster share using the SMB dialect of the connection on which the request is received.

SMB2_TREE_CONNECT_FLAG_REDIRECT_TO_OWNER

0x0002

When set, indicates that the client can handle synchronous share redirects via a Share Redirect error context response as specified in section 2.2.2.2.2. <31>

SMB2_TREE_CONNECT_FLAG_EXTENSION_PRESENT

0x0004

When set, indicates that a tree connect request extension, as specified in section 2.2.9.1, is present, starting at the Buffer field of this tree connect request.

If the dialect is not 3.1.1, then this field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.

PathOffset (2 bytes): The offset, in bytes, of the full share path name from the beginning of the packet header. The full share pathname is Unicode in the form "\\server\share" for the request. The server component of the path MUST be less than 256 characters in length, and it MUST be a NetBIOS name, a fully qualified domain name (FQDN), or a textual IPv4 or IPv6 address. The share component of the path MUST be less than or equal to 80 characters in length. The share name MUST NOT contain any invalid characters, as specified in [MS-FSCC] section 2.1.6. <32>

PathLength (2 bytes): The length, in bytes, of the full share path name.

Buffer (variable): If SMB2_TREE_CONNECT_FLAG_EXTENSION_PRESENT is not set in the Flags field of this structure, this field is a variable-length buffer that contains the full share path name.

If SMB2_TREE_CONNECT_FLAG_EXTENSION_PRESENT is set in the Flags field in this structure, this field is a variable-length buffer that contains the tree connect request extension, as specified in section 2.2.9.1.