mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
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:
parent
1cc5bd55b6
commit
bfa03497ad
1 changed files with 9 additions and 3 deletions
12
freeldr/freeldr/cache/cache.c
vendored
12
freeldr/freeldr/cache/cache.c
vendored
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue