Link to home
Start Free TrialLog in
Avatar of deadice
deadice

asked on

Retreiving CD-ROM / DVD / hard drive information

I need to know the API's related to retreiving device information for CD-ROM, DVD, hard drives: Model, Type, Drive Letter, Manufacturer, etc. Also need a way to determine if a disc is a CD or DVD.
ASKER CERTIFIED SOLUTION
Avatar of DanRollins
DanRollins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of deadice
deadice

ASKER

Ok. I think I should clarify a point, tho. I simply need to populate a ComboBox with only DVD drives (i.e. G: - TOSHIBA XXX DVD-ROM). Currently, I use ASPI to retrive all the information I need, except to map the LUN to an actual drive letter. I was hoping the Win32 API would take of this so I could bypass ASPI.

The code from the EE will take care of the model/serial/drive letter, now I just need a method to determine if the device is a CD-ROM or DVD drive.
Use the GetDriveType() API.

-- Dan
Avatar of deadice

ASKER

this works for CD-ROM but not DVD. DVD and CD-ROM are both DRIVE_CDROM. I need a way to differentiate between the two so only DVD drives appear in the ComboBox;
Maybe you can use GetDiskFreeSpaceEx().  It retuesn the toal disk space (as well as the fre space). If it is > 700KB, it would maybe be a DVD,  I'll keep looking.

-- Dan
DeviceIoControl( hDrv, IOCTL_STORAGE_GET_MEDIA_TYPES_EX,...) looks promising.

-- Dan
Avatar of deadice

ASKER

i'll take a look at that know. it's part of DDK and didn't think to take a look.

i found it easier to query values in the registry to get the extended device information (manu, model, etc.). i decided to go this route instead. i was hoping the keys would contain a value to uniquely identify a dvd, but no such luck. Possibly can use DefaultDvdRegion, but kinda sloppy in my book :)

also, i need this to be determined even when media is not present in the drive, so checking size really isn't an option.