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!