다음을 통해 공유


2.2.14 SMB2 CREATE Response

The SMB2 CREATE Response packet is sent by the server to notify the client of the status of its SMB2 CREATE Request. This response is composed of an SMB2 header, as specified in section 2.2.1, 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

OplockLevel

Flags

CreateAction

CreationTime

...

LastAccessTime

...

LastWriteTime

...

ChangeTime

...

AllocationSize

...

EndofFile

...

FileAttributes

Reserved2

FileId

...

...

...

CreateContextsOffset

CreateContextsLength

Buffer (variable)

...

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

OplockLevel (1 byte): The oplock level that is granted to the client for this open. This field MUST contain one of the following values.

Value

Meaning

SMB2_OPLOCK_LEVEL_NONE

0x00

No oplock was granted.

SMB2_OPLOCK_LEVEL_II

0x01

A level II oplock was granted.

SMB2_OPLOCK_LEVEL_EXCLUSIVE

0x08

An exclusive oplock was granted.

SMB2_OPLOCK_LEVEL_BATCH

0x09

A batch oplock was granted.

SMB2_OPLOCK_LEVEL_LEASE

0xFF

A lease is requested. If set, the response packet MUST contain an SMB2_CREATE_RESPONSE_LEASE create context.

Flags (1 byte): If the server implements the SMB 3.x dialect family, this field MUST be constructed using the following value. Otherwise, this field MUST NOT be used and MUST be reserved.

Value

Meaning

SMB2_CREATE_FLAG_REPARSEPOINT

0x01

When set, indicates the last portion of the file path is a reparse point. This MUST be used when the last component of a file opened is a reparse point, and the create request Create Options do not contain FILE_OPEN_REPARSE_POINT.

CreateAction (4 bytes): The action taken in establishing the open. This field MUST contain one of the following values.<57>

Value

Meaning

FILE_SUPERSEDED

0x00000000

An existing file was deleted and a new file was created in its place.

FILE_OPENED

0x00000001

An existing file was opened.

FILE_CREATED

0x00000002

A new file was created.

FILE_OVERWRITTEN

0x00000003

An existing file was overwritten.

CreationTime (8 bytes): The time when the file was created; in FILETIME format as specified in [MS-DTYP] section 2.3.3.

LastAccessTime (8 bytes): The time the file was last accessed; in FILETIME format as specified in [MS-DTYP] section 2.3.3.

LastWriteTime (8 bytes): The time when data was last written to the file; in FILETIME format as specified in [MS-DTYP] section 2.3.3.

ChangeTime (8 bytes): The time when the file was last modified; in FILETIME format as specified in [MS-DTYP] section 2.3.3.

AllocationSize (8 bytes): The size, in bytes, of the data that is allocated to the file.

EndofFile (8 bytes): The size, in bytes, of the file.

FileAttributes (4 bytes): The attributes of the file. The valid flags are as specified in [MS-FSCC] section 2.6.

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

FileId (16 bytes): An SMB2_FILEID, as specified in section 2.2.14.1.

The identifier of the open to a file or pipe that was established.

CreateContextsOffset (4 bytes): The offset, in bytes, from the beginning of the SMB2 header to the first 8-byte aligned SMB2_CREATE_CONTEXT response that is contained in this response. If none are being returned in the response, this value MUST be 0. These values are specified in section 2.2.14.2.

CreateContextsLength (4 bytes): The length, in bytes, of the list of SMB2_CREATE_CONTEXT response structures that are contained in this response.

Buffer (variable): A variable-length buffer that contains the list of create contexts that are contained in this response, as described by CreateContextsOffset and CreateContextsLength. This takes the form of a list of SMB2_CREATE_CONTEXT Response Values, as specified in section 2.2.14.2.