Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RegisterDeviceNotification and device driver initialization.

47 views
Skip to first unread message

sam

unread,
Apr 11, 2013, 12:23:44 PM4/11/13
to
Hi ,

we are having a problem detecting our custom usb devices with RegisterDeviceNotification.

The problem seems to be that the notification WM_DEVICECHANGE reaches the application before the device driver has properly loaded. And this does not happen everytime , 70% of the times devices are successfully opened after receiving the notification. but otherwise they fail with "device not found" type messages.

So we want to know , does the WM_DEVICECHANGE message is sent after the complete and proper loading/initilization of the driver has taken place?

Thanks

Geoff

unread,
Apr 11, 2013, 1:08:24 PM4/11/13
to
Windows sends more than one WM_DEVICECHANGE message to all top level
windows. The application must examine the wParam of the message and
only access the device after finding DBT_DEVICEARRIVAL.

http://msdn.microsoft.com/en-us/library/aa363215(v=vs.85).aspx

sam

unread,
Apr 11, 2013, 11:11:53 PM4/11/13
to
Hi,

We are already catching DBT_DEVICEARRIVAL and only then trying to open then device, but still this issue is there.

Is there any other way we can check if the driver has completed loading/initialization and then we can try to open the device?

Thanks
0 new messages