Merge pull request #5636 from BrzVlad/fix-xmm-scan
[mono.git] / mcs / class / corlib / System.Runtime.InteropServices / Marshal.cs
index c815fe68bb32d22fc6c0ac35d199d09841460f71..e94898a5c3863487d63de1900d08563c96fae40c 100644 (file)
@@ -741,7 +741,7 @@ namespace System.Runtime.InteropServices
 #else
                public static bool IsComObject (object o)
                {
-                       throw new PlatformNotSupportedException ();
+                       return false;
                }
 #endif
 
@@ -796,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)]
@@ -1246,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);
@@ -1759,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 
@@ -1784,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
        }
 }