In the filespy code i want to differentiate between floppy harddisk volumes
and usb pen drive. For all three types DeviceObject->DeviceType is
FILE_DEVICE_DISK_FILE_SYSTEM.
So i thought of a solution which i want to conform from you people to use it
or not
The device name for volumes are \Device\HarddiskVolume1 ,
\Device\Harddiskvolume2
device name for floppy is \device\floppy0
and for usb pendrive \device\harddisk1\dp… some thing like this
can it be safe to find from the names of these device object whether it is a
floppy or harddisk voume or any other removable media. I will search for
floppy string in device name and if i found then i assume that it is floopy.
In case of \Device\Harddiskvolume2 i will search for sting harddiskvolume
and if i found it then i assume it to be harddiak volumes.
Regard
Rohit
Hi;
May be checking the volume object device characteristics for
FILE_REMOVABLE_MEDIA will help you differentiate.
pTargetDevice->Characteristics & FILE_REMOVABLE_MEDIA
Thanks & Regards
Faraz.
On 5/18/06, Rohit wrote:
>
> In the filespy code i want to differentiate between floppy harddisk
> volumes and usb pen drive. For all three types DeviceObject->DeviceType is
> FILE_DEVICE_DISK_FILE_SYSTEM.
> So i thought of a solution which i want to conform from you people to use
> it or not
>
> The device name for volumes are \Device\HarddiskVolume1 ,
> \Device\Harddiskvolume2
> device name for floppy is \device\floppy0
> and for usb pendrive \device\harddisk1\dp… some thing like this
>
> can it be safe to find from the names of these device object whether it is
> a floppy or harddisk voume or any other removable media. I will search for
> floppy string in device name and if i found then i assume that it is floopy.
> In case of \Device\Harddiskvolume2 i will search for sting harddiskvolume
> and if i found it then i assume it to be harddiak volumes.
>
> Regard
> Rohit
> — Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17 You are currently subscribed
> to ntfsd as: xxxxx@gmail.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
> and usb pen drive. For all three types DeviceObject->DeviceType is
FILE_DEVICE_DISK_FILE_SYSTEM.
Try to check the underlying RealDevice’s DeviceType, not the FSD’s VolDO.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
Some USB disks are not recognized by the system( i.e. the class driver ) as removable( because RemovableMedia is FALSE in the _STORAGE_DEVICE_DESCRIPTOR ), therefore using the name of the class driver’s device to recognize the removable devices is a bad idea( they look like the hard drives but actually can be removed from the system using the Safely Remove Hardware app ). In user mode you can use the SetupApi… to find the underlying bus or retrieve the Capabilities for the device( as the Safely Remove Hardware app. does ). In kernel mode you can retrieve the _STORAGE_DEVICE_DESCRIPTOR and check the RemovableMedia( it may be FALSE, therefore class driver recognize it as a non removable disk ) and BusType( it will be BusTypeUsb for USB disks ) fields.
“Rohit” wrote in message news:xxxxx@ntfsd…
In the filespy code i want to differentiate between floppy harddisk volumes and usb pen drive. For all three types DeviceObject->DeviceType is FILE_DEVICE_DISK_FILE_SYSTEM.
So i thought of a solution which i want to conform from you people to use it or not
The device name for volumes are \Device\HarddiskVolume1 , \Device\Harddiskvolume2
device name for floppy is \device\floppy0
and for usb pendrive \device\harddisk1\dp… some thing like this
can it be safe to find from the names of these device object whether it is a floppy or harddisk voume or any other removable media. I will search for floppy string in device name and if i found then i assume that it is floopy. In case of \Device\Harddiskvolume2 i will search for sting harddiskvolume and if i found it then i assume it to be harddiak volumes.
Regard
Rohit