device_input_output_control


bool device_input_output_control(handle file,
                                 unsigned code,
                                 void* input_buffer,
                                 unsigned input_length,
                                 void* output_buffer,
                                 unsigned output_length,
                                 unsigned* returned,
                                 overlapped* overlapped_input_output)

This function performs input/ouput control functions.

Parameters

handle file

The handle of the device on which the control function is issued. This handle may be obtained using the function create_file.

unsigned code

The command code. For command values, see enumerations

void* input_buffer

A pointer to the input buffer.

unsigned input_length

The length of the input buffer.

void* output_buffer

A pointer to the output buffer.

unsigned output_length

The length of the output buffer.

unsigned* returned

A pointer to a variable that receives the number of bytes transferred to the buffer pointed to by output_buffer. If overlapped is null, this variable must point to a valid integer in memory. If overlapped is non-null, this parameter may be null (in which case the function get_overlapped_result is used to determine the number of bytes transferred).

overlapped* overlapped_input_output

A pointer to an overlapped structure for asynchronous processing.

Return

bool

true The function succeeded.
false The call to this function failed.

Notes

If the file was opened with the flag overlapped_file the parameter overlapped_input_output cannot be null. If the file was opened without the flag overlapped_file, the parameter overlapped_input_output is ignored and the request is executed synchronously (that is, the function does not return until the operation is complete).

When an asynchronous operation is being performed, this function will result in error::input_output_incomplete. In this case, the application should wait on the manual reset event semaphore provided in the overlapped structure.