www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/10/30/06:57:21

From: colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp (Colin Peters)
Subject: RE: Detecting CD-ROM drive
30 Oct 1997 06:57:21 -0800 :
Message-ID: <01BCE58B.104678C0.cygnus.gnu-win32@gbird0>
Mime-Version: 1.0
To: "'Arlindo da Silva'" <arlindo AT niteroi DOT gsfc DOT nasa DOT gov>
Cc: "'GNU-Win32'" <gnu-win32 AT cygnus DOT com>

Arlindo da Silva[SMTP:arlindo AT niteroi DOT gsfc DOT nasa DOT gov] 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
-- colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp - 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
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019