https://git.reactos.org/?p=reactos.git;a=commitdiff;h=710acab83df00d86ea954…
commit 710acab83df00d86ea95482b527ff841b28f7e7f
Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr>
AuthorDate: Wed Sep 9 03:46:56 2020 +0200
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Mon Apr 26 10:27:20 2021 +0200
[NTOS:MM] MiSetPagingOfDriver(): Add an explicit #if around unreachable code
---
ntoskrnl/mm/ARM3/sysldr.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/ntoskrnl/mm/ARM3/sysldr.c b/ntoskrnl/mm/ARM3/sysldr.c
index c1c7ad0cea9..d3d9669ab52 100644
--- a/ntoskrnl/mm/ARM3/sysldr.c
+++ b/ntoskrnl/mm/ARM3/sysldr.c
@@ -2436,8 +2436,6 @@ MiSetSystemCodeProtection(
/* Flush it all */
KeFlushEntireTb(TRUE, TRUE);
-
- return;
}
VOID
@@ -2562,17 +2560,20 @@ NTAPI
MiSetPagingOfDriver(IN PMMPTE PointerPte,
IN PMMPTE LastPte)
{
+#ifdef ENABLE_MISETPAGINGOFDRIVER
PVOID ImageBase;
PETHREAD CurrentThread = PsGetCurrentThread();
PFN_COUNT PageCount = 0;
PFN_NUMBER PageFrameIndex;
PMMPFN Pfn1;
+#endif // ENABLE_MISETPAGINGOFDRIVER
+
PAGED_CODE();
+#ifndef ENABLE_MISETPAGINGOFDRIVER
/* The page fault handler is broken and doesn't page back in! */
DPRINT1("WARNING: MiSetPagingOfDriver() called, but paging is broken!
ignoring!\n");
- return;
-
+#else // ENABLE_MISETPAGINGOFDRIVER
/* Get the driver's base address */
ImageBase = MiPteToAddress(PointerPte);
ASSERT(MI_IS_SESSION_IMAGE_ADDRESS(ImageBase) == FALSE);
@@ -2610,6 +2611,7 @@ MiSetPagingOfDriver(IN PMMPTE PointerPte,
/* Update counters */
InterlockedExchangeAdd((PLONG)&MmTotalSystemDriverPages, PageCount);
}
+#endif // ENABLE_MISETPAGINGOFDRIVER
}
VOID