private void ReadNarrow(EndianAwareBinaryReader reader, ICliMetadataRoot metadataRoot, Action <byte[]> bodyBuilder) { var firstByte = reader.ReadByte(); this.codeSize = (byte)((firstByte & 0xFC) >> 2); bodyBuilder(reader.ReadBytes((int)this.CodeSize)); }
internal CliMetadataModuleReferenceLockedTableRow(uint index, byte state, ICliMetadataRoot metadataRoot, uint nameIndex) { this.index = index; this.metadataRoot = metadataRoot; this.state = state; this.nameIndex = nameIndex; }
internal CliMetadataStandAloneSigLockedTableRow(uint index, byte state, ICliMetadataRoot metadataRoot, uint signatureIndex) { this.index = index; this.metadataRoot = metadataRoot; this.state = state; this.signatureIndex = signatureIndex; }
internal CliMetadataNestedClassLockedTableRow(byte state, ICliMetadataRoot metadataRoot, uint nestedClassIndex, uint enclosingClassIndex) { this.metadataRoot = metadataRoot; this.state = state; this.nestedClassIndex = nestedClassIndex; this.enclosingClassIndex = enclosingClassIndex; }
public CliParameterMemberDictionary(_ICliManager manager, uint methodIndex, ICliMetadataRoot metadataRoot, TParent parent, int dropoff = 0) { this.manager = manager; this.parent = parent; var method = metadataRoot.TableStream.MethodDefinitionTable[(int)methodIndex]; this.signature = method.Signature; bool skipFirst = false; if (method.Parameters.Count > 0 && method.Parameters[0].Sequence == 0) { skipFirst = true; } if (dropoff != 0) { if (skipFirst) { this.Initialize(method.Parameters.Skip(1).Drop(dropoff).ToArray()); } else { this.Initialize(method.Parameters.Drop(dropoff).ToArray()); } } else if (skipFirst) { this.Initialize(method.Parameters.Skip(1).ToArray()); } else { this.Initialize(method.Parameters); } }
internal CliMetadataTypeSpecificationLockedTableRow(uint index, byte state, ICliMetadataRoot metadataRoot, uint signatureIndex) { this.index = index; this.metadataRoot = metadataRoot; this.state = state; this.signatureIndex = signatureIndex; }
private static void ValidateModuleTable(IAssembly hostAssembly, ICliMetadataRoot metadataRoot, CompilerErrorCollection resultErrorCollection) { var moduleTable = metadataRoot.TableStream.ModuleTable; if (moduleTable == null || moduleTable.Count > 1) { if (moduleTable.Count > 1) { // The module table shall contain one and only one row. More than one was found. resultErrorCollection.ModelError(CliWarningsAndErrors.CliMetadata0001, hostAssembly, moduleTable); } else { // The module table shall contain one and only one row. None were found. resultErrorCollection.ModelError(CliWarningsAndErrors.CliMetadata0001, hostAssembly); } } if (moduleTable != null && moduleTable.Count > 0) { var firstModule = moduleTable[1]; if (firstModule.NameIndex == 0) { /* * * Name shall index a non-empty string. This string should match exactly * any corresponding ModuleRef.Name string that resolves to this module. * */ resultErrorCollection.ModelError(CliWarningsAndErrors.CliMetadata0002, hostAssembly, firstModule); } if (firstModule.ModuleVersionIndex == 0) { // Mvid shall index a non-null Guid in the Guid heap. resultErrorCollection.ModelError(CliWarningsAndErrors.CliMetadata0003, hostAssembly, firstModule); } } }
internal CliMetadataAssemblyRefProcessorLockedTableRow(byte state, ICliMetadataRoot metadataRoot, uint processor, uint assemblyRefIndex) { this.metadataRoot = metadataRoot; this.state = state; this.processor = processor; this.assemblyRefIndex = assemblyRefIndex; }
internal CliMetadataFieldRVALockedTableRow(byte state, ICliMetadataRoot metadataRoot, uint rva, uint fieldIndex) { this.metadataRoot = metadataRoot; this.state = state; this.rva = rva; this.fieldIndex = fieldIndex; }
internal CliMetadataMethodHeader(ICliMetadataRoot metadataRoot, uint relativeVirtualAddress, Action <byte[]> bodyBuilder) { var image = metadataRoot.SourceImage; var rvaLocationScan = image.ResolveRelativeVirtualAddress(relativeVirtualAddress); if (rvaLocationScan.Resolved) { var section = rvaLocationScan.Section; var bodySubstream = new Substream(section.SectionData, rvaLocationScan.Offset, 65536, false); var bodyReader = new EndianAwareBinaryReader(bodySubstream, Endianness.LittleEndian, false); var peekedChar = bodyReader.PeekByte(); if (peekedChar != -1) { MethodHeaderFlags headerType = ((MethodHeaderFlags)peekedChar) & MethodHeaderFlags.WideFormat; if (headerType == MethodHeaderFlags.NarrowFormat) { this.ReadNarrow(bodyReader, metadataRoot, bodyBuilder); } else { this.ReadWide(bodyReader, metadataRoot, bodyBuilder); } } } }
internal CliMetadataFieldLayoutLockedTableRow(byte state, ICliMetadataRoot metadataRoot, uint offset, uint fieldIndex) { this.metadataRoot = metadataRoot; this.state = state; this.offset = offset; this.fieldIndex = fieldIndex; }
internal CliMetadataFieldMarshalLockedTableRow(byte state, ICliMetadataRoot metadataRoot, CliMetadataHasFieldMarshalTag parentSource, uint parentIndex, uint nativeTypeIndex) { this.metadataRoot = metadataRoot; this.state = state; this.parentSource = parentSource; this.parentIndex = parentIndex; this.nativeTypeIndex = nativeTypeIndex; }
internal CliMetadataEventMapLockedTableRow(uint index, byte state, ICliMetadataRoot metadataRoot, uint parentIndex, uint eventListIndex) { this.index = index; this.metadataRoot = metadataRoot; this.state = state; this.parentIndex = parentIndex; this.eventListIndex = eventListIndex; }
public CliAssembly(CliManager identityManager, ICliMetadataAssemblyTableRow metadata, IAssemblyUniqueIdentifier uniqueIdentifier, IStrongNamePublicKeyInfo strongNameInfo) { this.metadataRoot = metadata.MetadataRoot; this.MetadataEntry = metadata; this.strongNameInfo = strongNameInfo; this.identityManager = identityManager; this.UniqueIdentifier = new CliAssemblyUniqueIdentifier(uniqueIdentifier, this.FrameworkVersion); }
internal CliMetadataClassLayoutLockedTableRow(byte state, ICliMetadataRoot metadataRoot, ushort packingSize, uint classSize, uint parentIndex) { this.metadataRoot = metadataRoot; this.state = state; this.packingSize = packingSize; this.classSize = classSize; this.parentIndex = parentIndex; }
internal CliMetadataPropertyMapLockedTableRow(uint index, byte state, ICliMetadataRoot metadataRoot, uint parentIndex, uint propertyListIndex) { this.index = index; this.metadataRoot = metadataRoot; this.state = state; this.parentIndex = parentIndex; this.propertyListIndex = propertyListIndex; }
internal CliMetadataMethodSpecificationLockedTableRow(byte state, ICliMetadataRoot metadataRoot, CliMetadataMethodDefOrRefTag methodBodySource, uint methodIndex, uint instantiationIndex) { this.metadataRoot = metadataRoot; this.state = state; this.methodBodySource = methodBodySource; this.methodIndex = methodIndex; this.instantiationIndex = instantiationIndex; }
internal CliMetadataInterfaceImplLockedTableRow(uint index, byte state, ICliMetadataRoot metadataRoot, uint classIndex, CliMetadataTypeDefOrRefTag interfaceSource, uint interfaceIndex) { this.index = index; this.metadataRoot = metadataRoot; this.state = state; this.classIndex = classIndex; this.interfaceSource = interfaceSource; this.interfaceIndex = interfaceIndex; }
internal CliMetadataConstantLockedTableRow(byte state, ICliMetadataRoot metadataRoot, CliMetadataNativeTypes @type, CliMetadataHasConstantTag parentSource, uint parentIndex, uint valueIndex) { this.metadataRoot = metadataRoot; this.state = state; this.@type = @type; this.parentSource = parentSource; this.parentIndex = parentIndex; this.valueIndex = valueIndex; }
public CliMetadataAssemblyProcessorTableReader(ICliMetadataRoot metadataRoot, Tuple <object, FileStream, EndianAwareBinaryReader> readerInfo, uint rowCount) : base(metadataRoot, rowCount) { this.metadataRoot = metadataRoot; this.syncObject = readerInfo.Item1; this.fStream = readerInfo.Item2; this.reader = readerInfo.Item3; this.rowCount = rowCount; }
internal CliMetadataParameterLockedTableRow(uint index, byte state, ICliMetadataRoot metadataRoot, ParameterAttributes flags, ushort sequence, uint nameIndex) { this.index = index; this.metadataRoot = metadataRoot; this.state = state; this.flags = flags; this.sequence = sequence; this.nameIndex = nameIndex; }
internal CliMetadataFieldLockedTableRow(uint index, byte state, ICliMetadataRoot metadataRoot, FieldAttributes fieldAttributes, uint nameIndex, uint fieldTypeIndex) { this.index = index; this.metadataRoot = metadataRoot; this.state = state; this.fieldAttributes = fieldAttributes; this.nameIndex = nameIndex; this.fieldTypeIndex = fieldTypeIndex; }
internal CliMetadataGenericParamConstraintLockedTableRow(uint index, byte state, ICliMetadataRoot metadataRoot, uint ownerIndex, CliMetadataTypeDefOrRefTag constraintSource, uint constraintIndex) { this.index = index; this.metadataRoot = metadataRoot; this.state = state; this.ownerIndex = ownerIndex; this.constraintSource = constraintSource; this.constraintIndex = constraintIndex; }
internal CliMetadataAssemblyRefOSLockedTableRow(byte state, ICliMetadataRoot metadataRoot, uint platformId, uint majorVersion, uint minorVersion, uint assemblyRefIndex) { this.metadataRoot = metadataRoot; this.state = state; this.platformId = platformId; this.majorVersion = majorVersion; this.minorVersion = minorVersion; this.assemblyRefIndex = assemblyRefIndex; }
public CliMetadataGenericParamConstraintTableReader(ICliMetadataRoot metadataRoot, Tuple <object, FileStream, EndianAwareBinaryReader> readerInfo, uint rowCount) : base(metadataRoot, rowCount) { this.metadataRoot = metadataRoot; this.syncObject = readerInfo.Item1; this.fStream = readerInfo.Item2; this.reader = readerInfo.Item3; this.rowCount = rowCount; }
internal CliMetadataPropertyLockedTableRow(uint index, byte state, ICliMetadataRoot metadataRoot, PropertyAttributes flags, uint nameIndex, uint propertyTypeIndex) { this.index = index; this.metadataRoot = metadataRoot; this.state = state; this.flags = flags; this.nameIndex = nameIndex; this.propertyTypeIndex = propertyTypeIndex; }
internal CliMetadataFileLockedTableRow(uint index, byte state, ICliMetadataRoot metadataRoot, CliMetadataFileAttributes flags, uint nameIndex, uint hashValueIndex) { this.index = index; this.metadataRoot = metadataRoot; this.state = state; this.flags = flags; this.nameIndex = nameIndex; this.hashValueIndex = hashValueIndex; }
internal CliMetadataMethodSemanticsLockedTableRow(uint index, byte state, ICliMetadataRoot metadataRoot, MethodSemanticsAttributes semantics, uint methodIndex, CliMetadataHasSemanticsTag associationSource, uint associationIndex) { this.index = index; this.metadataRoot = metadataRoot; this.state = state; this.semantics = semantics; this.methodIndex = methodIndex; this.associationSource = associationSource; this.associationIndex = associationIndex; }
internal CliMetadataTypeRefLockedTableRow(uint index, byte state, ICliMetadataRoot metadataRoot, CliMetadataResolutionScopeTag resolutionScope, uint sourceIndex, uint nameIndex, uint namespaceIndex) { this.index = index; this.metadataRoot = metadataRoot; this.state = state; this.resolutionScope = resolutionScope; this.sourceIndex = sourceIndex; this.nameIndex = nameIndex; this.namespaceIndex = namespaceIndex; }
internal CliMetadataDeclSecurityLockedTableRow(uint index, byte state, ICliMetadataRoot metadataRoot, SecurityAction action, CliMetadataHasDeclSecurityTag parentSource, uint parentIndex, uint permissionSetIndex) { this.index = index; this.metadataRoot = metadataRoot; this.state = state; this.action = action; this.parentSource = parentSource; this.parentIndex = parentIndex; this.permissionSetIndex = permissionSetIndex; }