XXX_IOControl
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 );
Parameters
- hOpenContext
Handle to 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 programmers by means of a header file. - pBufIn
Pointer 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
Pointer 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
Pointer to the DWORD buffer that this function uses to return the actual number of bytes received from the device.
Return Values
TRUE indicates success. FALSE indicates failure.
Remarks
An application uses the DeviceIOControl function to specify an operation to be performed. The operating system, in turn, invokes this XXX_IOControl. The dwCode parameter contains the input or output operation to be performed; these codes are usually specific to each device driver and are exposed to application programmers by means of a header file that the device driver programmer makes available.
If the HKEY_LOCAL_MACHINE\Drivers\BuiltIn\YourDevice\Ioctl registry key is defined for your device driver, the Device Manager will invoke your device driver's XXX_IOControl function when it loads and initializes your device driver. It uses the Ioctl registry value 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, or as a trigger to perform any other actions that are not suited to being part of your device driver's XXX_Init function. The actual sequence of calls made to a device driver in this scenario is XXX_Init, XXX_Open, XXX_IOControl, and XXX_Close. The XXX_Open call is necessary for the Device Manager to get a valid context handle, and XXX_Close is necessary to leave the device driver available to serve applications. For more information, see Registry Keys Used by the Device Manager.
Requirements
| Runs on | Versions | Defined in | Include | Link to |
|---|---|---|---|---|
| Windows CE OS | 1.0 and later |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
Last updated on Tuesday, July 13, 2004
© 1992-2000 Microsoft Corporation. All rights reserved.