Changed CD-ROM detection code to be compatible with Windows NT 3.x.

This commit is contained in:
Ryan C. Gordon 2002-07-14 15:11:39 +00:00
parent 480a259452
commit 0db235a52b
1 changed files with 5 additions and 5 deletions

View File

@ -249,22 +249,22 @@ static int determineUserDir(void)
} /* determineUserDir */ } /* determineUserDir */
static BOOL mediaInDrive(const char *driveLetter) static BOOL mediaInDrive(const char *drive)
{ {
UINT oldErrorMode; UINT oldErrorMode;
DWORD dummyValue; DWORD tmp;
BOOL returnValue; BOOL retval;
/* Prevent windows warning message to appear when checking media size */ /* Prevent windows warning message to appear when checking media size */
oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS); oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
/* If this function succeeds, there's media in the drive */ /* If this function succeeds, there's media in the drive */
returnValue = GetDiskFreeSpace(driveLetter, &dummyValue, &dummyValue, &dummyValue, &dummyValue); retval = GetVolumeInformation(drive, NULL, 0, NULL, NULL, &tmp, NULL, 0);
/* Revert back to old windows error handler */ /* Revert back to old windows error handler */
SetErrorMode(oldErrorMode); SetErrorMode(oldErrorMode);
return(returnValue); return(retval);
} /* mediaInDrive */ } /* mediaInDrive */