Merge pull request #5636 from BrzVlad/fix-xmm-scan
[mono.git] / mcs / class / corlib / System.Runtime.InteropServices / Marshal.cs
index 30ff8b74bce5a34540a6d9432ced77e7c6beb276..e94898a5c3863487d63de1900d08563c96fae40c 100644 (file)
@@ -75,6 +75,13 @@ namespace System.Runtime.InteropServices
                        return false;
                }
 
+               [MonoTODO]
+               public static void CleanupUnusedObjectsInCurrentContext ()
+               {
+                       if (Environment.IsRunningOnWindows)
+                               throw new PlatformNotSupportedException ();
+               }
+
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static IntPtr AllocCoTaskMem (int cb);
                
@@ -734,7 +741,7 @@ namespace System.Runtime.InteropServices
 #else
                public static bool IsComObject (object o)
                {
-                       throw new PlatformNotSupportedException ();
+                       return false;
                }
 #endif
 
@@ -789,15 +796,8 @@ namespace System.Runtime.InteropServices
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static string PtrToStringUni (IntPtr ptr, int len);
 
-#if !MOBILE
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static string PtrToStringBSTR (IntPtr ptr);
-#else
-               public static string PtrToStringBSTR (IntPtr ptr)
-               {
-                       throw new NotImplementedException ();
-               }
-#endif
                
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                [ComVisible (true)]
@@ -1239,7 +1239,7 @@ namespace System.Runtime.InteropServices
 
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               public extern static IntPtr BufferToBSTR (Array ptr, int slen);
+               extern static IntPtr BufferToBSTR (Array ptr, int slen);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static IntPtr UnsafeAddrOfPinnedArrayElement (Array arr, int index);
@@ -1752,6 +1752,7 @@ namespace System.Runtime.InteropServices
                {
                }
 
+#if FEATURE_COMINTEROP || MONO_COM
                // Copied from referencesource/mscorlib/system/runtime/interopservices/marshal.cs
                //====================================================================
                // return the raw IUnknown* for a COM Object not related to current 
@@ -1777,5 +1778,18 @@ namespace System.Runtime.InteropServices
                //========================================================================
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                internal static extern object GetNativeActivationFactory(Type type);
+#else
+               internal static IntPtr /* IUnknown* */ GetRawIUnknownForComObjectNoAddRef(Object o) {
+                       throw new NotSupportedException();
+               }
+
+               internal static int GetHRForException_WinRT(Exception e) {
+                       throw new NotSupportedException();
+               }
+
+               internal static object GetNativeActivationFactory(Type type) {
+                       throw new NotSupportedException();
+               }
+#endif
        }
 }