Solved

Retreiving CD-ROM / DVD / hard drive information

Posted on 2002-05-19
7
295 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

617 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