2.2.4.46.2 Response

The SMB_COM_TRANSACTION2 response has two possible formats. The standard format is used to return the results of the completed transaction. A shortened interim response message is sent following the initial SMB_COM_TRANSACTION2 request if secondary request messages (SMB_COM_TRANSACTION2_SECONDARY) are pending. Whenever a transaction request is split across multiple SMB requests, the server MUST evaluate the initial SMB_COM_TRANSACTION2 request to determine whether or not it has the resources necessary to process the transaction. It MUST also check for any other errors it can detect based upon the initial request, and then send back an interim response. The interim response advises the client as to whether it can send the rest of the transaction to the server.

Interim Response

The format of the SMB_COM_TRANSACTION2 Interim Server Response message MUST be an SMB Header (section 2.2.3.1) with an empty Parameter and Data section, and the WordCount and ByteCount fields MUST be zero. Error codes MUST be returned in the SMB_Header.Status field if errors occur.

 SMB_Parameters
   {
   UCHAR  WordCount;
   }
 SMB_Data
   {
   USHORT ByteCount;
   }
  

If no error is returned in the SMB_COM_TRANSACTION2 Interim Server Response, the transaction MAY proceed. The client can send as many SMB_COM_TRANSACTION2_SECONDARY messages as needed in order to transfer the remainder of the transaction subcommand. The server MUST process the transaction and MUST reply with one or more SMB_COM_TRANSACTION2 response messages.

Final Response

 SMB_Parameters
   {
   UCHAR  WordCount;
   Words
     {
     USHORT TotalParameterCount;
     USHORT TotalDataCount;
     USHORT Reserved1;
     USHORT ParameterCount;
     USHORT ParameterOffset;
     USHORT ParameterDisplacement;
     USHORT DataCount;
     USHORT DataOffset;
     USHORT DataDisplacement;
     UCHAR  SetupCount;
     UCHAR  Reserved2;
     USHORT Setup[SetupCount];
     }
   }
   SMB_Data
   {
   USHORT ByteCount;
   Bytes
     {
     UCHAR  Pad1[];
     UCHAR  Trans2_Parameters[ParameterCount];
     UCHAR  Pad2[];
     UCHAR  Trans2_Data[DataCount];
     }
   }
  


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

SMB_Parameters (variable)

...

SMB_Data (variable)

...

SMB_Parameters (variable):


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

WordCount

Words (variable)

...

WordCount (1 byte): The value of Words.SetupCount plus 10 (0x0A). This value represents the total number of SMB parameter words and MUST be greater than or equal to 10 (0x0A).

Words (variable):


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

TotalParameterCount

TotalDataCount

Reserved1

ParameterCount

ParameterOffset

ParameterDisplacement

DataCount

DataOffset

DataDisplacement

SetupCount

Reserved2

Setup (variable)

...

TotalParameterCount (2 bytes): The total number of SMB_COM_TRANSACTION2 parameter bytes to be sent in this transaction response. This value can be reduced in any or all subsequent SMB_COM_TRANSACTION2 responses that are part of the same transaction. This value represents transaction parameter bytes, not SMB parameter words. Transaction parameter bytes are carried within in the SMB_data block.

TotalDataCount (2 bytes): The total number of SMB_COM_TRANSACTION2 data bytes to be sent in this transaction response. This value MAY be reduced in any or all subsequent SMB_COM_TRANSACTION2 responses that are part of the same transaction. This value represents transaction data bytes, not SMB data bytes.

Reserved1 (2 bytes): Reserved. This field MUST be 0x0000 in the client request. The server MUST ignore the contents of this field.

ParameterCount (2 bytes): The number of transaction parameter bytes being sent in this SMB message. If the transaction fits within a single SMB_COM_TRANSACTION2 response, this value MUST be equal to TotalParameterCount. Otherwise, the sum of the ParameterCount values in the transaction response messages MUST be equal to the smallest TotalParameterCount value reported by the server. The ParameterCount field MUST be used to determine the number of transaction parameter bytes contained within the SMB message.

ParameterOffset (2 bytes): The offset, in bytes, from the start of the SMB_Header to the transaction parameter bytes. This MUST be the number of bytes from the start of the SMB message to the start of the SMB_Data.Bytes.Parameters field. Server implementations MUST use this value to locate the transaction parameter block within the SMB message. If ParameterCount is zero, the client/server MAY set this field to zero.<69>

ParameterDisplacement (2 bytes): The offset relative to all of the transaction parameter bytes in this transaction response at which this block of parameter bytes MUST be placed. This value MAY be used by the client to correctly reassemble the transaction parameters even if the SMB response messages are received out of order.

DataCount (2 bytes): The number of transaction data bytes being sent in this SMB message. If the transaction fits within a single SMB_COM_TRANSACTION2 response, then this value MUST be equal to TotalDataCount. Otherwise, the sum of the DataCount values in the transaction response messages MUST be equal to the smallest TotalDataCount value reported by the server.

DataOffset (2 bytes): The offset, in bytes, from the start of the SMB_Header to the transaction data bytes. This MUST be the number of bytes from the start of the SMB message to the start of the SMB_Data.Bytes.Data field. Server implementations MUST use this value to locate the transaction data block within the SMB message. If DataCount is zero, the client/server MAY set this field to zero.<70>

DataDisplacement (2 bytes): The offset relative to all of the transaction data bytes in this transaction response at which this block of data bytes MUST be placed. This value MAY be used by the client to correctly reassemble the transaction data even if the SMB response messages are received out of order.

SetupCount (1 byte): The number of setup words that are included in the transaction response.

Reserved2 (1 byte): A padding byte. This field MUST be 0x00. If SetupCount is defined as a USHORT, the high order byte MUST be 0x00.

Setup (variable): An array of two-byte words that provides transaction results from the server. The size and content of the array are specific to individual subcommands.

SMB_Data (variable):

The SMB_Data section of the SMB_COM_TRANSACTION2 response contains the parameters and data generated by the transaction subcommand.


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

ByteCount

Bytes (variable)

...

ByteCount (2 bytes): The number of bytes in the SMB_Data.Bytes array, which follows.

Bytes (variable):


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

Pad1 (variable)

...

Trans2_Parameters (variable)

...

Pad2 (variable)

...

Trans2_Data (variable)

...

Pad1 (variable): This field SHOULD be used as an array of padding bytes to align the following field to a 4-byte boundary relative to the start of the SMB Header (section 2.2.3.1). This can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client.

Trans2_Parameters (variable): Transaction parameter bytes. See the individual SMB_COM_TRANSACTION2 subcommand descriptions for information on parameters returned by the server for each subcommand.

Pad2 (variable): This field SHOULD be used as an array of padding bytes to align the following field to a 4 byte boundary relative to the start of the SMB Header. This constraint can cause this field to be a zero-length field. This field SHOULD be set to zero by the client/server and MUST be ignored by the server/client.

Trans2_Data (variable): Transaction data bytes. See the individual SMB_COM_TRANSACTION2 subcommand descriptions for information on data returned by the server for each subcommand.<71>