TechTalkz.com Logo Ask the Experts!

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Device Drivers

how to determine a removable drive is a floppy drive

Microsoft Device Drivers

 
 
Thread Tools Display Modes
Unread 29-11-2007, 01:02 PM   #1
Cecil Sheng
Guest
 
Posts: n/a
how to determine a removable drive is a floppy drive

HI,

The GetDriveType API returns DRIVE_REMOVABLE when the drive is a floppy or
an usb disk(not usb harddisk).

How do i distinguish the two?
 
Unread 29-11-2007, 01:02 PM   #2
Pavel A.
Guest
 
Posts: n/a
RE: how to determine a removable drive is a floppy drive

"Cecil Sheng" wrote:
> HI,
>
> The GetDriveType API returns DRIVE_REMOVABLE when the drive is a floppy or
> an usb disk(not usb harddisk).
>
> How do i distinguish the two?


Floppy disks are usually <= 2.8 MB.
USB flash are usually > 10 MB.

--PA

 
Unread 29-11-2007, 01:03 PM   #3
Michael Xing
Guest
 
Posts: n/a
RE: how to determine a removable drive is a floppy drive

Use IOCTL_DISK_GET_DRIVE_GEOMETRY to get the media type.

-Michael

"Cecil Sheng" wrote:

> HI,
>
> The GetDriveType API returns DRIVE_REMOVABLE when the drive is a floppy or
> an usb disk(not usb harddisk).
>
> How do i distinguish the two?

 
Unread 29-11-2007, 01:03 PM   #4
Cecil Sheng
Guest
 
Posts: n/a
RE: how to determine a removable drive is a floppy drive

When there is no diskette in floppy drive, the DeviceIoControl fails,
GetLastError()==50.

"Michael Xing" wrote:

> Use IOCTL_DISK_GET_DRIVE_GEOMETRY to get the media type.
>
> -Michael
>
> "Cecil Sheng" wrote:
>
> > HI,
> >
> > The GetDriveType API returns DRIVE_REMOVABLE when the drive is a floppy or
> > an usb disk(not usb harddisk).
> >
> > How do i distinguish the two?

 
Unread 29-11-2007, 01:04 PM   #5
Pavel A.
Guest
 
Posts: n/a
RE: how to determine a removable drive is a floppy drive

"Cecil Sheng" wrote:
> When there is no diskette in floppy drive, the DeviceIoControl fails,
> GetLastError()==50.


Very good. A flash drive can't have "no media" condition, so you immediately
know that it is a floppy.

--PA

 
Unread 29-11-2007, 01:04 PM   #6
cristalink
Guest
 
Posts: n/a
Re: how to determine a removable drive is a floppy drive

QueryDosDevice(driveLetter) and check if the target path contains
\Device\Floppy
--
http://www.cristalink.com


"Cecil Sheng" <cecilsheng@foquest.com.tw.(donotspam).com> wrote in message
news:85B4D73E-C555-4BF9-9E94-EC74562ECBB8@microsoft.com...
> HI,
>
> The GetDriveType API returns DRIVE_REMOVABLE when the drive is a floppy or
> an usb disk(not usb harddisk).
>
> How do i distinguish the two?



 
Unread 29-11-2007, 01:04 PM   #7
Michael Xing
Guest
 
Posts: n/a
RE: how to determine a removable drive is a floppy drive

IOCTL_STORAGE_GET_MEDIA_TYPES should work for floppy. And
IOCTL_STORAGE_GET_MEDIA_TYPES or IOCTL_STORAGE_GET_MEDIA_TYPES_EX should work
for other.

-Michael

"Cecil Sheng" wrote:

> When there is no diskette in floppy drive, the DeviceIoControl fails,
> GetLastError()==50.
>
> "Michael Xing" wrote:
>
> > Use IOCTL_DISK_GET_DRIVE_GEOMETRY to get the media type.
> >
> > -Michael
> >
> > "Cecil Sheng" wrote:
> >
> > > HI,
> > >
> > > The GetDriveType API returns DRIVE_REMOVABLE when the drive is a floppy or
> > > an usb disk(not usb harddisk).
> > >
> > > How do i distinguish the two?

 
 

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT. The time now is 11:37 PM.


vBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2013, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional