private void ReadTables(BinaryReader br) { Table[] tables = GetTables(); uint Reserved0 = br.ReadUInt32(); byte MajorVersion = br.ReadByte(); byte MinorVersion = br.ReadByte(); metadataStreamVersion = MajorVersion << 16 | MinorVersion; byte HeapSizes = br.ReadByte(); byte Reserved7 = br.ReadByte(); ulong Valid = br.ReadUInt64(); ulong Sorted = br.ReadUInt64(); for (int i = 0; i < 64; i++) { if ((Valid & (1UL << i)) != 0) { tables[i].RowCount = br.ReadInt32(); } else if (tables[i] != null) { tables[i].RowCount = 0; } } MetadataReader mr = new MetadataReader(this, br, HeapSizes); for (int i = 0; i < 64; i++) { if ((Valid & (1UL << i)) != 0) { tables[i].Read(mr); } } }
private void ReadTables(BinaryReader br) { Table[] tables = GetTables(); /*uint Reserved0 =*/ br.ReadUInt32(); byte MajorVersion = br.ReadByte(); byte MinorVersion = br.ReadByte(); metadataStreamVersion = MajorVersion << 16 | MinorVersion; byte HeapSizes = br.ReadByte(); /*byte Reserved7 =*/ br.ReadByte(); ulong Valid = br.ReadUInt64(); ulong Sorted = br.ReadUInt64(); for (int i = 0; i < 64; i++) { if ((Valid & (1UL << i)) != 0) { tables[i].Sorted = (Sorted & (1UL << i)) != 0; tables[i].RowCount = br.ReadInt32(); } } MetadataReader mr = new MetadataReader(this, br.BaseStream, HeapSizes); for (int i = 0; i < 64; i++) { if ((Valid & (1UL << i)) != 0) { tables[i].Read(mr); } } if (ParamPtr.RowCount != 0) { throw new NotImplementedException("ParamPtr table support has not yet been implemented."); } }
private void ReadTables(BinaryReader br) { Table[] tables = GetTables(); uint Reserved0 = br.ReadUInt32(); byte MajorVersion = br.ReadByte(); byte MinorVersion = br.ReadByte(); metadataStreamVersion = MajorVersion << 16 | MinorVersion; byte HeapSizes = br.ReadByte(); byte Reserved7 = br.ReadByte(); ulong Valid = br.ReadUInt64(); ulong Sorted = br.ReadUInt64(); // we require that the GenericParam table is sorted const ulong mask = (1UL << GenericParamTable.Index); if ((Valid & Sorted & mask) != (Valid & mask)) { throw new NotImplementedException(); } for (int i = 0; i < 64; i++) { if ((Valid & (1UL << i)) != 0) { tables[i].RowCount = br.ReadInt32(); } else if (tables[i] != null) { tables[i].RowCount = 0; } } MetadataReader mr = new MetadataReader(this, br, HeapSizes); for (int i = 0; i < 64; i++) { if ((Valid & (1UL << i)) != 0) { tables[i].Read(mr); } } }