[corlib] MonoAssembly.LoadWithPartialNameInternal.
[mono.git] / mcs / class / corlib / System.Reflection / MonoMethod.cs
index 111387296cedafea98868ca522b631c8ff3bfdbe..491e2cbf33e1726fd2a7b8084908b6f89d40d320 100644 (file)
@@ -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;