Click to See Complete Forum and Search --> : How to find out the "real" CD-ROM Mediatype ?


AlionSolutions
January 19th, 2004, 07:59 AM
Hi,
working at my current project I ran into a problem wich I didn't expect.
Ok, I simply have to find out if wich kind of Media is really present in a CD-ROM or DVD-Drive. This means I want to find out if there is a Data-CD or an Audio-CD maybe a DVD inside the drive.
Using Win32-API GetDriveType provides only information, that there's some kind of "CD-ROM-thingie" ;) present, but no detailled information about the kind of media inside the drive.

I would appreciate any help on this very much.

Greetinx and Thanx in advance

Juergen

AlionSolutions
January 19th, 2004, 09:23 AM
Hi Folks,
since nobody couldn't help me until now I want to tell those interested what I found out myself:

1. Find out wich drives are of interest at all calling GetDriveType and comparing the results with DRIVE_CDROM.

2 To find out if it is an audio-cd call GetVolumeInformation and compare the Name with "CD Audio". For some reason every Audio-CD is named "Audio CD" under Win32. :lol:

3. If it was no Audio-CD, maybe it is a DVD. But how to find out about this.?
GetVolumeInformation provides the name of the filsystem of the volume also. The Filesystem of DVD's is in most (or all) cases the UDF-Filesystem. So, just compare the Filesystem-Name returned by GetVolumeInformation with UDF and we got it :cool:

Ok, I don't find this very elegant nor smart. Looks like pushing Nails with a Screwdriver instead of a hammer... for short: It doesn't look very nice :blush:

But it was the only way I could find. If anybody has a better solution.... I'm still waiting ;)

Greetinx from the Win32API-Battlefield:

Juergen