We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Getting CD-ROM name

mauromol
mauromol asked
on
Medium Priority
284 Views
Last Modified: 2013-12-03
Hello.
How can I get my CD-ROM drive name?
i.e., I would like to get the manufacturer name (Pioneer) and model name (DR-U12X) for my k: CD-ROM drive...
Many programs do that, but I don't know how!
Please help!
Comment
Watch Question

WDB

Commented:
First open the Cd Device

MICOPENPARMS mciOpenParms;

/** OPEN AND INITIALIZE CD AUDIO  **/
      mciOpenParms.lpstrDeviceType="cdaudio";

      if(dwReturn = mciSendCommand(0,MCI_OPEN,MCI_OPEN_TYPE |
MCI_OPEN_ELEMENT,(DWORD)(LPVOID)&(mciOpenParms)))
      {
                  //report error
      }

Then use mciOPenParms.wDeviceID and call auxGetDeviceCaps()

AUXCAPS ac;
auxGetDevCaps(mciOPenParms.wDeviceID,&ac,sizeof(AUXCAPS));

Now you can get the following information from ac

typedef struct {
    WORD      wMid;
    WORD      wPid;
    MMVERSION vDriverVersion;
    CHAR      szPname[MAXPNAMELEN];
    WORD      wTechnology;
    WORD      wReserved1;
    DWORD     dwSupport;
} AUXCAPS;
 
Members
wMid

Manufacturer identifier for the device driver for the auxiliary audio device. Manufacturer identifiers are defined in Manufacturer and Product Identifiers.

wPid

Product identifier for the auxiliary audio device. Currently, no product identifiers are defined for auxiliary audio devices.

vDriverVersion

Version number of the device driver for the auxiliary audio device. The high-order byte is the major version number, and the low-order byte is the minor version number.

szPname

Product name in a null-terminated string.

wTechnology

Type of the auxiliary audio output:

AUXCAPS_AUXIN

Audio output from auxiliary input jacks.

AUXCAPS_CDAUDIO

Audio output from an internal CD-ROM drive.

wReserved1

Padding.

dwSupport

Describes optional functionality supported by the auxiliary audio device.

AUXCAPS_LRVOLUME

Supports separate left and right volume control.

AUXCAPS_VOLUME

Supports volume control.

If a device supports volume changes, the AUXCAPS_VOLUME flag will be set. If a device supports separate volume changes on the left and right channels, both AUXCAPS_VOLUME and the AUXCAPS_LRVOLUME will be set.



 



Author

Commented:
In this way I can get information about the name of an auxiliary device (such as SB16 Aux: Line-in). However, the DeviceID returned by MCI is different from the ID used by aux functions!
(on my system, using the ID returned by MCI_Open, auxGetDevCaps.szPname is "SB16 Aux: MIDI Synth [220]"!).

I would need to get the manufacturer name and model of the CD-ROM drive! These info are shown in Start | Settings | Control Panel | System under CD-ROM section (I'm talking about W95).
You can read this information from the registry under
HKEY_LOCAL_MACHINE\Enum\SCSI

Under the all SCSI devices (also ATAPI CD-ROM driver) have its own sub key.

You need to enum all the subkeys two levels down, and look to the class of the device to determine if its a CD-ROM drive.

I have a TOSHIBA CDROM drive so there is a subkey called: TOSHIBA_CD-ROM_XM-6202B_1

Use regedit to se what it looks like.

Author

Commented:
Are these keys located in the same place under Windows 98/NT?

I noticed that in this section of my registry there are listed also some peripherals I installed once and then removed. Is there a way to recognize the "active" peripherals from "inactive" ones?
Hmmmm, I cant check the registry on NT right now (only installed on work), but I'll look into it on monday.

Sure there must be a way to determine if the entry is currently active. I'll look into that as well.

Author

Commented:
Thanks! Let me know when you do learn something!

Author

Commented:
Adjusted points to 250
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.