Remove device from Safely Remove Hardware and Eject Media menu

vanagon40vanagon40 Indiana Member
edited September 2014 in Science & Tech

It's been a long absence, which I suppose is good as I post only when I have problems.

I've always found lots of help here in the past, so hopefully that is still the case.

I hope this is a really simple problem. The wireless adapter on my desktop died and I just installed a new adapter in the USB port. But now when I click "Safely Remove Hardware and Eject Media" it shows a USB2.0 WLAN (my old one did not show up there). I really never want to ejects this, and if I did, I could do so manually. Is there a way to change settings so this device does not appear in the Safely Remove Hardware and Eject Media menu? Not being used to having it there, I have a tendency to click it accidentally when removing my flash drive.

EDIT: If it matters, Windows 7 Pro

Comments

  • MyrmidonMyrmidon Baron von Puttenham California Icrontian

    My initial reaction is not from the OS's side - sometimes problems like this are because of a flag that can be tweaked in the registry, but this particular problem is due to a flag in a struct called _DEVICE_CAPABILITIES. The struct's variables are usually set by the driver of the device in question (at least, I think that's where it's done, I've played with the win32 API but I've never messed around with PnP manager), and in ooooooooone little part of it is a variable called "SurpriseRemovalOK." If that variable is set to '1,' then your problem is solved (well, worked-around... not sure if it might actually cause OTHER things to have problems).

    (alternatively, after a little reading through the MSDN, you can also just set the "Removable" flag to false in this struct).

    Here's the bad news -

    I have no easy way of modifying this struct. :( It's not in the registry. I'm willing to bet it's closed-source, and you can't change all the system variables in Windows (like you can in Linux).

    Small glimmer of hope but probably not helpful: According to the MSDN, the USB hub driver (NOT the actual USB wifi thingy driver) has the ability to set the "removable" flag of its children devices... this might represent a path to a solution... but again, I don't know anything about screwing with drivers, and I tend to doubt that the drivers you're using are open source. Finding the dependencies is probably also hell, even if it is open source. Hardware manufacturers are reeeeeeeeeal assholes about that (I mean, it IS their lifeblood).

    MSDN article of the _DEVICE_CAPABILITIES struct: http://msdn.microsoft.com/en-us/library/ff543095.aspx

Sign In or Register to comment.