I am trying to figure out the type of device for a specific drive. I would like to know how to do this on Mac OS X and Linux, but for now, if that is enough for a Windows solution.
So, let's say I have drive H. I can determine if the device is a removable drive through the Get API function for Win32 (GetDriveType ()). I can also find this on Mac OS X.
But I can’t find the type of device in a reliable way. For example, this is a USB drive, portable hard disk (PHD), etc.
Digging through registries in Windows, I also can not find much information. Although I would prefer to use some APIs for this, if possible, I will use the registry if necessary.
Currently I'm interested ... is it a flash drive drive (so I can show the Usb flash drive icon in my program) or a portable hard drive (so the PHD icon will be displayed).
source
share