xxx_IOControl

The xxx_IOControl function sends a command to the device.

Syntax

BOOL xxx_IOControl( DWORD hOpenContext DWORD dwCode
PBYTE pBufIn DWORD dwLenIn PBYTE pBufOut DWORD dwLenOut PDWORD pdwActualOut );

Parameters

hOpenContext
Specifies a handle identifying the open context of the device. The xxx_Open function creates and returns this identifier.
dwCode
Specifies a value indicating the I/O control operation to perform. These codes are device specific, and are usually exposed to application programmers by means of a header file.
pBufIn
Points to the buffer containing data to be transferred to the device.
dwLenIn
Specifies the number of bytes of data in the buffer specified for pBufIn.
pBufOut
Points to the buffer used to transfer the output data from the device.
dwLenOut
Specifies the maximum number of bytes in the buffer specified by pBufOut
pdwActualOut
Points to DWORD buffer the function uses to return the actual number of bytes received from the device.

Return Value

Returns TRUE if the device successfully completed its specified I/O control operation, otherwise it returns FALSE.

Remarks

An application uses DeviceIOControl to specify an operation to be performed. The operating system, in turn, invokes xxx_IOControl. The dwCode argument contains the input or output operation to be performed. I/O control codes are usually specific to each device driver, and are typically exposes to application programmers by means of a header file.

If the Ctrl registry value is defined for your device driver, the Device Manager calls xxx_IOControl right after it calls xxx_Init. It uses the value stored in the registry for the dwCode argument, and NULL for the pBufIn and pBufOut arguments. Your device might use this option to load other modules that require the basic device driver to be installed.