// If we already have a cache for this drive then
// by all means lets keep it, unless it is a removable
// drive, in which case we'll invalidate the cache
- if ((CacheManagerInitialized == TRUE) &&
+ if ((CacheManagerInitialized) &&
(DriveNumber == CacheManagerDrive.DriveNumber) &&
(DriveNumber >= 0x80) &&
- (CacheManagerDataInvalid != TRUE))
+ (!CacheManagerDataInvalid))
{
return TRUE;
}
CACHE_BLOCK,
ListEntry);
- MmHeapFree(NextCacheBlock->BlockData);
- MmHeapFree(NextCacheBlock);
+ FrLdrTempFree(NextCacheBlock->BlockData, TAG_CACHE_DATA);
+ FrLdrTempFree(NextCacheBlock, TAG_CACHE_BLOCK);
}
}
CacheBlockCount = 0;
CacheSizeLimit = TotalPagesInLookupTable / 8 * MM_PAGE_SIZE;
CacheSizeCurrent = 0;
- if (CacheSizeLimit < (64 * 1024))
+ if (CacheSizeLimit > TEMP_HEAP_SIZE - (128 * 1024))
{
- CacheSizeLimit = (64 * 1024);
+ CacheSizeLimit = TEMP_HEAP_SIZE - (128 * 1024);
}
CacheManagerInitialized = TRUE;
}
//
- // Caculate which blocks we must cache
+ // Calculate which blocks we must cache
//
StartBlock = (ULONG)(StartSector / CacheManagerDrive.BlockSize);
SectorOffsetInStartBlock = (ULONG)(StartSector % CacheManagerDrive.BlockSize);
}
//
- // Caculate which blocks we must cache
+ // Calculate which blocks we must cache
//
StartBlock = StartSector / CacheManagerDrive.BlockSize;
EndBlock = (StartSector + SectorCount) / CacheManagerDrive.BlockSize;