2.2.4.20.2 Response

 SMB_Parameters
   {
   UCHAR  WordCount;
   Words
     {
     USHORT CountOfBytesReturned;
     USHORT Reserved[4];
     }
   }
 SMB_Data
   {
   USHORT ByteCount;
   Bytes
     {
     UCHAR  BufferType;
     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 CountOfBytesToRead 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

Bytes (variable)

...

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

Bytes (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

BufferType

CountOfBytesRead

Bytes (variable)

...

BufferType (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 array of bytes read from the file. The array is not null-terminated.

Error Codes

SMB error class

SMB error code

NT status code

POSIX equivalent

Description

ERRDOS

(0x01)

ERRnoaccess

(0x0001)

STATUS_INVALID_DEVICE_REQUEST

(0xC0000010)

EINVAL

Attempt to lock a non-regular file such as a named pipe.

ERRDOS

(0x01)

ERRnoaccess

(0x0005)

STATUS_ACCESS_DENIED

(0xC0000022)

EACCESS

File access rights do not match requested locks.

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)

EACCESS

The intended byte range has already been locked.

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.

ERRSRV

(0x02)

ERRerror (0x0001)

STATUS_INVALID_SMB

(0x00010002)

A corrupt or invalid request has been encountered.

ERRSRV

(0x02)

ERRerror

(0x0001)

EBADF

A valid FID was rejected by the underlying system.

ERRSRV

(0x02)

ERRerror

(0x0001)

EDEADLK

The lock request would block and cause a deadlock with another process.

ERRSRV

(0x02)

ERRinvdevice

(0x0007)

STATUS_BAD_DEVICE_TYPE

(0xC00000CB)

Attempt to lock a non-regular file such as a named pipe.

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 defined as a valid ID for this session, or the user identified by the UID does not have sufficient privileges.

ERRSRV

(0x02)

ERRmoredata

(0x00EA)

STATUS_BUFFER_OVERFLOW

(0x80000005)

The number of bytes read from the named pipe exceeds the requested number of bytes. The data was returned to the client in the response.

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.