diff options
author | jfrijters <jfrijters> | 2011-10-11 08:57:57 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2011-10-11 08:57:57 +0400 |
commit | f59b5446af314379d8d69b362b8a2d2530d10a5f (patch) | |
tree | 4255c34f289707af2ae0dd25994a922b759d4feb /reflect/Reader | |
parent | d8b3bc9bc9aa71483755c70d5a38b2bd8d8e98ea (diff) |
Added support for PortableExecutableKinds.Preferred32Bit.
Diffstat (limited to 'reflect/Reader')
-rw-r--r-- | reflect/Reader/ModuleReader.cs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/reflect/Reader/ModuleReader.cs b/reflect/Reader/ModuleReader.cs index fc0aac26..3a69502c 100644 --- a/reflect/Reader/ModuleReader.cs +++ b/reflect/Reader/ModuleReader.cs @@ -1085,9 +1085,18 @@ namespace IKVM.Reflection.Reader { peKind |= PortableExecutableKinds.ILOnly; } - if ((cliHeader.Flags & CliHeader.COMIMAGE_FLAGS_32BITREQUIRED) != 0) + switch (cliHeader.Flags & (CliHeader.COMIMAGE_FLAGS_32BITREQUIRED | CliHeader.COMIMAGE_FLAGS_32BITPREFERRED)) { - peKind |= PortableExecutableKinds.Required32Bit; + case CliHeader.COMIMAGE_FLAGS_32BITREQUIRED: + peKind |= PortableExecutableKinds.Required32Bit; + break; + case CliHeader.COMIMAGE_FLAGS_32BITREQUIRED | CliHeader.COMIMAGE_FLAGS_32BITPREFERRED: + peKind |= PortableExecutableKinds.Preferred32Bit; + break; + default: + // COMIMAGE_FLAGS_32BITPREFERRED by itself is illegal, so we ignore it + // (not setting any flag is ok) + break; } if (peFile.OptionalHeader.Magic == IMAGE_OPTIONAL_HEADER.IMAGE_NT_OPTIONAL_HDR64_MAGIC) { |