Is it normal for Windows 7 to take ~20-25 seconds before it sends a Device Removal Complete (DBT_DEVICEREMOVECOMPLETE = 0X8004) message after power is removed from the USB device? I am consistently seeing 20 - 25 second delay before this notification arrives at my application (using Generic HID ~5...I think). This delay is causing lots of problems for my firmware upgrade application which relies on the device being accurately detected (arrival and removal).
Also, if I put a break point at the OnDeviceChange message parser, there are ~20-25 identical messages queued up that continue to be serviced by the function.
protected override void WndProc(ref Message m)
{
try
{
// The OnDeviceChange routine processes WM_DEVICECHANGE messages.
if (m.Msg == DeviceManagement.WM_DEVICECHANGE)
{
OnDeviceChange(m);
}
Any thoughts would be greatly appreciated.