- It is very possible for MiGetPfnEntry to be called for a page above the page array size, since not all pages are represented in the array. In this scenario, MiGetPfnEntry should return NULL (and the caller should be prepared for this scenario).

- Also move out the extern definitions outside of the inline, so that other functions may access them and consequently removing a needless UNREFERENCED_PARAMETER.


svn path=/trunk/; revision=41505
This commit is contained in:
ReactOS Portable Systems Group 2009-06-21 04:09:25 +00:00
parent 7f3a8dc045
commit f7ed5bd01d

View file

@ -352,6 +352,9 @@ typedef struct _MMPFN
} u4;
} MMPFN, *PMMPFN;
extern PMMPFN MmPageArray;
extern ULONG MmPageArraySize;
extern MM_STATS MmStats;
typedef struct _MM_PAGEOP
@ -1036,14 +1039,9 @@ PMMPFN
MiGetPfnEntry(IN PFN_TYPE Pfn)
{
PMMPFN Page;
extern PMMPFN MmPageArray;
extern ULONG MmPageArraySize;
/* Mark MmPageArraySize as unreferenced, otherwise it will appear as an unused variable on a Release build */
UNREFERENCED_PARAMETER(MmPageArraySize);
/* Make sure the PFN number is valid */
ASSERT(Pfn <= MmPageArraySize);
if (Pfn > MmPageArraySize) return NULL;
/* Get the entry */
Page = &MmPageArray[Pfn];