[NTOS:MM] PeFmtCreateSection(): Improve AMD64 image failure case

Addendum to 98638cc2df.

CORE-15981
This commit is contained in:
Serge Gautherie 2019-05-16 01:26:32 +02:00 committed by Timo Kreuzer
parent 38db074491
commit cf27695269

View file

@ -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) &&