Compartir a través de


2.2.4.42.2 Response

 SMB_Parameters
   {
   UCHAR  WordCount;
   Words
     {
     UCHAR  AndXCommand;
     UCHAR  AndXReserved;
     USHORT AndXOffset;
     USHORT Available;
     USHORT DataCompactionMode;
     USHORT Reserved1;
     USHORT DataLength;
     USHORT DataOffset;
     USHORT Reserved2[5];
     }
   }
 SMB_Data
   {
   USHORT ByteCount;
   Bytes
     {
     UCHAR Pad[] (optional);
     UCHAR Data[DataLength];
     }
   }
            


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 (25 bytes)

...

...

...

SMB_Data (variable)

...

SMB_Parameters (25 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 (24 bytes)

...

...

...

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

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

Available

DataCompactionMode

Reserved1

DataLength

DataOffset

Reserved2

...

...

AndXCommand (1 byte): The command code for the next SMB command in the packet. This value MUST be set to SMB_COM_NO_ANDX_COMMAND (section 2.2.4.75) (0xFF) if there are no additional SMB command responses in the server response packet.<58>

AndXReserved (1 byte): A reserved field. This MUST be set to 0x00 when this response is sent, and the client MUST ignore this field.

AndXOffset (2 bytes): This field MUST be set to the offset in bytes from the start of the SMB Header (section 2.2.3.1) to the start of the WordCount field in the next SMB command response in this packet. This field is valid only if the AndXCommand field is not set to SMB_COM_NO_ANDX_COMMAND (0xFF). If AndXCommand is SMB_COM_NO_ANDX_COMMAND, this field MUST be ignored by the client.<59>

Available (2 bytes): This field is valid when reading from named pipes. This field indicates the number of bytes remaining to be read after the requested read was completed.

DataCompactionMode (2 bytes): Reserved and SHOULD be 0x0000.

Reserved1 (2 bytes): This field MUST be 0x0000.

DataLength (2 bytes): The number of data bytes included in the response. If this value is less than the value in the Request.SMB_Parameters.MaxCountOfBytesToReturn field, it indicates that the read operation has reached the end of the file (EOF).

DataOffset (2 bytes): The offset in bytes from the header of the read data.

Reserved2 (10 bytes): Reserved. All entries MUST be 0x0000. The last 5 words are reserved in order to make the SMB_COM_READ_ANDX Response (section 2.2.4.42.2) the same size as the SMB_COM_WRITE_ANDX Response (section 2.2.4.43.2).

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 greater than or equal to 0x0000.

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

Pad

Data (variable)

...

Pad (1 byte): This field is optional. When using the NT LAN Manager dialect, this field can be used to align the Data field to a 16-bit boundary relative to the start of the SMB Header. If Unicode strings are being used, this field MUST be present. When used, this field MUST be one padding byte long.

Data (variable): The actual bytes read in response to the request.

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 detects has been locked or been opened in deny-read.

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)

Invalid open mode for the attempted operation.

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.<60>

ERRDOS

(0x01)

ERRpipebusy

(0x00E7)

STATUS_PIPE_BUSY

(0xC00000AE)

EAGAIN

Attempted to read from a busy pipe.

ERRDOS

(0x01)

ERRpipeclosing

(0x00E8)

STATUS_PIPE_EMPTY

(0xC00000D9)

Attempted to read from an empty pipe.

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)

ERRtimeout

(0x0058)

The requested operation on a named pipe or an I/O device has timed out.

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.

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.