3.3.5.7 Receiving an SMB_COM_READ_ANDX Request

The processing of an SMB_COM_READ_ANDX request is handled as specified in [MS-CIFS] section 3.3.5.36 with the following additions:<125>

If the read operation is on a named pipe, then the Timeout_or_MaxCountHigh field MUST be interpreted as the 32-bit Timeout field, as specified in section 2.2.4.2.1.

If the read operation is on a file, then the Timeout_or_MaxCountHigh field MUST be interpreted as the 16-bit MaxCountHigh field followed by a 16-bit Reserved field, as specified in section 2.2.4.2.1. The value in MaxCountHigh MUST be treated as the two most significant bytes of the count of bytes to read and is combined with the value of MaxCountOfBytesToReturn to create a 32-bit count of bytes to read (as specified in section 3.2.4.4). If MaxCountHigh is set to 0xFFFF, then the value MUST be ignored, and only the length received in MaxCountOfBytesToReturn is used.

It is acceptable to return fewer bytes than requested by the client, with the restriction that reads from named pipes or devices MUST return at least MinCountOfBytesToReturn bytes. If the read operation is on a file and the count of bytes to read is greater than or equal to 0x00010000 (64K), then the server MAY<126>Return the requested number of bytes in the response, set the two least significant bytes of the count in the DataLength field in the response, and the two most significant bytes of the count in the DataLengthHigh field (specified in section 2.2.4.2.2).