Article View: borland.public.cppbuilder.nativeapi
Article #4725Re: Get CD-DVD drive name
From: Remy Lebeau (TeamB)
Date: Wed, 14 Dec 2005 20:05
Date: Wed, 14 Dec 2005 20:05
27 lines
1902 bytes
1902 bytes
"Stefano Bonifazi" <stefboombastic@libero.it> wrote in message
news:43a073aa@newsgroups.borland.com...
> Given a drive path (example "d:\\" or "e:\\") how can i get the
> CD-DVD drive name (example "Plextor PX 716-A" or
> "Toshiba DVD-ROM SD...")??
You have to query the hardware device directly for that.
If you are using NT/2K/XP, you can use DeviceIoControl() to send an
IOCTL_SCSI_GET_INQUIRY_DATA command to the device. The return value is a
SCSI_ADAPTER_BUS_INFO structure which then contains a SCSI_INQUIRY_DATA
structure, which will contain the device name. For example:
http://groups.google.com/group/microsoft.public.win32.programmer.mmedia/msg/399670392db558c2?dmode=source
Alternatively, you can use WMI to query the device. You can run a query on
the "Win32_CDROMDrive" class to retreive various information about the
available devices. Or you can use the TWmiStorageInfo component to do the
work for you:
http://www.online-admin.com/wmiset.html#TWmiStorageInfo
Gambit
Technical Details
Message-ID:
<43a07b4c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<43a073aa@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,882de3d541e3a07d X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <43a073aa@newsgroups.borland.com> Subject: Re: Get CD-DVD drive name Date: Wed, 14 Dec 2005 12:05:39 -0800 Lines: 29 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <43a07b4c$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1134590796 68.69.17.41 (14 Dec 2005 12:06:36 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail