Don't try to open CDROM device if none was specified.

This commit is contained in:
Alexandre Julliard 2002-06-13 21:46:02 +00:00
parent bdcf66f800
commit f8d321c2d6
1 changed files with 3 additions and 1 deletions

View File

@ -302,11 +302,13 @@ static int CDROM_Open(HANDLE hDevice, DWORD clientID)
if (!cdrom_cache[dev].count)
{
char root[4];
const char *device;
strcpy(root, "A:\\");
root[0] += dev;
if (GetDriveTypeA(root) != DRIVE_CDROM) return -1;
cdrom_cache[dev].fd = open(DRIVE_GetDevice(dev), O_RDONLY|O_NONBLOCK);
if (!(device = DRIVE_GetDevice(dev))) return -1;
cdrom_cache[dev].fd = open(device, O_RDONLY|O_NONBLOCK);
if (cdrom_cache[dev].fd == -1)
{
FIXME("Can't open configured CD-ROM drive at %s (device %s): %s\n", root, DRIVE_GetDevice(dev), strerror(errno));