|This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.|
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 DeviceIOControlfunction to specify an operation to be performed. The operating system, in turn, invokes this XXX_IOControl. The dwCodeparameter 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\Ioctlregistry key is defined for your device driver, the Device Manager will invoke your device driver's XXX_IOControlfunction when it loads and initializes your device driver. It uses the Ioctlregistry value for the dwCodeparameter and NULL for the pBufInand pBufOutparameters .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_Initfunction. 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_Opencall is necessary for the Device Manager to get a valid context handle, and XXX_Closeis necessary to leave the device driver available to serve applications. For more information, see Registry Keys Used by the Device Manager.
|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