2.2.13.2 SMB2_CREATE_CONTEXT Request Values

The SMB2_CREATE_CONTEXT structure is used by the SMB2 CREATE Request and the SMB2 CREATE Response to encode additional flags and attributes: in requests to specify how the CREATE request MUST be processed, and in responses to specify how the CREATE request was in fact processed.

There is no required ordering when multiple Create Context structures are used. The server MUST support receiving the contexts in any order.

Each structure takes the following form.


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

Next

NameOffset

NameLength

Reserved

DataOffset

DataLength

Buffer (variable)

...

Next (4 bytes): The offset from the beginning of this Create Context to the beginning of a subsequent 8-byte aligned Create Context. This field MUST be set to 0 if there are no subsequent contexts.

NameOffset (2 bytes): The offset from the beginning of this structure to its 8-byte aligned name value.

NameLength (2 bytes): The length, in bytes, of the Create Context name.

Reserved (2 bytes): This field MUST NOT be used and MUST be reserved. This value MUST be set to 0 by the client, and ignored by the server.

DataOffset (2 bytes): The offset, in bytes, from the beginning of this structure to the 8-byte aligned data payload. If DataLength is 0, the client SHOULD set this value to 0 and the server MUST ignore it on receipt.<54>

DataLength (4 bytes): The length, in bytes, of the data. The format of the data is determined by the type of SMB2_CREATE_CONTEXT request, as outlined in the following sections. The type is inferred from the Create Context name specified by the NameOffset and NameLength fields.

Buffer (variable): A variable-length buffer that contains the name and data fields, as defined by NameOffset, NameLength, DataOffset, and DataLength. The name is represented as four or more octets and MUST be one of the values provided in the following table. The structure name indicates what information is encoded by the data payload. The following values are the valid Create Context values and are defined to be in network byte order. More details are provided for each of these values in the following subsections.

Value

Meaning

SMB2_CREATE_EA_BUFFER

0x45787441

("ExtA")

The data contains the extended attributes that MUST be stored on the created file.

This value MUST NOT be set for named pipes and print files.

SMB2_CREATE_SD_BUFFER

0x53656344

("SecD")

The data contains a security descriptor that MUST be stored on the created file.

This value MUST NOT be set for named pipes and print files.

SMB2_CREATE_DURABLE_HANDLE_REQUEST

0x44486e51

("DHnQ")

The client is requesting the open to be durable (see section 3.3.5.9.6).

SMB2_CREATE_DURABLE_HANDLE_RECONNECT

0x44486e43

("DHnC")

The client is requesting to reconnect to a durable open after being disconnected (see section 3.3.5.9.7).

SMB2_CREATE_ALLOCATION_SIZE

0x416c5369

("AlSi")

The data contains the required allocation size of the newly created file.

SMB2_CREATE_QUERY_MAXIMAL_ACCESS_REQUEST

0x4d784163

("MxAc")

The client is requesting that the server return maximal access information.

SMB2_CREATE_TIMEWARP_TOKEN

0x54577270

("TWrp")

The client is requesting that the server open an earlier version of the file identified by the provided time stamp.

SMB2_CREATE_QUERY_ON_DISK_ID

0x51466964

("QFid")

The client is requesting that the server return a 32-byte opaque BLOB that uniquely identifies the file being opened on disk. No data is passed to the server by the client.

SMB2_CREATE_REQUEST LEASE

0x52714c73

("RqLs")

The client is requesting that the server return a lease. This value is only supported for the SMB 2.1 and 3.x dialect family.

SMB2_CREATE_REQUEST_LEASE_V2

0x52714c73

("RqLs")

The client is requesting that the server return a lease for a file or a directory. This value is only supported for the SMB 3.x dialect family. This context value is the same as the SMB2_CREATE_REQUEST_LEASE value; the server differentiates these requests based on the value of the DataLength field.

SMB2_CREATE_DURABLE_HANDLE_REQUEST_V2

0x44483251

("DH2Q")

The client is requesting the open to be durable. This value is only supported for the SMB 3.x dialect family.

SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2

0x44483243

("DH2C")

The client is requesting to reconnect to a durable open after being disconnected. This value is only supported for the SMB 3.x dialect family.

SMB2_CREATE_APP_INSTANCE_ID

0x45BCA66AEFA7F74A9008FA462E144D74

The client is supplying an identifier provided by an application instance while opening a file. This value is only supported for the SMB 3.x dialect family.

SMB2_CREATE_APP_INSTANCE_VERSION

0xB982D0B73B56074FA07B524A8116A010

The client is supplying a version to correspond to the application instance identifier.  This value is only supported for SMB 3.1.1 dialect.

SVHDX_OPEN_DEVICE_CONTEXT

0x9CCBCF9E04C1E643980E158DA1F6EC83

Provided by an application while opening a shared virtual disk file, as specified in [MS-RSVD] sections   2.2.4.12 and 2.2.4.32. This Create Context value is not valid for the SMB 2.002, SMB 2.1, and SMB 3.0 dialects.

SMB2_CREATECONTEXT_RESERVED

0x93AD25509CB411E7B42383DE968BCD7C

This value MUST be reserved and MUST be ignored on receipt.