On Windows (XP-7), is there a reliable way to program differentiate USB floppy disks and USB flash drives in C ++?
I am currently using WMI to receive updates when new Win32_LogicalDisk instances are Win32_LogicalDisk , and then using the DriveType attribute of the LogicalDisk object to determine the base type. This works quite well, except that floppy drives and USB sticks are DriveType DRIVE_REMOVABLE , so to distinguish between these (floppy vs. flash), I use IOCTL_STORAGE_GET_HOTPLUG_INFO to find out if the device is hotpluggable, and worked on the director, which meant that it was a flash drive, not a floppy disk. Again, I think this works pretty well (if a little inefficient, using both the WDK API and WMI to get information) in the case of internal floppy disks, but, unfortunately, USB floppy disks are also very convenient for connecting to a mobile phone, so there is no clear way to distinguish between flash drives and USB floppy disks that I see. I know that there are properties that can work, for example, checking whether they match the reserved A: or B drives (editing: only relevant if the machine definitely has a floppy drive - see MS-KB: how to change the letter assignment in Windows XP ), or look at the description, but I would like something more reliable.
Sorry for the long explanation, but just want to be clear! Thanks
c ++ wmi usb wdk floppy
user82116
source share