Microsoft Windows CE 3.0  

XXX_IOControl

Important:
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
);

Parameters

hOpenContext
Handle to the open context of the device. The XXX_Openfunction 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 DWORDbuffer 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 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.

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

© 2004 Microsoft Corporation. All rights reserved.