mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[NTOS:MM] MiScanMemoryDescriptors(): Use the MiIsMemoryTypeInvisible() and MiIsMemoryTypeFree() helpers.
This commit is contained in:
parent
c53eb190c7
commit
f395f87bb3
1 changed files with 6 additions and 15 deletions
|
@ -421,20 +421,14 @@ MiScanMemoryDescriptors(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
/* Count this descriptor */
|
/* Count this descriptor */
|
||||||
MiNumberDescriptors++;
|
MiNumberDescriptors++;
|
||||||
|
|
||||||
/* Check if this is invisible memory */
|
/* If this is invisible memory, skip this descriptor */
|
||||||
if ((Descriptor->MemoryType == LoaderFirmwarePermanent) ||
|
if (MiIsMemoryTypeInvisible(Descriptor->MemoryType))
|
||||||
(Descriptor->MemoryType == LoaderSpecialMemory) ||
|
|
||||||
(Descriptor->MemoryType == LoaderHALCachedMemory) ||
|
|
||||||
(Descriptor->MemoryType == LoaderBBTMemory))
|
|
||||||
{
|
|
||||||
/* Skip this descriptor */
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if this is bad memory */
|
/* Check if this isn't bad memory */
|
||||||
if (Descriptor->MemoryType != LoaderBad)
|
if (Descriptor->MemoryType != LoaderBad)
|
||||||
{
|
{
|
||||||
/* Count this in the total of pages */
|
/* Count it in the physical pages */
|
||||||
MmNumberOfPhysicalPages += (PFN_COUNT)Descriptor->PageCount;
|
MmNumberOfPhysicalPages += (PFN_COUNT)Descriptor->PageCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -454,12 +448,9 @@ MiScanMemoryDescriptors(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if this is free memory */
|
/* Check if this is free memory */
|
||||||
if ((Descriptor->MemoryType == LoaderFree) ||
|
if (MiIsMemoryTypeFree(Descriptor->MemoryType))
|
||||||
(Descriptor->MemoryType == LoaderLoadedProgram) ||
|
|
||||||
(Descriptor->MemoryType == LoaderFirmwareTemporary) ||
|
|
||||||
(Descriptor->MemoryType == LoaderOsloaderStack))
|
|
||||||
{
|
{
|
||||||
/* Count it too free pages */
|
/* Count it in the free pages */
|
||||||
MiNumberOfFreePages += Descriptor->PageCount;
|
MiNumberOfFreePages += Descriptor->PageCount;
|
||||||
|
|
||||||
/* Check if this is the largest memory descriptor */
|
/* Check if this is the largest memory descriptor */
|
||||||
|
|
Loading…
Reference in a new issue