public FieldMarshalEntry(PEFile module, byte *ptr, int metadataOffset, int row) { this.module = module; this.metadata = module.Metadata; this.RID = row; var rowOffset = metadata.GetTableMetadataOffset(TableIndex.FieldMarshal) + metadata.GetTableRowSize(TableIndex.FieldMarshal) * (row - 1); this.Offset = metadataOffset + rowOffset; int hasFieldMarshalRefSize = metadata.ComputeCodedTokenSize(32768, TableMask.Field | TableMask.Param); int blobHeapSize = metadata.GetHeapSize(HeapIndex.Blob) < ushort.MaxValue ? 2 : 4; this.fieldMarshal = new FieldMarshal(ptr + rowOffset, blobHeapSize, hasFieldMarshalRefSize); }
public unsafe ImplMapEntry(PEFile module, byte *ptr, int metadataOffset, int row) { this.module = module; this.metadata = module.Metadata; this.RID = row; var rowOffset = metadata.GetTableMetadataOffset(TableIndex.ImplMap) + metadata.GetTableRowSize(TableIndex.ImplMap) * (row - 1); this.Offset = metadataOffset + rowOffset; int moduleRefSize = metadata.GetTableRowCount(TableIndex.ModuleRef) < ushort.MaxValue ? 2 : 4; int memberForwardedTagRefSize = metadata.ComputeCodedTokenSize(32768, TableMask.MethodDef | TableMask.Field); int stringHandleSize = metadata.GetHeapSize(HeapIndex.String) < ushort.MaxValue ? 2 : 4; this.implMap = new ImplMap(ptr + rowOffset, moduleRefSize, memberForwardedTagRefSize, stringHandleSize); }
public InterfaceImplEntry(PEFile module, byte *ptr, int metadataOffset, int row) { this.module = module; this.metadata = module.Metadata; this.RID = row; var rowOffset = metadata.GetTableMetadataOffset(TableIndex.InterfaceImpl) + metadata.GetTableRowSize(TableIndex.InterfaceImpl) * (row - 1); this.Offset = metadataOffset + rowOffset; this.interfaceImpl = new InterfaceImpl(ptr + rowOffset, metadata.GetTableRowCount(TableIndex.TypeDef) < ushort.MaxValue ? 2 : 4, metadata.ComputeCodedTokenSize(16384, TableMask.TypeDef | TableMask.TypeRef | TableMask.TypeSpec)); }