Author: akhaldi
Date: Mon Oct 7 12:33:03 2013
New Revision: 60573
URL:
http://svn.reactos.org/svn/reactos?rev=60573&view=rev
Log:
[NTOSKRNL]
* Fix several logically dead code blocks. CIDs 731580, 731581 and 731582.
* Add a compile time assert to perform a preventive check as suggested by Thomas Faber.
CORE-6681
Modified:
trunk/reactos/ntoskrnl/mm/pagefile.c
Modified: trunk/reactos/ntoskrnl/mm/pagefile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/pagefile.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/pagefile.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/pagefile.c [iso-8859-1] Mon Oct 7 12:33:03 2013
@@ -115,6 +115,9 @@
#define OFFSET_FROM_ENTRY(i) ((i) >> 11)
#define ENTRY_FROM_FILE_OFFSET(i, j) ((i) | ((j) << 11) | 0x400)
+/* Make sure there can be only 16 paging files */
+C_ASSERT(FILE_FROM_ENTRY(0xffffffff) < MAX_PAGING_FILES);
+
static BOOLEAN MmSwapSpaceMessage = FALSE;
/* FUNCTIONS *****************************************************************/
@@ -239,11 +242,6 @@
i = FILE_FROM_ENTRY(SwapEntry);
offset = OFFSET_FROM_ENTRY(SwapEntry);
- if (i >= MAX_PAGING_FILES)
- {
- DPRINT1("Bad swap entry 0x%.8X\n", SwapEntry);
- KeBugCheck(MEMORY_MANAGEMENT);
- }
if (PagingFileList[i]->FileObject == NULL ||
PagingFileList[i]->FileObject->DeviceObject == NULL)
{
@@ -301,11 +299,6 @@
i = FILE_FROM_ENTRY(SwapEntry);
offset = OFFSET_FROM_ENTRY(SwapEntry);
- if (i >= MAX_PAGING_FILES)
- {
- DPRINT1("Bad swap entry 0x%.8X\n", SwapEntry);
- KeBugCheck(MEMORY_MANAGEMENT);
- }
if (PagingFileList[i]->FileObject == NULL ||
PagingFileList[i]->FileObject->DeviceObject == NULL)
{
@@ -426,12 +419,6 @@
i = FILE_FROM_ENTRY(Entry);
off = OFFSET_FROM_ENTRY(Entry);
-
- if (i >= MAX_PAGING_FILES)
- {
- DPRINT1("Bad swap entry 0x%.8X\n", Entry);
- KeBugCheck(MEMORY_MANAGEMENT);
- }
KeAcquireSpinLock(&PagingFileListLock, &oldIrql);
if (PagingFileList[i] == NULL)