Subject: RE: Detecting CD-ROM drive
From: [email-masked] (Colin Peters)

30 Oct 1997 06:57:21 -0800
Message-ID: <01BCE58B.104678C0.cygnus.gnu-win32@gbird0>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
To: "'Arlindo da Silva'" <[email-masked]>
Cc: "'GNU-Win32'" <[email-masked]>

Arlindo da Silva[SMTP:[email-masked]] wrote:
>Does anybody know how to determine which drive (d:, e:, ...) is a CDROM? 
>Is there any native function for this? Thanks.

UINT GetDriveType(LPTSTR lpszRootPathName);
  
The GetDriveType function returns the type of drive identified by the lpszRootPathName parameter. Here are the possible return values:

Identifier	Meaning
	
0	Drive type can't be determined.
1	Root directory doesn't exist.
DRIVE_REMOVEABLE	Disk can be removed from the drive. This value is returned for floppy drives.
DRIVE_FIXED	Disk can't be removed from the drive. This value is returned for hard drives.
DRIVE_REMOTE	Drive is a remote drive. This value is returned for network drives.
DRIVE_CDROM	Drive is a CDROM drive.
DRIVE_RAMDISK	Drive is a RAM disk.

Aren't CDROMs wonderful? I highly recommend the Microsoft Press
Programmer's Bookshelf to any serious Win32 programmer. Anyway you
can call GetDriveType with a string like "D:\" to test whether a
drive is a CDROM. You can get the set of drives available to test
from GetLogicalDrives (GetLogicalDriveStrings is nicer, but not
implemented on Win95).

Colin.

-- Colin Peters - Saga Univ. Dept. of Information Science
-- [email-masked] - finger for PGP public key
-- http://www.fu.is.saga-u.ac.jp/~colin/index.html
-- http://www.geocities.com/Tokyo/Towers/6162/

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".