Partager via


ClearOrSetFeature (Windows Embedded CE 6.0)

1/6/2010

This function sends a CLEAR_FEATURE or SET_FEATURE request to a universal serial bus (USB) device.

Syntax

DWORD ClearOrSetFeature(
  LPCUSB_FUNCS UsbFuncs,
  HANDLE hUsbDevice,
  LPTRANSFER_NOTIFY_ROUTINE NotifyRoutine,
  PVOID NotifyContext,
  DWORD dwFlags, 
  WORD wFeature,
  UCHAR bIndex,
  DWORD dwTimeout,
  BOOL bSet
);

Parameters

  • UsbFuncs
    [in] Pointer to a USB_FUNCS structure.
  • hUsbDevice
    [in] Handle to a USB device.
  • NotifyRoutine
    [in] Pointer to a callback routine to signal a completion event. This is of type LPTRANSFER_NOTIFY_ROUTINE, which might be NULL.
  • NotifyContext
    [in] Context to pass to the LPTRANSFER_NOTIFY_ROUTINE, which is a handle to a BulkXXXcompletion event.
  • dwFlags
    [in] Value of USB_NO_WAIT or zero (0), and one of the values from the following table.

    Value Description

    USB_SEND_TO_DEVICE

    Request for device

    USB_SEND_TO_INTERFACE

    Request for interface

    USB_SEND_TO_ENDPOINT

    Request for endpoint, which is the default

  • wFeature
    [in] A USB_FEATURE_* value.
  • bIndex
    [in] Value of zero (0) for DEVICE, or the interface or endpoint number.
  • dwTimeout
    [in] Timeout in milliseconds (ms).
  • bSet
    [in] Set to TRUE to set the USB feature and FALSE to clear the USB feature.

Return Value

Returns a Microsoft® Win32® error code. For more information, see GetLastError.

Remarks

Synchronous calls to ClearOrSetFeature can negatively affect performance.

Requirements

Header usbclient.h
Windows Embedded CE Windows CE 2.10 and later

See Also

Reference

USB Host Client Driver Functions
LPTRANSFER_NOTIFY_ROUTINE
USB_FUNCS