USBDeviceAttach
This function is a USB device attach routine.
Syntax
BOOL USBDeviceAttach( USB_HANDLE hDevice,
LPCUSB_FUNCS lpUsbFuncs, LPCUSB_INTERFACE lpInterface, LPCWSTR szUniqueDriverId, LPBOOL fAcceptControl, LPCUSB_DRIVER_SETTINGS lpDriverSettings, DWORD dwUnused );
Parameters
- hDevice
- [IN] Handle to a USB device.
- lpUsbFuncs
- [IN] Pointer to a USBD interface function table.
- lpInterface
- [IN] Pointer to the USB_INTERFACE structure that contains interface information if a client is loaded as an interface driver. If a client is not loaded for a specific interface, this parameter is NULL, and the client can get interface information through the FindInterface function.
- szUniqueDriverId
- [IN] Specifies a client driver identifier string.
- fAcceptControl
- [OUT] Filled in with TRUE if the driver accepts control of the device, or FALSE if USBD should continue to try to load client drivers.
- lpDriverSettings
- [IN] Pointer to the USB_DRIVER_SETTINGS structure that indicates how the driver is loaded.
- dwUnused
- [IN] Reserved for use with future versions of USBD.
Return Values
TRUE indicates success. FALSE indicates failure.
Remarks
This function is called by the USBD module when a device is attached and a matching registry key is found in the LoadClients registry key. The driver should determine whether it can control the device and must load drivers for any uncontrolled interfaces on the device.
This function is defined in the Mousedrv.cpp file.
See Also
FindInterface, LoadGenericInterfaceDriver