I am attempting to write C++/Win32 code that can determine if a given file path refers to a fixed disk. (I absolutely may not use WMI for this task.)
My best bet - at least from this thread -- appear to be the SetupDiXXXX functions. So that's what I'm trying.
I'm already successfully enumerating disks devices using SetupDiGetClassDevs and verifying that they are fixed.
// Get all devices classes of type "DISKDRIVE"
const auto hDevInfo = SetupDiGetClassDevs(
&GUID_DEVCLASS_DISKDRIVE,
nullptr,
nullptr,
DIGCF_PRESENT);
But to link a device back to a given disk path, I would appear (from that thread I mentioned) that I also need to enumerate device interfaces. According to the documentation, That means I must supply the DIGCF_DEVICEINTERFACE flag to SetupDiGetClassDevs. That means I must also supply an "enumerator" argument to the same function. And this leads me to my question.
Where is the list of valid enumerators I may use for SetupDiGetClassDevs and GUID_DEVCLASS_DISKDRIVE? Is there a list?
I already know of one: "SCSI". But this code needs to work on anybody's machine. So what others should I check? Is there a header file somewhere that lists them all? Is there a function I can call to enumerate them?
(I would do this using DeviceIoControl if I could but it does not appear, from what I have read, that it will give me truly reliable information on whether or not a drive is fixed)