https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cf276952690e9d0e4e0a1…
commit cf276952690e9d0e4e0a1fa20bac07b9de214099
Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr>
AuthorDate: Thu May 16 01:26:32 2019 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Tue Jun 4 18:22:19 2019 +0200
[NTOS:MM] PeFmtCreateSection(): Improve AMD64 image failure case
Addendum to 98638cc2dfdde460ae49941c76dd51f1b796a001.
CORE-15981
---
ntoskrnl/mm/section.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c
index a8d294578fe..69ffe53f6dc 100644
--- a/ntoskrnl/mm/section.c
+++ b/ntoskrnl/mm/section.c
@@ -358,18 +358,17 @@ l_ReadHeaderFromFile:
switch(piohOptHeader->Magic)
{
- case IMAGE_NT_OPTIONAL_HDR32_MAGIC:
-#ifdef _WIN64
- case IMAGE_NT_OPTIONAL_HDR64_MAGIC:
-#endif // _WIN64
- break;
-
+ case IMAGE_NT_OPTIONAL_HDR64_MAGIC:
#ifndef _WIN64
- case IMAGE_NT_OPTIONAL_HDR64_MAGIC:
- nStatus = STATUS_INVALID_IMAGE_WIN_64;
+ nStatus = STATUS_INVALID_IMAGE_WIN_64;
+ DIE(("Win64 optional header, unsupported\n"));
+#else
+ // Fall through.
#endif
- default:
- DIE(("Unrecognized optional header, Magic is %X\n",
piohOptHeader->Magic));
+ case IMAGE_NT_OPTIONAL_HDR32_MAGIC:
+ break;
+ default:
+ DIE(("Unrecognized optional header, Magic is %X\n",
piohOptHeader->Magic));
}
if (RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, SectionAlignment) &&