https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4795d953c01b2e4bf21c2…
commit 4795d953c01b2e4bf21c2843f347e3f6c201db0e
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Mon Sep 6 01:05:14 2021 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Sep 6 01:05:14 2021 +0200
[NTOS:IO] Fix an ASSERT. Addendum to commit 1fd730b7.
---
ntoskrnl/io/iomgr/driver.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ntoskrnl/io/iomgr/driver.c b/ntoskrnl/io/iomgr/driver.c
index eb3817b98ec..8be45e3459a 100644
--- a/ntoskrnl/io/iomgr/driver.c
+++ b/ntoskrnl/io/iomgr/driver.c
@@ -454,7 +454,8 @@ IopInitializeDriverModule(
*/
PIMAGE_NT_HEADERS NtHeaders = RtlImageNtHeader(ModuleObject->DllBase);
ASSERT(NtHeaders);
- ASSERT(ModuleObject->SizeOfImage == NtHeaders->OptionalHeader.SizeOfImage);
+ // NOTE: ModuleObject->SizeOfImage is actually (number of PTEs)*PAGE_SIZE.
+ ASSERT(ModuleObject->SizeOfImage ==
ROUND_TO_PAGES(NtHeaders->OptionalHeader.SizeOfImage));
ASSERT(ModuleObject->EntryPoint == RVA(ModuleObject->DllBase,
NtHeaders->OptionalHeader.AddressOfEntryPoint));
/* Obtain the registry path for the DriverInit routine */