-
Enumerate ALL CD-drives
I'd like to enumerate all cd drives that are present on a computer, with letters and descriptions, and including ALL kind of drive type, in example :
E - TEAC CR-D/RW 10/12/32 rev 10.B
F - MITSUMI CD-ROM FX4830T!B
G - IBM DVD-ROM 1220 a
etc...
How can I do that ??
Thanks in advance !
-
GetLogicalDriveStrings to find all drives
GetDriveType to see if it's a CD Rom
GetVolumeInformation will give some info on the drive details....
-
I'm feeling generous! Have some code:-
Code:
// cDriveLetter is a global - "char cDriveLetter;"
int GetCDDrive(void)
{
DWORD dwDrives;
int i;
char szDrive[4];
dwDrives = GetLogicalDrives();
for (i=0;i<32;i++)
{
if (dwDrives & 1)
{
wsprintf(szDrive, "%c:\\", 65 + i);
if (GetDriveType(szDrive) == DRIVE_CDROM)
{
cDriveLetter = 65 + i;
return TRUE;
}
}
dwDrives >>= 1;
}
return FALSE;
}
That'll get you the first CD-ROM drive in a system. All you need to do is extend it slightly by including GetVolumeInformation and enumerating through all drives and you're done. Have fun! :D
-
Well, what can I say ? Thankx to you all for these great information ! It sure will help me a lot !