CacheInitializeDrive() no longer retains old cache data on removable drives

Fixed small bug where it could possibly try to read more sectors than the BIOS supports

svn path=/trunk/; revision=2611
This commit is contained in:
Brian Palmer 2002-02-08 23:58:12 +00:00
parent 1cc5bd55b6
commit bfa03497ad

View file

@ -41,8 +41,11 @@ BOOL CacheInitializeDrive(ULONG DriveNumber)
PCACHE_BLOCK NextCacheBlock;
// If we already have a cache for this drive then
// by all means lets keep it
if (CacheManagerInitialized && DriveNumber == CacheManagerDrive.DriveNumber)
// by all means lets keep it, unless it is a removable
// drive, in which case we'll invalidate the cache
if ((CacheManagerInitialized == TRUE) &&
(DriveNumber == CacheManagerDrive.DriveNumber) &&
(DriveNumber >= 0x80))
{
return TRUE;
}
@ -85,7 +88,10 @@ BOOL CacheInitializeDrive(ULONG DriveNumber)
// If not then the block size is the size of one track
if (CacheManagerDrive.LbaSupported)
{
CacheManagerDrive.BlockSize = 128;
// FIXME: Temporarily reduced this to
// 64 sectors since not all BIOS calls
// support reading as many as 128 sectors
CacheManagerDrive.BlockSize = 64;//128;
}
else
{