2.2.4.35.2 Response

 SMB_Parameters
   {
   UCHAR  WordCount;
   Words
     {
     USHORT TotalParameterCount;
     USHORT TotalDataCount;
     USHORT ParameterCount;
     USHORT ParameterOffset;
     USHORT ParameterDisplacement;
     USHORT DataCount;
     USHORT DataOffset;
     USHORT DataDisplacement; 
     }
   }
 SMB_Data
   {
   USHORT ByteCount;
   Bytes
     {
     UCHAR  Pad1[];
     UCHAR  Parameters[ParameterCount];
     UCHAR  Pad2[];
     UCHAR  Data[DataCount];
     }
   }
            


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 (variable)

...

SMB_Data (variable)

...

SMB_Parameters (variable):

The SMB_Parameters section of the SMB_COM_IOCTL response contains information that is used to manage the transfer of the IOCTL response. It can also contain additional information that can include IOCTL return codes or state information returned by the server. Such information is CIFS implementation-dependent.


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 (variable)

...

WordCount (1 byte): The value of this field MUST be set to 0x08.

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

TotalParameterCount

TotalDataCount

ParameterCount

ParameterOffset

ParameterDisplacement

DataCount

DataOffset

DataDisplacement

TotalParameterCount (2 bytes): The total number of IOCTL parameter bytes that the server sends to the client in this response. Parameter bytes for an IOCTL are carried within the SMB_Data.Parameters field of the SMB_COM_IOCTL request. This value MUST be the same as ParameterCount, and this value MUST be less than or equal to the MaxParameterCount field value in the client's request.

TotalDataCount (2 bytes): The total number of IOCTL data bytes that the server sends to the client in this response. Data bytes for an IOCTL are carried within the SMB_Data.Data field of the SMB_COM_IOCTL request. This value MUST be the same as DataCount, and this value MUST be less than or equal to the MaxDataCount field value in the client's request.

ParameterCount (2 bytes): The total number of IOCTL parameter bytes that the server sends to the client in this response. Parameter bytes for an IOCTL are carried within the SMB_Data.Parameters field of the SMB_COM_IOCTL request. This value MUST be the same as TotalParameterCount and this value MUST be less than or equal to the MaxParameterCount field value in the client's request.

ParameterOffset (2 bytes): This field MUST contain the number of bytes from the start of the SMB Header (section 2.2.3.1) to the start of the SMB_Data.Parameters field. Client implementations MUST use this value to locate the IOCTL parameter block within the response.

ParameterDisplacement (2 bytes): The server SHOULD set the value of this field to 0x0000. The client MUST ignore the value of this field.

DataCount (2 bytes): The total number of IOCTL data bytes that the server sends to the client in this response. Data bytes for an IOCTL are carried within the SMB_Data.Data field of the SMB_COM_IOCTL request. This value MUST be the same as TotalDataCount, and this value MUST be less than or equal to the MaxDataCount field value of the client's request.

DataOffset (2 bytes): This field MUST be the number of bytes from the start of the SMB Header of the response to the start of the SMB_Data.Data field. Client implementations MUST use this value to locate the IOCTL data block within the response.

DataDisplacement (2 bytes): The server SHOULD set the value of this field to 0x0000. The client MUST ignore the value of this field.

SMB_Data (variable):

The SMB_Data section of the SMB_COM_IOCTL response contains the parameters and data generated by the IOCTL command.


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): The number of bytes in the SMB_Data.Bytes array, which follows.

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

Pad1 (variable)

...

Parameters (variable)

...

Pad2 (variable)

...

Data (variable)

...

Pad1 (variable): An array of padding bytes used to align the next field to a 16- or 32-bit boundary.

Parameters (variable): IOCTL parameter bytes. The contents are implementation-dependent.

Pad2 (variable): An array of padding bytes used to align the next field to a 16- or 32-bit boundary.

Data (variable): IOCTL data bytes. The contents are implementation-dependent.

Error Codes

The errors returned from calls to SMB_COM_IOCTL are implementation-dependent. The list below provides a summary of error codes returned by the IOCTL mechanism.

SMB error class

SMB error code

NT status code

POSIX equivalent

Description

ERRDOS

(0x01)

ERRbadfunc

(0x0001)

STATUS_NOT_IMPLEMENTED

(0xC0000002)

Requested category and function are not implemented by the server.

ERRDOS

(0x01)

ERRnoaccess

(0x0005)

STATUS_ACCESS_DENIED

(0xC0000022)

EACCESS

File access rights do not match requested locks.

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

Insufficient server resources to place the lock.

ERRDOS

(0x01)

ERRunsup

(0x0032)

STATUS_NOT_SUPPORTED

(0xC00000BB)

Requested category and function are not supported by the server.

ERRSRV

(0x02)

ERRerror

(0x0001)

Unspecified error.

ERRSRV

(0x02)

ERRerror

(0x0001)

STATUS_INVALID_SMB

(0x00010002)

Invalid SMB.

ERRSRV

(0x02)

ERRerror

(0x0004)

EACCES

Access denied.

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.

ERRSRV

(0x02)

ERRmoredata

(0x00EA)

STATUS_BUFFER_OVERFLOW

(0xC0000005)

There is more data available (on the specified named pipe) than can be returned in this transaction.

ERRSRV

(0x02)

ERRnosupport

(0xFFFF)

STATUS_SMB_NO_SUPPORT

(0xFFFF0002)

The command is not supported by the server.<50>