FILE_REMOVABLE_MEDIA is not set for USB hard disk...Problem!

Hi All,

We are working on the data protection project. Our requirement is to identify the removeable drives. E.g. When you insert pen drive(name it as E: drive), then we must identify that E: is removable. We Identify pen drives as removable drives as FILE_REMOVABLE_MEDIA is set for them.

But the problem is that for USB hard disk, FILE_REMOVABLE_MEDIA is not set, although they are removable. You can check it using GetDriveType() function it does not return DRIVE_REMOVABLE.

So, can any one help me to identify the USB hard disk as removable drive?

Thanks & regards,
Amit.

Some of the IOCTL_STORAGE_xxx requests can return the bus type. Try this.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntfsd…
> Hi All,
>
> We are working on the data protection project. Our requirement is to identify
the removeable drives. E.g. When you insert pen drive(name it as E: drive),
then we must identify that E: is removable. We Identify pen drives as removable
drives as FILE_REMOVABLE_MEDIA is set for them.
>
> But the problem is that for USB hard disk, FILE_REMOVABLE_MEDIA is not set,
although they are removable. You can check it using GetDriveType() function it
does not return DRIVE_REMOVABLE.
>
> So, can any one help me to identify the USB hard disk as removable drive?
>
> Thanks & regards,
> Amit.
>
>

Hi All,

We are working on the data protection project. Our requirement is to identify
the removeable drives. E.g. When you insert pen drive(name it as E: drive), then
we must identify that E: is removable. We Identify pen drives as removable
drives as FILE_REMOVABLE_MEDIA is set for them.

But the problem is that for USB hard disk, FILE_REMOVABLE_MEDIA is not set,
although they are removable. You can check it using GetDriveType() function it
does not return DRIVE_REMOVABLE.

So, can any one help me to identify the USB hard disk as removable drive?

Thanks & regards,
Amit.

Hi,

USB Harddisks are fixed disks (vs. removable) like any other harddisk too.
Don’t mingle hotplug capabilty (of the bus) with removable media.
You can use IOCTL_STORAGE_GET_HOTPLUG_INFO to find about the hotplug
capabilty.

Regards
Else

|---------±-------------------------------->
| | xxxxx@yah|
| | oo.com |
| | Sent by: |
| | bounce-324191-18867@li|
| | sts.osr.com |
| | |
| | |
| | 05/14/2008 10:21 AM |
| | Please respond to |
| | “Windows File Systems |
| | Devs Interest List” |
|---------±-------------------------------->
>----------------------------------------------------------------------------------------------------------|
| |
| To: “Windows File Systems Devs Interest List” |
| cc: |
| Subject: [ntfsd] FILE_REMOVABLE_MEDIA is not set for USB hard disk…Problem! |
>----------------------------------------------------------------------------------------------------------|

Hi All,

We are working on the data protection project. Our requirement is to
identify
the removeable drives. E.g. When you insert pen drive(name it as E: drive),
then
we must identify that E: is removable. We Identify pen drives as removable
drives as FILE_REMOVABLE_MEDIA is set for them.

But the problem is that for USB hard disk, FILE_REMOVABLE_MEDIA is not set,

although they are removable. You can check it using GetDriveType() function
it
does not return DRIVE_REMOVABLE.

So, can any one help me to identify the USB hard disk as removable drive?

Thanks & regards,
Amit.


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars

You are currently subscribed to ntfsd as: xxxxx@utimaco.de
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks,

But IOCTL_STORAGE_GET_HOTPLUG_INFO fails for floppy drive and does not work on
Windows 2000. Can you please tell me about that.

I didn’t say you should spare checking the FILE_REMOVABLE_MEDIA flag.
You need to combine checking this flag AND using
IOCTL_STORAGE_GET_HOTPLUG_INFO
(which btw will probably work with an USB floppy) AND on W2K check the
bustype,
I think with IOCTL_STORAGE_QUERY_PROPERTY, in a useful manner.

Regards
Else

|---------±-------------------------------->
| | xxxxx@yah|
| | oo.com |
| | Sent by: |
| | bounce-324195-18867@li|
| | sts.osr.com |
| | |
| | |
| | 05/14/2008 10:57 AM |
| | Please respond to |
| | “Windows File Systems |
| | Devs Interest List” |
|---------±-------------------------------->
>------------------------------------------------------------------------------------------------------------|
| |
| To: “Windows File Systems Devs Interest List” |
| cc: |
| Subject: RE:[ntfsd] FILE_REMOVABLE_MEDIA is not set for USB hard disk…Problem! |
>------------------------------------------------------------------------------------------------------------|

Thanks,

But IOCTL_STORAGE_GET_HOTPLUG_INFO fails for floppy drive and does not work
on
Windows 2000. Can you please tell me about that.


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars

You are currently subscribed to ntfsd as: xxxxx@utimaco.de
To unsubscribe send a blank email to xxxxx@lists.osr.com

Define “floppy drive” in your usage below.

If you mean the traditional floppy drive connected to a motherboard via a
34-pin cable, then the source code for the floppy drivers is available in
the WDK.

If you mean the new floppy drive that is a USB device, then I suspect the
IoCtl is supported.

Your problem is mostly a misunderstanding of the word ‘removable’ in its
application to storage. There are devices which have removable media and
devices that are removable. Even in the days of NT 4 there were hot plug
SCSI drives that were removable devices. SyQuest had drives that were both
as is a USB floppy. Flash media readers may be removable devices, but are
always removable media.

wrote in message news:xxxxx@ntfsd…
> Thanks,
>
> But IOCTL_STORAGE_GET_HOTPLUG_INFO fails for floppy drive and does not
> work on
> Windows 2000. Can you please tell me about that.
>

Now All is Ok for HDD, CD/DVD, USB HDD, Pen drive etc., Now I want to check this for mobile devices and cameras.

Problem is that when I attach mobile to PC it does not detect it as drive instead it is detected as system folder or a vertual folder. That’s why I can’t get it’s handle to send the IOCTL to it.

Please tell me how I can get the handle to such devices.

> Problem is that when I attach mobile to PC it does not detect it as drive
instead it

is detected as system folder or a vertual folder. That’s why I can’t get it’s
handle to
send the IOCTL to it.

Please tell me how I can get the handle to such devices.

You cannot.

The driver is a 100% proprietary thing, for instance, for ActiveSync, the
driver is usually some proprietary variation of serial-over-USB, not compatible
with the usual serial driver.

Then there is a stack of DLLs in user mode, the lowest of them is talking to
the driver, the highest of them is the shell namespace extension.

There is no filesystem at all in this case, only the shell namespace.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

That means this folder is not a file system folder but the data on mobile is represented as folder and files using shell extention, and operations(e.g copy file) are simulated using a software containing a deriver and a set of dlls in usermode.

If this is true then my question is that…As we are providing dataprotection and we have to know attached devoice is removable, How we can find that the attached device(mobile) is removable? Is it possible or is there any technique to do so?