Solved

Retreiving CD-ROM / DVD / hard drive information

Posted on 2002-05-19
7
288 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
Comment Utility
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
Comment Utility
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
Comment Utility
Use the GetDriveType() API.

-- Dan
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:deadice
Comment Utility
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
Comment Utility
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
Comment Utility
DeviceIoControl( hDrv, IOCTL_STORAGE_GET_MEDIA_TYPES_EX,...) looks promising.

-- Dan
0
 

Author Comment

by:deadice
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now