示例#1
0
 private static CLIHeader/*!*/ ReadCLIHeader(MemoryCursor/*!*/ c)
 {
     CLIHeader header = new CLIHeader();
     header.cb = c.Int32(0); c.SkipInt32(1);
     header.majorRuntimeVersion = c.UInt16(0);
     header.minorRuntimeVersion = c.UInt16(1); c.SkipUInt16(2);
     header.metaData = ReadDirectoryEntry(c);
     header.flags = c.Int32(0);
     header.entryPointToken = c.Int32(1); c.SkipInt32(2);
     header.resources = ReadDirectoryEntry(c);
     header.strongNameSignature = ReadDirectoryEntry(c);
     header.codeManagerTable = ReadDirectoryEntry(c);
     header.vtableFixups = ReadDirectoryEntry(c);
     header.exportAddressTableJumps = ReadDirectoryEntry(c);
     if (header.majorRuntimeVersion < 2)
         throw new InvalidMetadataException(ExceptionStrings.BadCLIHeader);
     return header;
 }