You need to get the parameters of the CD-ROM (name, manufacturer, etc.). The code does a fine job with getting these parameters:
HDEVINFO hDevInfo = NULL; SP_DEVINFO_DATA DeviceInfoData; hDevInfo = ::SetupDiGetClassDevs( NULL, 0, 0, DIGCF_PRESENT | DIGCF_ALLCLASSES ); if(hDevInfo != INVALID_HANDLE_VALUE) { DeviceInfoData.cbSize = sizeof( SP_DEVINFO_DATA ); for(int i = 0; ::SetupDiEnumDeviceInfo( hDevInfo, i, &DeviceInfoData ); i++) { // ΠΏΠΎΠ»ΡΡΠ°Π΅ΠΌ Π΄Π»Ρ ΠΊΠ»Π°ΡΡΠ° CDROM Π²ΡΠ΅ Π½Π΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΡΠ΅ Π»ΠΎΠΊΠ°Π»ΠΈΠ·ΠΎΠ²Π°Π½Π½ΡΠ΅ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΡ, ΠΊΡΠΎΠΌΠ΅ Π±ΡΠΊΠ²Ρ Π΄ΠΈΡΠΊΠ° } } How to get the drive letter of the device? The letter CD / DVD-ROM can be obtained using GetLogicalDriveStrings , GetDriveType But how to associate a device with a designated letter?