Code:
#include <iostream>
using std::cout;
using std::endl;
#include <windows.h>
#include <string>
using std::string;
int main(int argc, char* argv[])
{
const string strLookup = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string strDrive;
DWORD dwBits = GetLogicalDrives();
const DWORD dwMask = 1;
for(int i = 0;i < strLookup.length();i++){
if(dwMask & dwBits){
strDrive = strLookup[i];
strDrive.append(":\\");
if(GetDriveType(strDrive.c_str()) == DRIVE_CDROM)
cout << "Found CDRom " << strDrive << endl;
}
dwBits >>= dwMask;
}
return 0;
}