internal override void Resolve(PEReader buff) { meth = (MethodDef)buff.GetCodedElement(CIx.MemberForwarded,memForIndex); importScope = (ModuleRef)buff.GetElement(MDTable.ModuleRef,scopeIx); if (meth != null) meth.AddPInvokeInfo(this); }
/// <summary> /// Add a managed resource from another module in this assembly. /// </summary> /// <param name="resName">The name of the resource</param> /// <param name="assem">The assembly where the resource is</param> /// <param name="isPublic">Access for the resource</param> public void AddExternalManagedResource(string resName, ModuleRef mod, uint offset, bool isPublic) { resources.Add(new ManifestResource(this, resName, mod.modFile, offset, isPublic)); }
/*-------------------- Constructors ---------------------------------*/ internal ImplMap(ushort flag, MethodDef implMeth, string iName, ModuleRef mScope) { flags = flag; meth = implMeth; importName = iName; importScope = mScope; tabIx = MDTable.ImplMap; if (iName == null) flags |= NoMangle; sortTable = true; //throw(new NotYetImplementedException("PInvoke ")); }
internal static void Read(PEReader buff, TableRow[] mods, bool resolve) { for (int i=0; i < mods.Length; i++) { string name = buff.GetString(); ModuleRef mRef = new ModuleRef(name); if (resolve) mRef.modFile = buff.GetFileDesc(name); mods[i] = mRef; } }
public static ModuleRef MakeModuleRef(string name, bool entryPoint, byte[] hashValue) { ModuleRef mRef = new ModuleRef(name,entryPoint,hashValue); return mRef; }
internal static ModuleRef ReadModuleRef(PEReader buff) { buff.ReadZeros(2); string name = buff.GetString(); uint junk = buff.GetGUIDIx(); junk = buff.GetGUIDIx(); junk = buff.GetGUIDIx(); ModuleRef mRef = new ModuleRef(new ModuleFile(name,null)); mRef.ReadAsDef(); return mRef; }
/// <summary> /// Make a ModuleRef for this Module. /// </summary> /// <returns>ModuleRef for this Module</returns> public ModuleRef MakeRefOf(/*bool hasEntryPoint, byte[] hashValue*/) { if (refOf == null) { refOf = new ModuleRef(name/*,hasEntryPoint,hashValue*/); refOf.defOf = this; }/* else { // fix this if (hasEntryPoint) refOf.SetEntryPoint(); refOf.SetHash(hashValue); }*/ return refOf; }
public void AddPInvokeInfo(ModuleRef scope, string methName, PInvokeAttr callAttr) { pinvokeImpl = new ImplMap((ushort)callAttr,this,methName,scope); methFlags |= PInvokeImpl; }