SetInterface

This function sends a SET_INTERFACE request to a USB device, to change the device’s settings.

Syntax

USB_TRANSFER SetInterface( USB_HANDLE hDevice, LPTRANSFER_NOTIFY_ROUTINE lpStartAddress,
LPVOID
lpvNotifyParameter, DWORD dwFlags, UCHAR bInterfaceNumber, UCHAR bAlternateSetting );

Parameters

hDevice
[IN] Handle to a USB device.
lpStartAddress
[IN] Pointer to the address of a callback routine, which should be NULL unless the USB_NO_WAIT flag is set.
lpvNotifyParameter
[IN] Pointer to the parameter to pass to the callback routine.
dwFlags
[IN] Specifies either of the values USB_NO_WAIT or 0.
bInterfaceNumber
[IN] Specifies the interface number being changed on the device.
bAlternateSetting
[IN] Specifies the number of the alternate.

Return Values

A USB_TRANSFER handle indicates success. NULL indicates failure.

Remarks

This function initiates a control transfer to a USB device, specifying the alternate setting to use for the specified interface.

This function is defined in the Mousedrv.cpp file.

See Also

AbortTransfer, GetInterface, GetTransferStatus, IsTransferComplete