2.2.4.11.2 Response

 SMB_Parameters
   {
   UCHAR  WordCount;
   Words
     {
     USHORT CountOfBytesReturned;
     USHORT Reserved[4];
     }
   }
 SMB_Data
   {
   USHORT ByteCount;
   Bytes
     {
     UCHAR  BufferFormat;
     USHORT CountOfBytesRead;
     UCHAR  Bytes[CountOfBytesRead];
     }
   }


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

SMB_Parameters

...

...

SMB_Data (variable)

...

SMB_Parameters (11 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

WordCount

Words

...

...

WordCount (1 byte): This field MUST be 0x05.

Words (10 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

CountOfBytesReturned

Reserved

...

...

CountOfBytesReturned (2 bytes): The actual number of bytes returned to the client. This MUST be equal to CountOfBytesToRead unless the end of file was reached before reading CoutOfBytesToRead bytes or the ReadOffsetInBytes pointed at or beyond the end of file.

Reserved (8 bytes): Reserved. All bytes MUST be 0x00.

SMB_Data (variable):


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

ByteCount

ByteCount (2 bytes): This field MUST be 0x0003 + CountOfBytesRead.

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

BufferFormat

CountOfBytesRead

Bytes (variable)

...

BufferFormat (1 byte): This field MUST be 0x01.

CountOfBytesRead (2 bytes): The number of bytes read that are contained in the following array of bytes.

Bytes (variable): The actual bytes read from the file.

Error Codes

SMB error class

SMB error code

NT status code

POSIX equivalent

Description

ERRDOS

(0x01)

ERRnoaccess

(0x0005)

STATUS_ALREADY_COMMITTED

(0xC0000021)

ENOLCK

Attempt to read from a portion of the file that the server determines has been locked or has been opened in deny-read mode.

ERRDOS

(0x01)

ERRbadfid

(0x0006)

STATUS_INVALID_HANDLE

(0xC0000008)

STATUS_SMB_BAD_FID

(0x00060001)

ENFILE

Attempt to read from a FID that the server does not have open.

ERRDOS

(0x01)

ERRnomem

(0x0008)

STATUS_INSUFF_SERVER_RESOURCES

(0xC0000205)

ENOMEM

The server is out of resources.

ERRDOS

(0x01)

ERRbadaccess

(0x000C)

STATUS_ACCESS_DENIED

(0xC0000022)

Read permission required.

ERRDOS

(0x01)

ERRlock

(0x0021)

STATUS_FILE_LOCK_CONFLICT

(0xC0000054)

STATUS_LOCK_NOT_GRANTED

(0xC0000055)

EAGAIN

 The requested byte range was already locked by a different process (PID).

ERRDOS

(0x01)

ERReof

(0x0026)

STATUS_END_OF_FILE

(0xC0000011)

Attempted to read beyond the end of the file.

ERRDOS

(0x01)

ERRmoredata

(0x00EA)

STATUS_BUFFER_OVERFLOW

(0x80000005)

The message on a message mode named pipe exceeds the requested number of bytes. The server MUST send a full SMB_COM_READ response with this error code. The requested number of bytes are read and returned to the client.

ERRSRV

(0x02)

ERRerror (0x0001)

EBADF

The FID was validated by the server but unacceptable to the system.

ERRSRV

(0x02)

ERRerror (0x0001)

EDEADLK

The read would block and deadlock would result.

ERRSRV

(0x02)

 ERRerror (0x0001)

STATUS_INVALID_SMB

(0x00010002)

A corrupt request has been encountered.

ERRSRV

(0x02)

ERRinvdevice (0x0007)

STATUS_BAD_DEVICE_TYPE

(0xC00000CB)

Attempt to read from an open spool file.

ERRSRV

(0x02)

ERRinvtid (0x0005)

STATUS_SMB_BAD_TID

(0x00050002)

Invalid TID in request.

ERRSRV

(0x02)

ERRbaduid (0x005B)

STATUS_SMB_BAD_UID

(0x005B0002)

The UID specified is not known as a valid ID for this session, or the user identified by the UID does not have sufficient privileges.

 ERRHRD

(0x03)

ERRdata

(0x0017)

STATUS_DATA_ERROR

(0xC000003E)

EIO

A problem has occurred in the physical I/O.

ERRHRD

(0x03)

ERRread

(0x001E)

ENXIO

The device associated with the file descriptor is a block-special or character-special file and the value of the file pointer is out of range.