示例#1
0
 void Initialize()
 {
     flags.ReadOriginalValue = () => {
         InitializeRawRow();
         return((PInvokeAttributes)rawRow.MappingFlags);
     };
     name.ReadOriginalValue = () => {
         InitializeRawRow();
         return(readerModule.StringsStream.ReadNoNull(rawRow.ImportName));
     };
     scope.ReadOriginalValue = () => {
         InitializeRawRow();
         return(readerModule.ResolveModuleRef(rawRow.ImportScope));
     };
 }
示例#2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="readerModule">The module which contains this <c>ImplMap</c> row</param>
        /// <param name="rid">Row ID</param>
        /// <exception cref="ArgumentNullException">If <paramref name="readerModule"/> is <c>null</c></exception>
        /// <exception cref="ArgumentException">If <paramref name="rid"/> is invalid</exception>
        public ImplMapMD(ModuleDefMD readerModule, uint rid)
        {
#if DEBUG
            if (readerModule == null)
            {
                throw new ArgumentNullException("readerModule");
            }
            if (readerModule.TablesStream.ImplMapTable.IsInvalidRID(rid))
            {
                throw new BadImageFormatException(string.Format("ImplMap rid {0} does not exist", rid));
            }
#endif
            this.origRid = rid;
            this.rid     = rid;
            uint name;
            uint scope = readerModule.TablesStream.ReadImplMapRow(origRid, out this.attributes, out name);
            this.name   = readerModule.StringsStream.ReadNoNull(name);
            this.module = readerModule.ResolveModuleRef(scope);
        }