I have a USB MSC device for which I've written a desktop application that can
eject the device similar to using the Unplug or Eject Hardware utility.
Currently, my code calls CM_Request_Device_Eject to cleanly eject the
device. However, the device does not sense that it has been disconnected.
If I call DeviceIoControl with IOCTL_STORAGE_EJECT_MEDIA, the device does
sense that it was ejected but I also get the Unsafe Removal of Hardware
dialog under Windows 2000.
Is there a correct method to cleanly stop the device and have it sense that
it has been disconnected under Windows 2000 and XP (no support needed for
older OSs).
Thanks.
Glenn