News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

API to test for CD/DVD drive?

Started by Ian_B, January 31, 2006, 12:47:02 AM

Previous topic - Next topic

Ian_B

Can anyone point me in the direction of an API that will test a volume and return if it's a CD or DVD drive, ie. read-only media? Or a strategy for determining this from a path or drive letter?

IanB

zooba

GetDriveType

UINT GetDriveType(
  LPCTSTR lpRootPathName
);


Return values:

DRIVE_UNKNOWN The drive type cannot be determined.
DRIVE_NO_ROOT_DIR The root path is invalid. For example, no volume is mounted at the path.
DRIVE_REMOVABLE The disk can be removed from the drive.
DRIVE_FIXED The disk cannot be removed from the drive.
DRIVE_REMOTE The drive is a remote (network) drive.
DRIVE_CDROM The drive is a CD-ROM drive.
DRIVE_RAMDISK The drive is a RAM disk.


I'm not 100% sure how it responds when there is no disk in the drive. The description seems to indicate that it will work, but the possibility of a DRIVE_NO_ROOT_DIR response makes me uncertain.

Cheers,

Zooba :U