Freigeben über


3.3.5.13 Receiving an SMB_COM_READ Request

When the server receives an SMB_COM_READ request, it MUST perform the following actions:

  • Verify the FID, which represents an Open of a file. If the Open is not found in Server.Connection.FileOpenTable, the server MUST return an error response with a Status of STATUS_INVALID_HANDLE (ERRDOS/ERRbadfid).

  • Verify the UID as described in section 3.3.5.2, and ensure that the user has permission to read from the file. If the user does not have permission to read the file, the server MUST send an error response with a Status of STATUS_ACCESS_DENIED (ERRDOS/ERRnoaccess) and MUST increase Server.Statistics.sts0_permerrors by 1.

  • If the UID presented is different from the UID that opened the file, the server MUST send the error response with a Status of STATUS_INVALID_HANDLE (ERRDOS/ERRbaduid).

  • The server MUST attempt to read data from the underlying object store for the file identified by the FID in  the request. It MUST provide the ReadOffsetInBytes and CountOfBytesToRead fields from the request.<262>

  • If the EstimateOfRemainingBytesToBeRead field is nonzero, the server MAY use the EstimateOfRemainingBytesToBeRead field as a hint for read ahead.

If the request is to read from a named pipe in message mode, the message is larger than CountOfBytesToRead bytes, and the underlying object store returned STATUS_BUFFER_OVERFLOW (ERRDOS/ERRmoredata), the server MUST respond with a complete SMB_COM_READ response not an error response. Any other error MUST generate an error response message 2.

Otherwise, the server MUST construct an SMB_COM_READ Response (section 2.2.4.22.2) message.

The response MUST be sent to the client as specified in section 3.3.4.1.