3.2.5.2.2.7 Processing an IOControl Request Message
The structure and fields of the IOControl Request message are described in section 2.2.2.3.7.
This message MUST be received only after the CreateFile request-response sequence has been sent, establishing a file handle for I/O on this connection. On receiving the IOControl Request message, the client MUST use the associated file handle and the parameters specified in the IOControl Request message to interact with the local device driver in servicing this request.
The DataIn field MUST contain input data of the size specified in the cbIn field, followed by output data in DataOut of the size specified in the cbOut field.
It is possible that the actual size of the DataOut field MAY be smaller than the value provided in the cbOut field. The receiver needs to calculate the actual size of the DataOut field by subtracting the sum of sizes of all fields except DataOut from the total length of the message. If the calculated size of the DataOut field is nonzero and does not match the value provided in the cbOut field, the request will be completed with an error HRESULT that contains a Win32 error code (ERROR_INSUFFICIENT_BUFFER) as described in section 2.2 of [MS-ERREF].