Safely removing storage devices on Windows 7

Hi Guys,

In my current project, I’m “hiding” some storage devices by deleting their mount points (IOCTL_MOUNTMGR_DELETE_POINTS) in order to replace them with my own virtual devices (as I want the feature to be as much transparent as possible to the end user).

The problem is, as petty as it might sound, is that on Windows 7, the “hidden” physical devices no longer appear in the “Safely Remove Hardware and Eject Media” UI.

Apparently, on Windows 7, when storage device doesn’t have a driver letter assigned - it can’t be safely removed, using this UI.

It can even be easily verified by removing the drive letter, using the Disk Management UI - the behavior is the same.

It’s worth to mention, that this behavior occurs only on Windows 7. I.e., on 2000/XP/Vista the device can be still safely removed.

I’d appreciate very much if someone could help me with some kind of a workaround that will make the device to be safely removed again.

But the drive is hidden_. This is why it is not visible in the UI.
It’s just logical, not?
Why users should care to safely remove something that they don’t see or know
about.
–pa

wrote in message news:xxxxx@ntdev…
> Hi Guys,
>
> In my current project, I’m “hiding” some storage devices by deleting their
> mount points (IOCTL_MOUNTMGR_DELETE_POINTS) in order to replace them with
> my own virtual devices (as I want the feature to be as much transparent as
> possible to the end user).
>
> The problem is, as petty as it might sound, is that on Windows 7, the
> “hidden” physical devices no longer appear in the “Safely Remove Hardware
> and Eject Media” UI.
>
> Apparently, on Windows 7, when storage device doesn’t have a driver letter
> assigned - it can’t be safely removed, using this UI.
>
> It can even be easily verified by removing the drive letter, using the
> Disk Management UI - the behavior is the same.
>
> It’s worth to mention, that this behavior occurs only on Windows 7. I.e.,
> on 2000/XP/Vista the device can be still safely removed.
>
> I’d appreciate very much if someone could help me with some kind of a
> workaround that will make the device to be safely removed again.
>

Well, although the physical storage device is “hidden”, it’s still mounted, hence I’d like to provide the users with the ability to safely remove it.

On Vista and XP, the device did appear in the Safely Remove UI (just without the appended drive letter), so it’s just a Windows 7 thingy.

Any ideas?

No, not really. You can still call the underlying CM API to safely remove the device on your own, but that will require your own ui

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, December 23, 2009 12:22 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Safely removing storage devices on Windows 7

Well, although the physical storage device is “hidden”, it’s still mounted, hence I’d like to provide the users with the ability to safely remove it.

On Vista and XP, the device did appear in the Safely Remove UI (just without the appended drive letter), so it’s just a Windows 7 thingy.

Any ideas?


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks Doron.

But why does Windows 7 behave like that? I mean, there are still many devices, that aren’t storage devices (== let’s say, having no drive letter) who can be still safely removed, via the UI - why the appearance of mounted disk devices is conditioned by having a drive letter?

Iirc, storage is specially cased around this area. I don’t know why it was, but there was a ton of ux work here in terms of storage and trying to expose the overall device to the user in the ui, not just particular functions of a device. Removable storage gets real funky, esp with these u3 devices which have different luns, but just one “piece of plastic” that the user thinks of as the device

d

-----Original Message-----
From: xxxxx@gmail.com
Sent: Wednesday, December 23, 2009 1:07 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Safely removing storage devices on Windows 7

Thanks Doron.

But why does Windows 7 behave like that? I mean, there are still many devices, that aren’t storage devices (== let’s say, having no drive letter) who can be still safely removed, via the UI - why the appearance of mounted disk devices is conditioned by having a drive letter?


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Doron,

I just tried to mount the device into an NTFS folder (instead of assigning it a drive letter) and the device had disappeared from the Safely Remove UI as well.

Although we can argue whether the device should or shouldn’t appear in the UI, when it has no drive letter, but in this case it must.

Can you forward this to the relevant MS guys? It starts to sound like a minor Windows 7 bug.

Thanks,
Leonid.

Anyone? :frowning:

[Ok, I just have to say…] Bueller?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Thursday, December 24, 2009 8:57 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Safely removing storage devices on Windows 7

Anyone? :frowning:


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

DevManager, Disks, Disable usually does it for me

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Thursday, December 24, 2009 7:57 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Safely removing storage devices on Windows 7

Anyone? :frowning:


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

__________ Information from ESET Smart Security, version of virus signature
database 4715 (20091224) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature
database 4715 (20091224) __________

The message was checked by ESET Smart Security.

http://www.eset.com