internal GenericParameter(GenericParameterRow *pRow, PEFile peFile, IGenericParameterScope parent) : base(TypeKind.GenericParameter) { m_pRow = (GenericParameterRow *)FluentAsserts.CheckNotNull((void *)pRow, "pRow"); m_peFile = peFile.CheckNotNull("peFile"); m_parent = parent.CheckNotNull("parent"); }
internal GenericParameter(GenericParameterRow * pRow, PEFile peFile, IGenericParameterScope parent) : base(TypeKind.GenericParameter) { m_pRow = (GenericParameterRow *)FluentAsserts.CheckNotNull((void*) pRow, "pRow"); m_peFile = peFile.CheckNotNull("peFile"); m_parent = parent.CheckNotNull("parent"); }
private Module(Assembly assembly, ModuleRow* moduleRow, PEFile peFile) { m_lockObject = new object(); m_assembly = assembly.CheckNotNull("assembly"); m_pModuleRow = (ModuleRow *)FluentAsserts.CheckNotNull((void *)moduleRow, "moduleRow"); m_peFile = peFile.CheckNotNull("peFile"); m_containsMetadata = true; }
internal unsafe MethodImplementation(MethodImplRow* pRow, PEFile peFile) { FluentAsserts.CheckNotNull((void *)pRow, "pRow"); peFile.CheckNotNull("peFile"); m_implementedMethod = new MethodReference(pRow->GetImplementedMethod(peFile)); m_implementingMethod = new MethodReference(pRow->GetImplementingMethod(peFile)); }
private Module(Assembly assembly, ModuleRow *moduleRow, PEFile peFile) { m_lockObject = new object(); m_assembly = assembly.CheckNotNull("assembly"); m_pModuleRow = (ModuleRow *)FluentAsserts.CheckNotNull((void *)moduleRow, "moduleRow"); m_peFile = peFile.CheckNotNull("peFile"); m_containsMetadata = true; }
internal unsafe MethodImplementation(MethodImplRow *pRow, PEFile peFile) { FluentAsserts.CheckNotNull((void *)pRow, "pRow"); peFile.CheckNotNull("peFile"); m_implementedMethod = new MethodReference(pRow->GetImplementedMethod(peFile)); m_implementingMethod = new MethodReference(pRow->GetImplementingMethod(peFile)); }
public OneBasedIndex GetOwner(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (GenericParameterConstraintRow* pThis = &this) { if (MetadataTable.GenericParam.IndexSize(peFile) == 2) { return new OneBasedIndex(*(ushort*) pThis); } return new OneBasedIndex(*(uint*) pThis); } }
public uint GetNameOffset(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (FieldRow * pThis = &this) { if (StreamID.Strings.IndexSize(peFile) == 2) { return *(ushort*) pThis; } return *(uint*) pThis; } }
public OneBasedIndex GetParent(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (EventMapRow * pThis = &this) { if (MetadataTable.TypeDef.IndexSize(peFile) == 2) { return new OneBasedIndex(*(ushort*) pThis); } return new OneBasedIndex(*(uint*) pThis); } }
public OneBasedIndex GetFieldIndex(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (FieldLayoutRow * pThis = &this) { byte* pField = (byte *)pThis + 4; if (MetadataTable.Field.IndexSize(peFile) == 2) { return new OneBasedIndex(*(ushort *)pField); } return new OneBasedIndex(*(uint*) pField); } }
public uint GetNameOffset(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (GenericParameterRow* pThis = &this) { var pOwner = (byte*) pThis + 4 + CodedIndex.TypeOrMethodDef.IndexSize(peFile); if (StreamID.Strings.IndexSize(peFile) == 2) { return *(ushort*) pOwner; } return *(uint*) pOwner; } }
public MethodDefOrRef GetImplementingMethod(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (MethodImplRow* pThis = &this) { var pImplementingMethod = (byte*) pThis + MetadataTable.TypeDef.IndexSize(peFile); if (CodedIndex.MethodDefOrRef.IndexSize(peFile) == 2) { return new MethodDefOrRef(new OneBasedIndex(*(ushort*) pImplementingMethod)); } return new MethodDefOrRef(new OneBasedIndex(*(uint*) pImplementingMethod)); } }
public uint GetTypeSignatureOffset(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (PropertyRow * pThis = & this) { var pType = (byte*) pThis + 2 + StreamID.Strings.IndexSize(peFile); if (StreamID.Blob.IndexSize(peFile) == 2) { return *(ushort*) pType; } return *(uint*) pType; } }
public uint GetMvidOffset(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (ModuleRow* pThis = &this) { var pMvid = (byte*) pThis + 2 + StreamID.Strings.IndexSize(peFile); if (StreamID.Guid.IndexSize(peFile) == 2) { return *(ushort*) pMvid; } return *(uint*) pMvid; } }
public uint GetEncBaseId(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (ModuleRow* pThis = &this) { var pBaseId = (byte*) pThis + 2 + StreamID.Strings.IndexSize(peFile) + StreamID.Guid.IndexSize(peFile)*2; if (StreamID.Guid.IndexSize(peFile) == 2) { return *(ushort*) pBaseId; } return *(uint*) pBaseId; } }
public uint GetSignatureOffset(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (MethodDefRow * pThis = &this) { var pSignature = (byte *)pThis + 8 + StreamID.Strings.IndexSize(peFile); if (StreamID.Blob.IndexSize(peFile) == 2) { return *(ushort *)(pSignature); } return *(uint *)pSignature; } }
public uint GetNativeTypeOffset(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (FieldMarshalRow * pThis = &this) { var pNativeType = (byte*) pThis + CodedIndex.HasFieldMarshal.IndexSize(peFile); if (StreamID.Blob.IndexSize(peFile) == 2) { return *(ushort*) pNativeType; } return *(uint*) pNativeType; } }
public OneBasedIndex GetEventListIndex(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (EventMapRow* pThis = &this) { var pEventList = (byte*) pThis + MetadataTable.TypeDef.IndexSize(peFile); if (MetadataTable.Event.IndexSize(peFile) == 2) { return new OneBasedIndex(*(ushort*) pEventList); } return new OneBasedIndex(*(uint*)pEventList); } }
public OneBasedIndex GetEnclosingClass(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (NestedClassRow* pThis = &this) { var pEnclosingClass = (byte*) pThis + MetadataTable.TypeDef.IndexSize(peFile); if (MetadataTable.TypeDef.IndexSize(peFile) == 2) { return new OneBasedIndex(*(ushort*) pEnclosingClass); } return new OneBasedIndex(*(uint*) pEnclosingClass); } }
public uint GetCultureOffset(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (AssemblyRow* pThis = &this) { var pCulture = (byte*) pThis + 16 + StreamID.Blob.IndexSize(peFile) + StreamID.Strings.IndexSize(peFile); if (StreamID.Strings.IndexSize(peFile) == 2) { return *(ushort*) pCulture; } return *(uint*) pCulture; } }
public uint GetNameOffset(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (MethodDefRow * pThis = &this) { var pName = (byte *)pThis +8; if (StreamID.Strings.IndexSize(peFile) == 2) { return *(ushort *)pName; } return *(uint *)pName; } }
public uint GetNameIndex(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed(PropertyRow * pThis = &this) { var pName = (byte*) pThis + 2; if (StreamID.Strings.IndexSize(peFile) == 2) { return *(ushort*) pName; } return *(uint*) pName; } }
internal ModuleCollection(Assembly assembly, PEFile mainFile) { try { m_assembly = assembly.CheckNotNull("assembly"); m_mainFile = mainFile.CheckNotNull("mainFile"); m_otherModules = new object[MetadataTable.File.RowCount(m_mainFile)]; m_lockObject = new object(); } catch { Dispose(); throw; } }
public HasCustomAttribute GetParent(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (CustomAttributeRow * pThis = &this) { uint index; if (CodedIndex.HasCustomAttribute.IndexSize(peFile) == 2) { index = *(ushort*) pThis; } else { index = *(uint*) pThis; } return new HasCustomAttribute(new OneBasedIndex(index)); } }
public HasFieldMarshal GetParent(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (FieldMarshalRow* pThis = &this) { uint index; if (CodedIndex.HasFieldMarshal.IndexSize(peFile) == 2) { index = *(ushort*) pThis; } else { index = *(uint*) pThis; } return new HasFieldMarshal(new OneBasedIndex(index)); } }
public TypeDefOrRef GetConstraint(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (GenericParameterConstraintRow* pThis = &this) { var pConstraint = (byte*) pThis + MetadataTable.GenericParam.IndexSize(peFile); uint index; if (CodedIndex.TypeDefOrRef.IndexSize(peFile) == 2) { index = *(ushort*) pConstraint; } else { index = *(uint*) pConstraint; } return new TypeDefOrRef(new OneBasedIndex(index)); } }
public TypeDefOrRef GetExtendsToken(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (TypeDefRow* pThis = &this) { var pExtends = checked((byte*) pThis + 4 + 2*StreamID.Strings.IndexSize(peFile)); uint index; if (CodedIndex.TypeDefOrRef.IndexSize(peFile) == 2) { index = *(ushort*) pExtends; } else { index = *(uint*) pExtends; } return new TypeDefOrRef(new OneBasedIndex(index)); } }
public TypeDefOrRef GetEventType(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (EventRow * pThis = &this) { var pType = (byte*) pThis + 2 + StreamID.Strings.IndexSize(peFile); uint index; if (CodedIndex.TypeDefOrRef.IndexSize(peFile) == 2) { index = *(ushort*) pType; } else { index = *(uint*) pType; } return new TypeDefOrRef(new OneBasedIndex(index)); } }
public uint GetValueOffset(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (CustomAttributeRow * pThis = &this) { var pValue = (byte*)pThis + CodedIndex.HasCustomAttribute.IndexSize(peFile) + CodedIndex.CustomAttributeConstructor.IndexSize(peFile); if (StreamID.Blob.IndexSize(peFile) == 2) { return *(ushort*) pValue; } return *(uint*) pValue; } }
public CustomAttributeConstructor GetConstructor(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (CustomAttributeRow * pThis = &this) { var pConstructor = (byte*) pThis + CodedIndex.HasCustomAttribute.IndexSize(peFile); uint index; if (CodedIndex.CustomAttributeConstructor.IndexSize(peFile) == 2) { index = *(ushort*) pConstructor; } else { index = *(uint*) pConstructor; } return new CustomAttributeConstructor(new OneBasedIndex(index)); } }
public OneBasedIndex GetParamListIndex(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (MethodDefRow * pThis = &this) { var pParamList = (byte *)pThis + 8 + StreamID.Strings.IndexSize(peFile) + StreamID.Blob.IndexSize(peFile); if (MetadataTable.MethodDef.IndexSize(peFile) == 2) { return new OneBasedIndex(*(uint *)pParamList); } return new OneBasedIndex(*(ushort *)pParamList); } }
public TypeOrMethodDef GetOwner(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (GenericParameterRow* pThis = &this) { var pOwner = (byte*) pThis + 4; uint index; if (CodedIndex.TypeOrMethodDef.IndexSize(peFile) == 2) { index = *(ushort*) pOwner; } else { index = *(uint*) pOwner; } return new TypeOrMethodDef(new OneBasedIndex(index)); } }
public OneBasedIndex GetMethodListToken(PEFile peFile) { peFile.CheckNotNull("peFile"); fixed (TypeDefRow* pThis = &this) { var pFieldList = checked( (byte*) pThis + 4 + 2*StreamID.Strings.IndexSize(peFile) + CodedIndex.TypeDefOrRef.IndexSize(peFile) ); if (MetadataTable.MethodDef.IndexSize(peFile) == 2) { return new OneBasedIndex(*(ushort*) pFieldList); } return new OneBasedIndex(*(uint*) pFieldList); } }
public static uint IndexSize(this StreamID id, PEFile peFile) { return(peFile.CheckNotNull("peFile").GetHeapIndexSize(id)); }
public unsafe static ZeroBasedIndex Find <T>(this MetadataTable table, T value, UnsafeSelector <T> selector, PEFile peFile) { return(peFile.CheckNotNull("peFile").Find(table, value, selector)); }
public static uint IndexSize(this MetadataTable table, PEFile peFile) { return(peFile.CheckNotNull("peFile").GetTableIndexSize(table)); }
public static int RowCount(this MetadataTable table, PEFile peFile) { return(peFile.CheckNotNull("peFile").GetRowCount(table)); }
public static unsafe void *GetRow(this MetadataTable table, ZeroBasedIndex index, PEFile peFile) { return(peFile.CheckNotNull("peFile").GetRow(index, table)); }
public unsafe static ZeroBasedIndex RowIndex(this MetadataTable table, void *pRow, PEFile peFile) { return(peFile.CheckNotNull("peFile").GetRowIndex(table, pRow)); }
public static uint IndexSize(this CodedIndex type, PEFile peFile) { return(peFile.CheckNotNull("peFile").GetCodedIndexSize(type)); }
public static uint IndexSize(this StreamID id, PEFile peFile) { return peFile.CheckNotNull("peFile").GetHeapIndexSize(id); }
internal CustomAttribute(CustomAttributeRow *pRow, PEFile peFile) { m_pRow = (CustomAttributeRow *)FluentAsserts.CheckNotNull((void *)pRow, "pRow"); m_peFile = peFile.CheckNotNull("peFile"); }