I have a USB mass storage device plugged into a Windows
2000 SP4 machine. It is using the generic SP4 USB stack,
usbhub.sys, usbstor.sys. They apparently leave the
SurpriseRemovalOK BIT reset to the unfortunate yet
eternally wrong 0. I can programatically send an IOCTL to
LOCK_DEVICE, but when subsequently removing the USB cable,
I get the notorious "Unsafe Removal of Device" dialog box.
Is there a programmatical way to avoid this popup, as I
know the removal is indeed safe, without having to use the
Unplug/Eject icon in the Taskbar tray? Again, the device
is using generic MSFT drivers, so I have no way to control
the DEVICE ATTRIBUTES of the USB device. Perhaps some way
to remove the device from a DLL, or a neighboring driver?
I do have these available. In XP, the device driver sets
the DeviceHotplug flag, so no unwanted popup occurs.
|