2.2.4.62.2 Response

The SMB_COM_NT_TRANSACT 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_NT_TRANSACT request if secondary request messages (SMB_COM_NT_TRANSACT_SECONDARY) are pending.

Whenever a transaction request is split across multiple SMB requests, the server evaluates the initial SMB_COM_NT_TRANSACT request to determine whether or not it has the resources necessary to process the transaction. It also checks for any other errors that it can detect based upon the initial request and then sends back an interim response. The interim response indicates to the client as to whether it can send the rest of the transaction to the server.

The format of the SMB_COM_NT_TRANSACT Interim Server Response message is simply an SMB Header (section 2.2.3.1) with an empty Parameter and Data section (WordCount and ByteCount are zero).

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

If no error (that is, SUCCESS) is returned in the SMB_COM_NT_TRANSACT Interim Server Response, the transaction MAY proceed. The client sends as many SMB_COM_NT_TRANSACT_SECONDARY messages as needed to transfer the remainder of the transaction subcommand. The server processes the transaction and replies with one or more SMB_COM_NT_TRANSACT response messages.

 SMB_Parameters
   {
   UCHAR  WordCount;
   Words
     {
     UCHAR  Reserved1[3];
     ULONG  TotalParameterCount;
     ULONG  TotalDataCount;
     ULONG  ParameterCount;
     ULONG  ParameterOffset;
     ULONG  ParameterDisplacement;
     ULONG  DataCount;
     ULONG  DataOffset;
     ULONG  DataDisplacement;
     UCHAR  SetupCount;
     USHORT Setup[SetupCount];
     }
   }
 SMB_Data
   {
   USHORT ByteCount;
   Bytes
     {
     UCHAR  Pad1[];
     UCHAR  Parameters[ParameterCount];
     UCHAR  Pad2[];
     UCHAR  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):

The SMB_Parameters section of the SMB_COM_NT_TRANSACT response contains information used to manage the transfer of the complete transaction response. It also contains setup information that can include subcommand return codes or state information returned by the server.


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 18 (0x12). This value represents the total number of SMB parameter words and MUST be greater than or equal to 18 (0x12).

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

Reserved1

TotalParameterCount

...

TotalDataCount

...

ParameterCount

...

ParameterOffset

...

ParameterDisplacement

...

DataCount

...

DataOffset

...

DataDisplacement

...

SetupCount

Setup (variable)

...

Reserved1 (3 bytes): Reserved. This field MUST be 0x000000 in the server response. The client MUST ignore the contents of this field.

TotalParameterCount (4 bytes): The total number of SMB_COM_NT_TRANSACT parameter bytes to be sent in this transaction response. This value MAY be reduced in any or all subsequent SMB_COM_NT_TRANSACT 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 (4 bytes): The total number of SMB_COM_NT_TRANSACT data bytes to be sent in this transaction response. This value MAY be reduced in any or all subsequent SMB_COM_NT_TRANSACT responses that are part of the same transaction. This value represents transaction data bytes, not SMB data bytes.

ParameterCount (4 bytes): The number of transaction parameter bytes being sent in this SMB message. If the transaction fits within a single SMB_COM_NT_TRANSACT response, then 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.

ParameterOffset (4 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.<115>

ParameterDisplacement (4 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 can be used by the client to correctly reassemble the transaction parameters even if the SMB response messages are received out of order.

DataCount (4 bytes): The number of transaction data bytes being sent in this SMB message. If the transaction fits within a single SMB_COM_NT_TRANSACT 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 (4 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.<116>

DataDisplacement (4 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 can 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.

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 subcommand.

SMB_Data (variable):

The SMB_Data section of the SMB_COM_NT_TRANSACT 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): This field MUST be greater than or equal to 0x0000.

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)

...

Parameters (variable)

...

Pad2 (variable)

...

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 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.

Parameters (variable): Transaction parameter bytes. See the individual SMB_COM_NT_TRANSACT 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.

Data (variable): Transaction data bytes. See the individual SMB_COM_NT_TRANSACT subcommand descriptions for information on data returned by the server for each subcommand.

As with the request message, the positions and lengths of the Parameters and Data fields are determined by the values of the ParameterOffset, ParameterCount, DataOffset, and DataCount fields. In addition, the ParameterDisplacement and DataDisplacement fields MAY be used to change the order in which subranges of bytes are transferred. Servers SHOULD transfer byte blocks in order and SHOULD give precedence to Parameter bytes. Clients SHOULD be prepared to reconstruct transaction Parameters and Data regardless of the orders or locations in which they are delivered.

Error Codes

The errors returned from calls to SMB_COM_NT_TRANSACT are specific to the subcommand being executed. See the documentation for the individual subcommands for more detailed error information.