[NTOS:MM] PeFmtCreateSection(): Improve AMD64 image failure case
authorSerge Gautherie <reactos-git_serge_171003@gautherie.fr>
Wed, 15 May 2019 23:26:32 +0000 (01:26 +0200)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 4 Jun 2019 16:22:19 +0000 (18:22 +0200)
Addendum to 98638cc2dfdde460ae49941c76dd51f1b796a001.

CORE-15981

ntoskrnl/mm/section.c

index a8d2945..69ffe53 100644 (file)
@@ -358,18 +358,17 @@ l_ReadHeaderFromFile:
 
     switch(piohOptHeader->Magic)
     {
 
     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
 #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
 #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) &&
     }
 
     if (RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, SectionAlignment) &&