2.2.2 SMB2 ERROR Response

The SMB2 ERROR Response packet is sent by the server to respond to a request that has failed or encountered an error. This response is composed of an SMB2 Packet Header (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

ErrorContextCount

Reserved

ByteCount

ErrorData (variable)

...

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

ErrorContextCount (1 byte): This field MUST be set to 0 for SMB dialects other than 3.1.1. For the SMB dialect 3.1.1, if this field is nonzero, the ErrorData field MUST be formatted as a variable-length array of SMB2 ERROR Context structures containing ErrorContextCount entries.

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.

ByteCount (4 bytes): The number of bytes of data contained in ErrorData[].

ErrorData (variable): A variable-length data field that contains extended error information. If the ErrorContextCount field in the response is nonzero, this field MUST be formatted as a variable-length array of SMB2 ERROR Context structures as specified in section 2.2.2.1. Each SMB2 ERROR Context MUST start at an 8-byte aligned boundary relative to the start of the SMB2 ERROR Response. Otherwise, it SHOULD<5> be formatted as specified in section 2.2.2.2.