Solved

Retreiving CD-ROM / DVD / hard drive information

Posted on 2002-05-19
7
291 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:deadice
  • 4
  • 3
7 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 200 total points
ID: 7020278
You will need to tap into several sources.  The GetVolumeInformation() API returns a lot of that.

Some other info is available by using DeviceIoControl( handle, IOCTL_STORAGE_GET_MEDIA_TYPES,...) after using the CreateFile() API to open a device handle.

The Model ID and manufactures and even the 'hardware serial namber' are easily available for WinNt, but not so easily accessible for Win9x.  Here is a link to an open Q in which we are exploring these issues:

   http://www.experts-exchange.com/cplusprog/Q.20299743.html

-- Dan
0
 

Author Comment

by:deadice
ID: 7020482
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.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7020538
Use the GetDriveType() API.

-- Dan
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

Author Comment

by:deadice
ID: 7020558
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;
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7020597
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
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7020616
DeviceIoControl( hDrv, IOCTL_STORAGE_GET_MEDIA_TYPES_EX,...) looks promising.

-- Dan
0
 

Author Comment

by:deadice
ID: 7020760
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.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
repeatSeparator  java  challenge 13 57
deburging in oracle form 12 100
unable to delete all specified values regedit 38 433
Excel file not created as expected 7 72
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question