Example #1
0
        unsafe void InitSignature_NoLock()
        {
            var  mdi   = readerModule.MetaDataImport;
            uint token = OriginalToken.Raw;

            var data = MDAPI.GetFieldSignatureBlob(mdi, token);

            this.Signature = readerModule.ReadSignature(data, GenericParamContext.Create(ownerType));
        }
Example #2
0
        public static unsafe FieldSig ReadFieldSig(IMetaDataImport mdi, uint token)
        {
            var sig = MDAPI.GetFieldSignatureBlob(mdi, token);

            if (sig == null)
            {
                return(null);
            }
            return(new DebugSignatureReader().ReadSignature(mdi, sig) as FieldSig);
        }
Example #3
0
        public DmdFieldDefCOMD(DmdComMetadataReader reader, uint rid, DmdType declaringType, DmdType reflectedType) : base(rid, declaringType, reflectedType)
        {
            this.reader = reader ?? throw new ArgumentNullException(nameof(reader));
            reader.Dispatcher.VerifyAccess();

            uint token = 0x04000000 + rid;

            Attributes = MDAPI.GetFieldAttributes(reader.MetaDataImport, token);
            Name       = MDAPI.GetFieldName(reader.MetaDataImport, token) ?? string.Empty;
            FieldType  = reader.ReadFieldType_COMThread(MDAPI.GetFieldSignatureBlob(reader.MetaDataImport, token), DeclaringType.GetGenericArguments());
        }
Example #4
0
        static TypeSig GetFieldTypeSig(IMetaDataImport mdi, uint token)
        {
            var buf = MDAPI.GetFieldSignatureBlob(mdi, token);

            if (buf == null)
            {
                return(null);
            }
            var sig = new DebugSignatureReader().ReadSignature(mdi, buf) as FieldSig;

            return(sig?.Type);
        }