![]() |
|
|
|||||||
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
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? |
|
|
#2 |
|
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 |
|
|
#3 |
|
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? |
|
|
#4 |
|
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? |
|
|
#5 |
|
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 |
|
|
#6 |
|
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? |
|
|
#7 |
|
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? |