3.2.5.18 Receiving an SMB_COM_WRITE_RAW Response

After sending an SMB_COM_WRITE_RAW request, the client expects one of two possible responses: an Initial Server Response or a Final Server Response.

  • If the client receives a  Final Server Response (section 2.2.4.25.3), the command has completed, possibly with an error. The client MUST extract the Status and Count fields. The client MUST return the status information and the number of bytes successfully written by the command to the application. Response processing is then complete.

  • If the client receives an Interim Server Response (section 2.2.4.25.2), the command is has been processed successfully and the server is waiting for the remainder of the data to be sent in raw mode. The client MUST transfer the remaining data in raw mode (no SMB header, parameters, or data block) via the SMB transport.

  • If WritethroughMode was set in the WriteMode field of the original request, the client MUST expect a Final Server Response following the Initial Server Response and the transfer of raw data. The Final Server Response can indicate an error. The client MUST return the status information and the number of bytes successfully written by the command to the application. Response processing is then complete.

  • If WritethroughMode was not set in the WriteMode field of the original request, then the client MUST NOT expect a Final Server Response. The client MUST return a status value of Success to the application, and indicate that all bytes sent were successfully written.

  • If an error occurred on the server while writing the raw data, the error MUST be returned on the next client command request that makes use of the same FID. The client MAY retrieve a pending error code by sending, for example, a Seek request that seeks to the current file position (effectively, a null operation).