3.3.4.1 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 2.2.3.1).
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 3.1.4.1, 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 3.3.5.2. 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 2.2.4.53.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 2.2.4.53.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.