Solved

Retreiving CD-ROM / DVD / hard drive information

Posted on 2002-05-19
7
292 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
Industry Leaders: 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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Separate files macro - Errors on larger data set 18 73
FizzBuzz challenge 9 84
mapAB Challlenge 35 171
Authenticate using sesu from script 7 106
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: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

685 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