B.3.1 WDU_ATTACH_CALLBACK
PURPOSE
• WinDriver calls this function when a new device, matching the given
criteria, is attached, provided it is not yet controlled by another
driver.
This callback is called once for each matching interface.
PROTOTYPE
typedef BOOL (DLLCALLCONV *WDU_ATTACH_CALLBACK)(
WDU_DEVICE_HANDLE hDevice,
WDU_DEVICE *pDeviceInfo,
PVOID pUserData);
PARAMETERS
DESCRIPTION
RETURN VALUE
If the WD_ACKNOWLEDGE flag was set in the call to
WDU_Init [B.4.1] (within the
dwOptions parameter), the callback function should check if it
wants to control the device, and if so return TRUE (otherwise
– return FALSE).
If the WD_ACKNOWLEDGE flag was not set in the call to
WDU_Init, then the return value of the callback function is
insignificant.
B.3.2 WDU_DETACH_CALLBACK
PURPOSE
• WinDriver calls this function when a controlled device has been
detached from the system.
PROTOTYPE
typedef void (DLLCALLCONV *WDU_DETACH_CALLBACK)(
WDU_DEVICE_HANDLE hDevice,
PVOID pUserData);
PARAMETERS
DESCRIPTION
RETURN VALUE
None
B.3.3 WDU_POWER_CHANGE_CALLBACK
PURPOSE
• WinDriver calls this function when a controlled device has changed
its power settings.
PROTOTYPE
typedef BOOL (DLLCALLCONV *WDU_POWER_CHANGE_CALLBACK)(
WDU_DEVICE_HANDLE hDevice,
DWORD dwPowerState,
PVOID pUserData);
PARAMETERS
DESCRIPTION
RETURN VALUE
TRUE/FALSE. Currently there is no significance to the return
value.
REMARKS
-
This callback is supported only in Windows operating systems,
starting from Windows 2000.