As stated in the title, I'm trying to determine if a drive DVD drive or a CD drive. Again, I am not asking about the media, I'm asking about the actual drive itself... the object pointed to by a DriveInfo class.
I'm thinking the DriveInfo class isn't enough and I'll instead have to get the Win32_DiskDrive instance from WMI and dig around in there. The problem is all the samples I've found so far talk about the detected media, but a DVD drive can use CD media so that isn't sufficient. Plus, the code should work regardless if media is present or not.
You can get it from WMI. Win32_CDROMDrive class.
It will be problem, if you need then to know about BDRom etc. I recommend to use NeroCmd tools instead of WMI.
Also you can try look here. It's about burning, but there you can find Supported Media of drive. If it's support Blu-Ray media, then it's obviously not CD-ROM :)
I was try to get only important parts. Here we are using IMAPI2 API to get device features (CD/DVD/BD/HDDVD-READ). I know, that there are COMBO drives that supports BD and HDDVD but I don't show it in code.
Magic ^_^
Interop...
According to MSDN, IMAPI_FEATURE_PAGE_TYPE can contain not only this values, so be carefull.