using System.Security;
using System.Reflection;
using System.Threading;
+using System.Runtime.InteropServices.ComTypes;
using System.Runtime.ConstrainedExecution;
#if !FULL_AOT_RUNTIME
-using System.Runtime.InteropServices.ComTypes;
using Mono.Interop;
#endif
return CreateAggregatedObject (pOuter, (object)o);
}
-#if !FULL_AOT_RUNTIME
public static object CreateWrapperOfType (object o, Type t)
{
+#if FULL_AOT_RUNTIME
+ throw new PlatformNotSupportedException ();
+#else
__ComObject co = o as __ComObject;
if (co == null)
throw new ArgumentException ("o must derive from __ComObject", "o");
}
return ComInteropProxy.GetProxy (co.IUnknown, t).GetTransparentProxy ();
+#endif
}
public static TWrapper CreateWrapperOfType<T, TWrapper> (T o) {
return (TWrapper)CreateWrapperOfType ((object)o, typeof (TWrapper));
}
-#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
[ComVisible (true)]
return GetCCW (o, T);
}
#endif
+#endif // !FULL_AOT_RUNTIME
public static IntPtr GetComInterfaceForObject (object o, Type T)
{
-#if !MOBILE
+#if MOBILE
+ throw new PlatformNotSupportedException ();
+#else
IntPtr pItf = GetComInterfaceForObjectInternal (o, T);
AddRef (pItf);
return pItf;
-#else
- throw new NotImplementedException ();
#endif
}
return GetComInterfaceForObject ((object)o, typeof (T));
}
+#if !FULL_AOT_RUNTIME
[MonoTODO]
public static IntPtr GetComInterfaceForObjectInContext (object o, Type t)
{
throw new NotImplementedException ();
}
- [MonoTODO]
- public static int GetExceptionCode()
- {
- throw new NotImplementedException ();
- }
-
[MonoTODO]
[ComVisible (true)]
public static IntPtr GetExceptionPointers()
}
#endif // !FULL_AOT_RUNTIME
-#if !FULL_AOT_RUNTIME
+ public static int GetExceptionCode ()
+ {
+ throw new PlatformNotSupportedException ();
+ }
+
public static int GetHRForException (Exception e)
{
#if FEATURE_COMINTEROP
SetErrorInfo (0, errorInfo);
return e._HResult;
+#elif FULL_AOT_RUNTIME
+ throw new PlatformNotSupportedException ();
#else
return -1;
#endif
[ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
public static int GetHRForLastWin32Error()
{
+#if FULL_AOT_RUNTIME
+ throw new PlatformNotSupportedException ();
+#else
throw new NotImplementedException ();
+#endif
}
+#if !FULL_AOT_RUNTIME
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern static IntPtr GetIDispatchForObjectInternal (object o);
throw new NotImplementedException ();
}
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern static IntPtr GetIUnknownForObjectInternal (object o);
-
- public static IntPtr GetIUnknownForObject (object o)
- {
- IntPtr pUnk = GetIUnknownForObjectInternal (o);
- // Internal method does not AddRef
- AddRef (pUnk);
- return pUnk;
- }
-
[MonoTODO]
public static IntPtr GetIUnknownForObjectInContext (object o)
{
throw new NotImplementedException ();
}
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ private extern static IntPtr GetIUnknownForObjectInternal (object o);
+
+#endif // !FULL_AOT_RUNTIME
+
+ public static IntPtr GetIUnknownForObject (object o)
+ {
+#if FULL_AOT_RUNTIME
+ throw new PlatformNotSupportedException ();
+#else
+ IntPtr pUnk = GetIUnknownForObjectInternal (o);
+ // Internal method does not AddRef
+ AddRef (pUnk);
+ return pUnk;
+#endif
+ }
+
public static void GetNativeVariantForObject (object obj, IntPtr pDstNativeVariant)
{
+#if FULL_AOT_RUNTIME
+ throw new PlatformNotSupportedException ();
+#else
Variant vt = new Variant();
vt.SetValue(obj);
Marshal.StructureToPtr(vt, pDstNativeVariant, false);
+#endif
}
public static void GetNativeVariantForObject<T> (T obj, IntPtr pDstNativeVariant) {
GetNativeVariantForObject ((object)obj, pDstNativeVariant);
}
-#if !MOBILE
+#if !MOBILE && !FULL_AOT_RUNTIME
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private static extern object GetObjectForCCW (IntPtr pUnk);
#endif
public static object GetObjectForIUnknown (IntPtr pUnk)
{
-#if !MOBILE
+#if MOBILE || FULL_AOT_RUNTIME
+ throw new PlatformNotSupportedException ();
+#else
object obj = GetObjectForCCW (pUnk);
// was not a CCW
if (obj == null) {
obj = proxy.GetTransparentProxy ();
}
return obj;
-#else
- throw new NotImplementedException ();
#endif
}
public static object GetObjectForNativeVariant (IntPtr pSrcNativeVariant)
{
+#if FULL_AOT_RUNTIME
+ throw new PlatformNotSupportedException ();
+#else
Variant vt = (Variant)Marshal.PtrToStructure(pSrcNativeVariant, typeof(Variant));
return vt.GetValue();
+#endif
}
- public static T GetObjectForNativeVariant<T> (IntPtr pSrcNativeVariant) {
+ public static T GetObjectForNativeVariant<T> (IntPtr pSrcNativeVariant)
+ {
+#if FULL_AOT_RUNTIME
+ throw new PlatformNotSupportedException ();
+#else
Variant vt = (Variant)Marshal.PtrToStructure(pSrcNativeVariant, typeof(Variant));
return (T)vt.GetValue();
+#endif
}
public static object[] GetObjectsForNativeVariants (IntPtr aSrcNativeVariant, int cVars)
{
+#if FULL_AOT_RUNTIME
+ throw new PlatformNotSupportedException ();
+#else
if (cVars < 0)
throw new ArgumentOutOfRangeException ("cVars", "cVars cannot be a negative number.");
object[] objects = new object[cVars];
objects[i] = GetObjectForNativeVariant ((IntPtr)(aSrcNativeVariant.ToInt64 () +
i * SizeOf (typeof(Variant))));
return objects;
+#endif
}
- public static T[] GetObjectsForNativeVariants<T> (IntPtr aSrcNativeVariant, int cVars) {
+ public static T[] GetObjectsForNativeVariants<T> (IntPtr aSrcNativeVariant, int cVars)
+ {
+#if FULL_AOT_RUNTIME
+ throw new PlatformNotSupportedException ();
+#else
if (cVars < 0)
throw new ArgumentOutOfRangeException ("cVars", "cVars cannot be a negative number.");
T[] objects = new T[cVars];
objects[i] = GetObjectForNativeVariant<T> ((IntPtr)(aSrcNativeVariant.ToInt64 () +
i * SizeOf (typeof(Variant))));
return objects;
+#endif
}
[MonoTODO]
public static int GetStartComSlot (Type t)
{
+#if FULL_AOT_RUNTIME
+ throw new PlatformNotSupportedException ();
+#else
throw new NotImplementedException ();
+#endif
}
+#if !FULL_AOT_RUNTIME
[MonoTODO]
[Obsolete ("This method has been deprecated")]
public static Thread GetThreadFromFiberCookie (int cookie)
throw new NotImplementedException ();
}
- public static Type GetTypeFromCLSID (Guid clsid)
- {
- throw new NotImplementedException ();
- }
-
-#if !FULL_AOT_RUNTIME
[Obsolete]
[MonoTODO]
public static string GetTypeInfoName (UCOMITypeInfo pTI)
throw new NotImplementedException ();
}
- public static string GetTypeInfoName (ITypeInfo typeInfo)
- {
- throw new NotImplementedException ();
- }
-
[Obsolete]
[MonoTODO]
public static Guid GetTypeLibGuid (UCOMITypeLib pTLB)
throw new NotImplementedException ();
}
- public static object GetUniqueObjectForIUnknown (IntPtr unknown)
- {
- throw new NotImplementedException ();
- }
-#endif
-
[MonoTODO]
[Obsolete ("This method has been deprecated")]
public static IntPtr GetUnmanagedThunkForManagedMethodPtr (IntPtr pfnMethodToWrap, IntPtr pbSignature, int cbSignature)
throw new NotImplementedException ();
}
-#if !MOBILE
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool IsComObject (object o);
-#else
- public static bool IsComObject (object o)
- {
- throw new NotImplementedException ();
- }
-#endif
-
[MonoTODO]
public static bool IsTypeVisibleFromCom (Type t)
{
{
throw new NotImplementedException ();
}
+#endif // !FULL_AOT_RUNTIME
+
+ public static Type GetTypeFromCLSID (Guid clsid)
+ {
+ throw new PlatformNotSupportedException ();
+ }
+
+ public static string GetTypeInfoName (ITypeInfo typeInfo)
+ {
+ throw new PlatformNotSupportedException ();
+ }
+
+ public static object GetUniqueObjectForIUnknown (IntPtr unknown)
+ {
+ throw new PlatformNotSupportedException ();
+ }
+
+#if !MOBILE
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ public extern static bool IsComObject (object o);
+#else
+ public static bool IsComObject (object o)
+ {
+ throw new PlatformNotSupportedException ();
+ }
#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
#if !FULL_AOT_RUNTIME
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern static int ReleaseComObjectInternal (object co);
+#endif
public static int ReleaseComObject (object o)
{
+#if FULL_AOT_RUNTIME
+ throw new PlatformNotSupportedException ();
+#else
if (o == null)
throw new ArgumentException ("Value cannot be null.", "o");
if (!IsComObject (o))
throw new ArgumentException ("Value must be a Com object.", "o");
return ReleaseComObjectInternal (o);
+#endif
}
+#if !FULL_AOT_RUNTIME
[Obsolete]
[MonoTODO]
public static void ReleaseThreadCache()
#endif
}
-#if !FULL_AOT_RUNTIME
public static int FinalReleaseComObject (object o)
{
while (ReleaseComObject (o) != 0);
return 0;
}
-#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern Delegate GetDelegateForFunctionPointerInternal (IntPtr ptr, Type t);