X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2Fcorlib%2FSystem.Reflection%2FMonoMethod.cs;h=491e2cbf33e1726fd2a7b8084908b6f89d40d320;hb=360f2deff8855e3e6ce62b61dcdcd9e1b097ded8;hp=111387296cedafea98868ca522b631c8ff3bfdbe;hpb=2255f5d2b3ad56fa767d43c860f1f38f42e1c676;p=mono.git diff --git a/mcs/class/corlib/System.Reflection/MonoMethod.cs b/mcs/class/corlib/System.Reflection/MonoMethod.cs index 111387296ce..491e2cbf33e 100644 --- a/mcs/class/corlib/System.Reflection/MonoMethod.cs +++ b/mcs/class/corlib/System.Reflection/MonoMethod.cs @@ -118,6 +118,12 @@ namespace System.Reflection { } } + public override Module Module { + get { + return GetRuntimeModule (); + } + } + RuntimeType ReflectedTypeInternal { get { return (RuntimeType) ReflectedType; @@ -148,6 +154,11 @@ namespace System.Reflection { return ReturnType.FormatTypeName() + " " + FormatNameAndSig(false); } + internal RuntimeModule GetRuntimeModule () + { + return ((RuntimeType)DeclaringType).GetRuntimeModule(); + } + #region ISerializable Implementation public void GetObjectData(SerializationInfo info, StreamingContext context) { @@ -382,7 +393,7 @@ namespace System.Reflection { } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal static extern DllImportAttribute GetDllImportAttribute (IntPtr mhandle); + internal extern void GetPInvoke (out PInvokeAttributes flags, out string entryPoint, out string dllName); internal object[] GetPseudoCustomAttributes () { @@ -404,10 +415,7 @@ namespace System.Reflection { if ((info.iattrs & MethodImplAttributes.PreserveSig) != 0) attrs [count ++] = new PreserveSigAttribute (); if ((info.attrs & MethodAttributes.PinvokeImpl) != 0) { - DllImportAttribute attr = GetDllImportAttribute (mhandle); - if ((info.iattrs & MethodImplAttributes.PreserveSig) != 0) - attr.PreserveSig = true; - attrs [count ++] = attr; + attrs [count ++] = DllImportAttribute.GetCustomAttribute (this); } return attrs;