Wed Jun 18 12:49:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
[mono.git] / mcs / class / corlib / System.Runtime.InteropServices / Marshal.cs
index 8391cce39c37330c56affce4481f68b96dc6d444..5a07b0844777e7d351cc9edbd2942909907bee4e 100644 (file)
@@ -116,10 +116,8 @@ namespace System.Runtime.InteropServices
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
-               public static void DestroyStructure (IntPtr ptr, Type structuretype) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static void DestroyStructure (IntPtr ptr, Type structuretype);
 
                [MonoTODO]
                public static void FreeBSTR (IntPtr ptr) {
@@ -307,63 +305,41 @@ namespace System.Runtime.InteropServices
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
-               public static IntPtr OffsetOf (Type t, string fieldName) {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public static void Prelink (MethodInfo m) {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public static void PrelinkAll (Type c) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static IntPtr OffsetOf (Type t, string fieldName);
 
-               [MonoTODO]
-               public static string PtrToStringAnsi (IntPtr ptr) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static void Prelink (MethodInfo m);
 
-               [MonoTODO]
-               public static string PtrToStringAnsi (IntPtr ptr, int len) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static void PrelinkAll (Type c);
 
-               [MonoTODO]
-               public static string PtrToStringAuto (IntPtr ptr, int len) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static string PtrToStringAnsi (IntPtr ptr);
+               
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static string PtrToStringAnsi (IntPtr ptr, int len);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               public static extern string PtrToStringAuto (IntPtr ptr);
+               public extern static string PtrToStringAuto (IntPtr ptr);
                
-               [MonoTODO]
-               public static string PtrToStringBSTR (IntPtr ptr) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static string PtrToStringAuto (IntPtr ptr, int len);
 
-               [MonoTODO]
-               public static string PtrToStringUni (IntPtr ptr) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static string PtrToStringUni (IntPtr ptr);
 
-               [MonoTODO]
-               public static string PtrToStringUni (IntPtr ptr, int len) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static string PtrToStringUni (IntPtr ptr, int len);
 
-               [MonoTODO]
-               public static void PtrToStructure (IntPtr ptr, object structure) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static string PtrToStringBSTR (IntPtr ptr);
+               
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static void PtrToStructure (IntPtr ptr, object structure);
 
-               [MonoTODO]
-               public static object PtrToStructure (IntPtr ptr, Type structureType) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static object PtrToStructure (IntPtr ptr, Type structureType);
 
                [MonoTODO]
                public static int QueryInterface (IntPtr pUnk, ref Guid iid, out IntPtr ppv) {
@@ -462,10 +438,8 @@ namespace System.Runtime.InteropServices
                        return SizeOf (structure.GetType ());
                }
 
-               [MonoTODO]
-               public static int SizeOf (Type t) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static int SizeOf (Type t);
 
                [MonoTODO]
                public static IntPtr StringToBSTR (string s) {
@@ -487,25 +461,17 @@ namespace System.Runtime.InteropServices
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
-               public static IntPtr StringToHGlobalAnsi (string s) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static IntPtr StringToHGlobalAnsi (string s);
 
-               [MonoTODO]
-               public static IntPtr StringToHGlobalAuto (string s) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static IntPtr StringToHGlobalAuto (string s);
 
-               [MonoTODO]
-               public static IntPtr StringToHGlobalUni (string s) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static IntPtr StringToHGlobalUni (string s);
 
-               [MonoTODO]
-               public static void StructureToPtr (object structure, IntPtr ptr, bool fDeleteOld) {
-                       throw new NotImplementedException ();
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static void StructureToPtr (object structure, IntPtr ptr, bool fDeleteOld);
 
                [MonoTODO]
                public static void ThrowExceptionForHR (int errorCode) {