18.104.22.168 Sending Any Message
This event is invoked within the SMB server itself for processing each request. It is not exposed externally.
The caller provides the following:
Connection: The SMB connection on which the response is to be sent.
Payload: The payload to be sent, including the SMB Header (section 22.214.171.124).
Unless otherwise noted, the server MUST NOT send any message that exceeds the limit set by Server.Connection.ClientMaxBufferSize.
If the message is an error reply or any other message that indicates the completion of a command, the server MUST remove the corresponding entry, if any, from the Server.Connection.PendingRequestTable.
Unless otherwise specified, the server MUST return both the client-supplied PID and MID to the client in any response to a client request.
The SMB_FLAGS_REPLY bit in the SMB Header MUST be set, unless the message is an OpLock Break Notification request initiated by the server.
If the server sends a message to the client, and signing is active for the SMB connection, the message MUST be signed, as specified in section 126.96.36.199, by providing the sequence number in Server.Connection.ServerSendSequenceNumber[PID,MID]. The sequence number is calculated and populated into the table Server.Connection.ServerSendSequenceNumber, as specified in section 188.8.131.52. OpLock Break Notification messages are exempt from signing.
If signing is not active, the SecuritySignature field of the SMB Header for all messages sent, except the SMB_COM_SESSION_SETUP_ANDX Response (section 184.108.40.206.2), MUST be set to 0x0000000000000000. For the SMB_COM_SESSION_SETUP_ANDX Response, the SecuritySignature field of the SMB Header SHOULD<227> be set to the SecuritySignature received in the SMB_COM_SESSION_SETUP_ANDX Request (section 220.127.116.11.1).
For every outgoing message, the server MUST calculate the total number of bytes in the message and MUST update the values of Server.Statistics.sts0_bytessent_low and Server.Statistics.sts0_bytessent_high.