2.2.4.2.1 Client Request Extensions

An SMB_COM_READ_ANDX request is sent by a client to read from a file or named pipe on a server. These extensions overload the Timeout field with the new Timeout_or_MaxCountHigh field, which allows the use of read lengths above 0xFFFF when CAP_LARGE_READX has been negotiated. All other fields are defined as specified in [MS-CIFS] section 2.2.4.42.1.

 SMB_Parameters
   {
   UCHAR WordCount;
   Words
     {
     UCHAR  AndXCommand;
     UCHAR  AndXReserved;
     USHORT AndXOffset;
     USHORT FID;
     ULONG  Offset;
     USHORT MaxCountOfBytesToReturn;
     USHORT MinCountOfBytesToReturn;
     ULONG  Timeout_or_MaxCountHigh;
     USHORT Remaining;
     ULONG  OffsetHigh (optional);
     }
   }
 SMB_Data
   {
   USHORT ByteCount;
   }

SMB_Parameters

Words (24 bytes):


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

AndXCommand

AndXReserved

AndXOffset

FID

Offset

...

MaxCountOfBytesToReturn

MinCountOfBytesToReturn

Timeout_or_MaxCountHigh

...

Remaining

OffsetHigh (optional)

Timeout_or_MaxCountHigh (4 bytes): This field is extended to be treated as a union of a 32-bit Timeout field and a 16-bit MaxCountHigh field.  When reading from a regular file, the field MUST be interpreted as MaxCountHigh and the two unused bytes MUST be zero. When reading from a name pipe or I/O device, the field MUST be interpreted as Timeout.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Timeout

Timeout (4 bytes): The client can set the Timeout field to a requested time-out value in milliseconds. The client SHOULD<26> set this field to any integer value. The values 0, 0xFFFFFFFF, and 0xFFFFFFFE have special meaning, as specified in [MS-CIFS] section 3.3.5.36.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

MaxCountHigh

Reserved

MaxCountHigh (2 bytes): This field is a 16-bit integer. If the read being requested is larger than 0xFFFF bytes in size, then the client MUST use the MaxCountHigh field to hold the two most significant bytes of the requested size, which allows for 32-bit read lengths to be requested when combined with MaxCountOfBytesToReturn. If the read is not larger than 0xFFFF bytes, then the client MUST set the MaxCountHigh to zero.<27>

Reserved (2 bytes): Unlike most other reserved fields, this field can sometimes take specific values. The Reserved field SHOULD be set to zero by the client if MaxCountHigh is zero, and SHOULD be set to 0xFFFF by the client if MaxCountHigh is 0xFFFF. For all other values, this field SHOULD be set to zero by the client. For all values, this field MUST be ignored by the server.