18.104.22.168 Application Requests Canceling an Operation
The application provides the CancelId of the operation that is to be canceled.
The client MUST enumerate all connections in the ConnectionTable and look up a Request in Connection.OutstandingRequests where Request.CancelId matches the application-supplied CancelId. If there is a match, the client performs the following:
The Command field MUST be set to SMB2 CANCEL.
The MessageId field SHOULD<132> be set to the identifier that is previously used for the request being canceled. Because the same MessageId is reused, cancel requests MUST NOT consume a sequence number.
If the command has returned an indication of an asynchronous response, the client sets SMB2_FLAGS_ASYNC_COMMAND to TRUE in the Flags field and sets AsyncId to the asynchronous identifier for the request.
The SessionId field SHOULD<133> be set to 0.
The SMB2 CANCEL Request MUST be initialized to the default values, as specified in 2.2.30.
The request MUST be sent to the server.
There is no response to a cancel request, and no status is returned to the caller.