Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

First CD-ROM device: CdRom0 or CdRom1?

426 views
Skip to first unread message

Pierre Duhem

unread,
Sep 24, 2001, 9:42:26 AM9/24/01
to
Hi everybody,

I observed something curious.

If you have a CD-ROM device on a computer running under Win2k, its
device name is CdRom0 and you can use this in a call to CreateFile...

So far so good.

Now, I add a second CD-ROM drive (SCSI one) and reboot. O wonder, the
device names are now CdRom1 and CdRom2. Where is the 0?

As I want to know what happens, I reboot the computer with a single
CD-ROM drive, get my CdRom0 as expected, but nom connect the second one,
and ask the SCSI adapter to rescan the bus and refresh its tables.

Second wonder: I now get CdRom0 and CdRom1!!

If you have to scan the bus and build a table of all CD-ROM drives
accessible on a computer, this doesn't make the job easy ;-((

HTH somebody
Best regards

Pierre Duhem
Logiciels & Services Duhem, Paris, France
http://www.macdisk.com
du...@Xmacdisk.com
Please remove the X from the address to answer through email

Pierre Duhem

unread,
Sep 24, 2001, 10:22:45 AM9/24/01
to
On Mon, 24 Sep 2001 15:42:26 +0200, Pierre Duhem <du...@Xmacdisk.com>
wrote:

>If you have to scan the bus and build a table of all CD-ROM drives
>accessible on a computer, this doesn't make the job easy ;-((
>

I made some tests under XP and found that the single CD-ROM drives
appears as CdRom0, but that both CD-ROMs appear as CdRom1 and CdRom3.
Under such conditions, I think the only logical possibility to scan the
drives is to use CdRom0 to CdRom9 and to check every one.

Maxim S. Shatskih

unread,
Sep 24, 2001, 12:37:22 PM9/24/01
to
> If you have to scan the bus and build a table of all CD-ROM drives
> accessible on a computer, this doesn't make the job easy ;-((

Why not enumerate the device interface instances?

Max

Pierre Duhem

unread,
Sep 25, 2001, 5:04:05 AM9/25/01
to

I tried to make my code work with several kinds of hardware (USB,
FireWire, parallel port, IDE/ATAPI) and found that this scanning method,
then getting a Volume{GUID} string, was the only one which didn't
ignore some drives.

Maxim S. Shatskih

unread,
Sep 25, 2001, 8:42:23 AM9/25/01
to
> I tried to make my code work with several kinds of hardware (USB,
> FireWire, parallel port, IDE/ATAPI) and found that this scanning method,
> then getting a Volume{GUID} string, was the only one which didn't
> ignore some drives.

Strange. All of these devices are SCSI LUNs logically and have
ClassPnP/CdRom on top of them.
At least SCSI/IDE/1394 are LUNs for sure.

Max

Andrew Naiden

unread,
Sep 25, 2001, 11:39:47 AM9/25/01
to
Hi!

> Under such conditions, I think the only logical possibility to scan the
> drives is to use CdRom0 to CdRom9 and to check every one.

That is incorrect - the number of cdrom can be any DWORD value, not 0 - 9 only.

Total number of CDROMs can not exceed 100, but their numbers can have any value.
You should get total number of CDROMs in system with IoGetConfigurationInformation()
and increment cdrom number from 0 until you find all devices.

As alternative you can get pointer to cdrom driver object and enumerate all its device objects.

Andrew

Ramu

unread,
Sep 28, 2001, 11:45:43 AM9/28/01
to
Q305184: SAMPLE: Enumerate CD Drives and Get Their Properties/Capabilities

http://support.microsoft.com/support/kb/articles/Q305/1/84.ASP


"Pierre Duhem" <du...@Xmacdisk.com> wrote in message
news:j0i0rtoa4fabghmec...@4ax.com...

Mike Berhan

unread,
Oct 12, 2001, 12:20:54 AM10/12/01
to
Pierre Duhem <du...@Xmacdisk.com> wrote in
news:j0i0rtoa4fabghmec...@4ax.com:

> I tried to make my code work with several kinds of hardware (USB,
> FireWire, parallel port, IDE/ATAPI) and found that this scanning method,
> then getting a Volume{GUID} string, was the only one which didn't
> ignore some drives.

A little late on the reply but we have a free utility that may assist you in
this. It's a GUID Explorer applet at:

http://www.bidali.com/downloads

Download GuidExp.exe. Click on the GUID_DEVCLASS_CDROM GUID and see if it
sees all your CD-ROM drives. It uses the SetupDi* set of APIs. It's
nothing fancy, just something we wrote internally, but perhaps it can be
used as a secondary check. I'd be very interested in hearing from you if
it's not finding CD-ROM drives on your system that the OS has detected (i.e.
drive letter assigned).

Regards,

Mike Berhan

0 new messages