This function sends a command to a device.
BOOL XXX_IOControl(
DWORD hOpenContext DWORD dwCode PBYTE pBufIn DWORD dwLenIn PBYTE pBufOut DWORD dwLenOut PDWORD pdwActualOut );
TRUE indicates success. FALSE indicates failure.
An application uses the DeviceIOControl function to specify an operation to be performed. The operating system, in turn, invokes this function. The dwCode parameter contains the input or output operation to be performed. I/O control codes usually are specific to each device driver and typically are exposed to programmers by means of a header file.
If the Ioctl registry key is defined for your device driver, the Device Manager calls this function directly after it calls the XXX_Init function. It uses the value stored in the registry for the dwCode parameter and NULL for the pBufIn and pBufOut parameters. Your device might use this option to load other modules that require the installation of the basic device driver.