XXX_IOControl (Device Manager) (Windows CE 5.0)

Send Feedback

This function sends a command to a device.

BOOLXXX_IOControl(DWORD hOpenContext,DWORD dwCode,PBYTEpBufIn,DWORD dwLenIn,PBYTEpBufOut,DWORD dwLenOut,PDWORDpdwActualOut);

Parameters

  • hOpenContext
    [in] Handle to the open context of the device. The XXX_Open (Device Manager) function creates and returns this identifier.
  • dwCode
    [in] I/O control operation to perform. These codes are device-specific and are usually exposed to developers through a header file.
  • pBufIn
    [in] Pointer to the buffer containing data to transfer to the device.
  • dwLenIn
    [in] Number of bytes of data in the buffer specified for pBufIn.
  • pBufOut
    [out] Pointer to the buffer used to transfer the output data from the device.
  • dwLenOut
    [in] Maximum number of bytes in the buffer specified by pBufOut.
  • pdwActualOut
    [out] 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 perform. The operating system, in turn, invokes the XXX_IOControl function. The dwCode parameter contains the input or output operation to perform; these codes are usually specific to each device driver and are exposed to application programmers through a header file that the device driver developer makes available.

If you define the HKEY_LOCAL_MACHINE\Drivers\BuiltIn\MyDevice\Ioctl registry key for your device driver, Device Manager invokes the 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 the XXX_Init (Device Manager) function. The actual sequence of calls made to a device driver in this scenario is XXX_Init, XXX_Open, XXX_IOControl, and XXX_Close (Device Manager). The XXX_Open function call is necessary for Device Manager to retrieve a valid context handle, and the XXX_Close function is necessary to leave the device driver available to serve applications.

Device Manager uses the XXX prefix. When implementing the stream interface, replace XXX with a prefix appropriate for your specific implementation or use undecorated entry point names in conjunction with DEVFLAGS_NAKEDENTRIES. For more information about other valid Flags values, see ActivateDeviceEx.

If possible, implement all power management IOCTLs in your driver.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Developer implemented.
Link Library: Developer implemented.

See Also

Device Manager | Power Management IOCTLs | ActivateDeviceEx | DeviceIoControl | IOCTL_PSL_NOTIFY | XXX_Close (Device Manager) | XXX_Init (Device Manager) | XXX_Open (Device Manager)

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.