"Safely Remove Hardware" and WinUSB
-
Thursday, May 10, 2012 1:43 PM
Hi,
Is it possible to prevent a USB device from showing up in the "Safely Remove Hardware" list when it is using the following?
- winusb.sys
- vendor-specific USB class (bInterfaceClass = 0xFF)
I am able to modify:
- device firmware (but bInterfaceClass = 0xFF is required)
- INF file
- PC application that communicates with the USB device
Thank you!
Jonathan
All Replies
-
Thursday, May 10, 2012 1:54 PM
I have not tried this, but most driver do not allow device removal if the device is open. Does you application open the USB device first thing, and close it as the last thing?
Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr
-
Thursday, May 10, 2012 2:03 PM
Does you application open the USB device first thing, and close it as the last thing?
Yes.
However, the USB device is also shown in the "Safely Remove Hardware" list even before the PC application is run.
Many USB devices in my office are never shown on the "Safely Remove Hardware" list (CDC, HID keyboard+mouse). In Device Manager > Details > Capabilities, these devices have "CM_DEVCAP_SURPRISEREMOVALOK" listed. I just wanted to know whether this will be possible when using WinUSB and a vendor-specific class.
In other words, can surprise removal only be enabled in the driver? (I am unable to modify winusb.sys) Or is there some way I can modify the device firmware (using vendor-specific class), INF file, and/or PC application to enable surprise removal?
- Edited by jchen45 Thursday, May 10, 2012 2:04 PM
-
Thursday, May 10, 2012 2:18 PM
This is a driver function, at this point I will derer this to someone in Microsoft if there is a way to change that capability.
Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr
-
Thursday, May 10, 2012 3:26 PM
See this thread. Unless it is fixed in the current WinUsb... it still does not work.
-- pa
- Marked As Answer by jchen45 Thursday, May 10, 2012 3:30 PM
-
Thursday, May 10, 2012 4:43 PMOwnerin reality there is no harm if you show up in the safely remove hw dialog
d -- This posting is provided "AS IS" with no warranties, and confers no rights.
-
Thursday, May 10, 2012 4:46 PM
That is absolutely true!
However, our end users have enough trouble as it is, say, figuring out a COM port number. It would have been nice to eliminate "Safely Remove Hardware" as a possible point of confusion, however innocuous.
It also makes our hardware look inferior when hardware from other vendors, who have the resources to roll their own driver, does not show up in the "Safely Remove Hardware" list.
To be honest, their hardware probably is superior, but at least it wouldn't be as easily noticeable to the end user :)
- Edited by jchen45 Thursday, May 10, 2012 4:51 PM


