You've already forked linux-packaging-mono
Imported Upstream version 4.2.0.179
Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
committed by
Jo Shields
parent
183bba2c9a
commit
6992685b86
@@ -16,6 +16,7 @@
|
||||
**
|
||||
**
|
||||
==========================================================================*/
|
||||
#if !MOBILE
|
||||
namespace System.Runtime.InteropServices.ComTypes
|
||||
{
|
||||
using System;
|
||||
@@ -27,3 +28,4 @@ namespace System.Runtime.InteropServices.ComTypes
|
||||
System.Collections.IEnumerator GetEnumerator();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -16,6 +16,7 @@
|
||||
**
|
||||
**
|
||||
==========================================================================*/
|
||||
#if !MOBILE
|
||||
namespace System.Runtime.InteropServices.ComTypes
|
||||
{
|
||||
using System;
|
||||
@@ -33,3 +34,4 @@ namespace System.Runtime.InteropServices.ComTypes
|
||||
void Reset();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -16,6 +16,8 @@
|
||||
**
|
||||
**
|
||||
==========================================================================*/
|
||||
|
||||
#if !MOBILE
|
||||
namespace System.Runtime.InteropServices.ComTypes
|
||||
{
|
||||
using System;
|
||||
@@ -30,3 +32,4 @@ namespace System.Runtime.InteropServices.ComTypes
|
||||
void RemoveMember(MemberInfo m);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
**
|
||||
**
|
||||
==========================================================================*/
|
||||
#if !MOBILE
|
||||
namespace System.Runtime.InteropServices.ComTypes
|
||||
{
|
||||
using System;
|
||||
@@ -78,3 +79,4 @@ namespace System.Runtime.InteropServices.ComTypes
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1,3 +1,6 @@
|
||||
#if MONO_COM
|
||||
#define FEATURE_COMINTEROP
|
||||
#endif
|
||||
// ==++==
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
@@ -162,7 +165,7 @@ namespace System.Runtime.InteropServices{
|
||||
public String Value { get { return _importClassName; } }
|
||||
}
|
||||
|
||||
#if FEATURE_COMINTEROP
|
||||
#if FEATURE_COMINTEROP || MOBILE_LEGACY
|
||||
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
|
||||
[System.Runtime.InteropServices.ComVisible(true)]
|
||||
public sealed class LCIDConversionAttribute : Attribute
|
||||
@@ -243,6 +246,7 @@ namespace System.Runtime.InteropServices{
|
||||
}
|
||||
public IDispatchImplType Value { get {return _val;} }
|
||||
}
|
||||
#endif
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class, Inherited = true)]
|
||||
[System.Runtime.InteropServices.ComVisible(true)]
|
||||
@@ -272,6 +276,7 @@ namespace System.Runtime.InteropServices{
|
||||
public String Value { get {return _val;} }
|
||||
}
|
||||
|
||||
#if FEATURE_COMINTEROP || MOBILE_LEGACY
|
||||
[AttributeUsage(AttributeTargets.All, Inherited = false)]
|
||||
[System.Runtime.InteropServices.ComVisible(true)]
|
||||
public sealed class ComConversionLossAttribute : Attribute
|
||||
@@ -280,7 +285,8 @@ namespace System.Runtime.InteropServices{
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#if FEATURE_COMINTEROP
|
||||
[Serializable]
|
||||
[Flags()]
|
||||
[System.Runtime.InteropServices.ComVisible(true)]
|
||||
@@ -472,7 +478,7 @@ namespace System.Runtime.InteropServices{
|
||||
|
||||
Currency = 0xf, // A currency
|
||||
|
||||
#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF
|
||||
#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF || MONO
|
||||
BStr = 0x13, // OLE Unicode BSTR
|
||||
#endif //FEATURE_COMINTEROP || FEATURE_LEGACYNETCF
|
||||
|
||||
@@ -486,13 +492,13 @@ namespace System.Runtime.InteropServices{
|
||||
|
||||
IUnknown = 0x19, // COM IUnknown pointer.
|
||||
|
||||
#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF
|
||||
#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF || MONO
|
||||
IDispatch = 0x1a, // COM IDispatch pointer
|
||||
#endif //FEATURE_COMINTEROP || FEATURE_LEGACYNETCF
|
||||
|
||||
Struct = 0x1b, // Structure
|
||||
|
||||
#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF
|
||||
#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF || MONO
|
||||
Interface = 0x1c, // COM interface
|
||||
|
||||
SafeArray = 0x1d, // OLE SafeArray
|
||||
@@ -504,7 +510,7 @@ namespace System.Runtime.InteropServices{
|
||||
|
||||
SysUInt = 0x20,
|
||||
|
||||
#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF
|
||||
#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF || MONO
|
||||
VBByRefStr = 0x22,
|
||||
|
||||
AnsiBStr = 0x23, // OLE BSTR containing SBCS characters
|
||||
@@ -522,7 +528,7 @@ namespace System.Runtime.InteropServices{
|
||||
|
||||
LPStruct = 0x2b, // Pointer to a structure
|
||||
|
||||
#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF
|
||||
#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF || MONO
|
||||
CustomMarshaler = 0x2c,
|
||||
#endif //FEATURE_COMINTEROP || FEATURE_LEGACYNETCF
|
||||
|
||||
@@ -538,10 +544,17 @@ namespace System.Runtime.InteropServices{
|
||||
#endif //FEATURE_COMINTEROP
|
||||
}
|
||||
|
||||
#if !MONO
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.ReturnValue, Inherited = false)]
|
||||
[System.Runtime.InteropServices.ComVisible(true)]
|
||||
public unsafe sealed class MarshalAsAttribute : Attribute
|
||||
{
|
||||
#if MONO
|
||||
internal MarshalAsAttribute Copy ()
|
||||
{
|
||||
return (MarshalAsAttribute)this.MemberwiseClone ();
|
||||
}
|
||||
#else
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
internal static Attribute GetCustomAttribute(RuntimeParameterInfo parameter)
|
||||
{
|
||||
@@ -619,7 +632,7 @@ namespace System.Runtime.InteropServices{
|
||||
MarshalTypeRef = marshalTypeRef;
|
||||
MarshalCookie = marshalCookie;
|
||||
}
|
||||
|
||||
#endif
|
||||
internal UnmanagedType _val;
|
||||
public MarshalAsAttribute(UnmanagedType unmanagedType)
|
||||
{
|
||||
@@ -653,10 +666,13 @@ namespace System.Runtime.InteropServices{
|
||||
public Type MarshalTypeRef; // Type of marshaler class
|
||||
public String MarshalCookie; // cookie to pass to marshaler
|
||||
}
|
||||
|
||||
#endif
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, Inherited = false)]
|
||||
[System.Runtime.InteropServices.ComVisible(true)]
|
||||
public sealed class ComImportAttribute : Attribute
|
||||
#if !MONOTOUCH
|
||||
public
|
||||
#endif
|
||||
sealed class ComImportAttribute : Attribute
|
||||
{
|
||||
internal static Attribute GetCustomAttribute(RuntimeType type)
|
||||
{
|
||||
@@ -799,12 +815,18 @@ namespace System.Runtime.InteropServices{
|
||||
if ((method.Attributes & MethodAttributes.PinvokeImpl) == 0)
|
||||
return null;
|
||||
|
||||
#if !MONO
|
||||
MetadataImport scope = ModuleHandle.GetMetadataImport(method.Module.ModuleHandle.GetRuntimeModule());
|
||||
#endif
|
||||
string entryPoint, dllName = null;
|
||||
int token = method.MetadataToken;
|
||||
PInvokeAttributes flags = 0;
|
||||
|
||||
#if MONO
|
||||
((MonoMethod)method).GetPInvoke(out flags, out entryPoint, out dllName);
|
||||
#else
|
||||
scope.GetPInvokeMap(token, out flags, out entryPoint, out dllName);
|
||||
#endif
|
||||
|
||||
CharSet charSet = CharSet.None;
|
||||
|
||||
@@ -891,7 +913,7 @@ namespace System.Runtime.InteropServices{
|
||||
private const int DEFAULT_PACKING_SIZE = 8;
|
||||
|
||||
[System.Security.SecurityCritical] // auto-generated
|
||||
internal static Attribute GetCustomAttribute(RuntimeType type)
|
||||
internal static StructLayoutAttribute GetCustomAttribute(RuntimeType type)
|
||||
{
|
||||
if (!IsDefined(type))
|
||||
return null;
|
||||
@@ -914,7 +936,12 @@ namespace System.Runtime.InteropServices{
|
||||
case TypeAttributes.UnicodeClass: charSet = CharSet.Unicode; break;
|
||||
default: Contract.Assume(false); break;
|
||||
}
|
||||
|
||||
#if MONO
|
||||
type.GetPacking (out pack, out size);
|
||||
#else
|
||||
type.GetRuntimeModule().MetadataImport.GetClassLayout(type.MetadataToken, out pack, out size);
|
||||
#endif
|
||||
|
||||
// Metadata parameter checking should not have allowed 0 for packing size.
|
||||
// The runtime later converts a packing size of 0 to 8 so do the same here
|
||||
@@ -967,7 +994,11 @@ namespace System.Runtime.InteropServices{
|
||||
int fieldOffset;
|
||||
|
||||
if (field.DeclaringType != null &&
|
||||
#if MONO
|
||||
(fieldOffset = field.GetFieldOffset ()) >= 0)
|
||||
#else
|
||||
field.GetRuntimeModule().MetadataImport.GetFieldOffset(field.DeclaringType.MetadataToken, field.MetadataToken, out fieldOffset))
|
||||
#endif
|
||||
return new FieldOffsetAttribute(fieldOffset);
|
||||
|
||||
return null;
|
||||
@@ -987,7 +1018,7 @@ namespace System.Runtime.InteropServices{
|
||||
public int Value { get { return _val; } }
|
||||
}
|
||||
|
||||
#if FEATURE_COMINTEROP
|
||||
#if FEATURE_COMINTEROP || MOBILE_LEGACY
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
|
||||
[System.Runtime.InteropServices.ComVisible(true)]
|
||||
public sealed class ComAliasNameAttribute : Attribute
|
||||
@@ -1044,7 +1075,7 @@ namespace System.Runtime.InteropServices{
|
||||
public Type CoClass { get { return _CoClass; } }
|
||||
}
|
||||
|
||||
#if FEATURE_COMINTEROP
|
||||
#if FEATURE_COMINTEROP || MONO
|
||||
|
||||
[AttributeUsage(AttributeTargets.Interface, Inherited = false)]
|
||||
[System.Runtime.InteropServices.ComVisible(true)]
|
||||
@@ -1062,7 +1093,8 @@ namespace System.Runtime.InteropServices{
|
||||
public Type SourceInterface { get {return _SourceInterface;} }
|
||||
public Type EventProvider { get {return _EventProvider;} }
|
||||
}
|
||||
|
||||
#endif
|
||||
#if FEATURE_COMINTEROP || MOBILE_LEGACY
|
||||
[AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
|
||||
[System.Runtime.InteropServices.ComVisible(true)]
|
||||
public sealed class TypeLibVersionAttribute : Attribute
|
||||
|
||||
@@ -140,7 +140,7 @@ using System.Runtime.Versioning;
|
||||
#if !FEATURE_CORECLR
|
||||
[SecurityPermission(SecurityAction.InheritanceDemand, UnmanagedCode=true)]
|
||||
#endif
|
||||
public abstract class SafeHandle : CriticalFinalizerObject, IDisposable
|
||||
public abstract partial class SafeHandle : CriticalFinalizerObject, IDisposable
|
||||
{
|
||||
// ! Do not add or rearrange fields as the EE depends on this layout.
|
||||
//------------------------------------------------------------------
|
||||
@@ -173,7 +173,7 @@ public abstract class SafeHandle : CriticalFinalizerObject, IDisposable
|
||||
if (!ownsHandle)
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
#if DEBUG
|
||||
#if !MONO && DEBUG
|
||||
if (BCLDebug.SafeHandleStackTracesEnabled)
|
||||
_stackTrace = Environment.GetStackTrace(null, false);
|
||||
else
|
||||
@@ -187,7 +187,7 @@ public abstract class SafeHandle : CriticalFinalizerObject, IDisposable
|
||||
_fullyInitialized = true;
|
||||
}
|
||||
|
||||
#if FEATURE_CORECLR
|
||||
#if FEATURE_CORECLR || MOBILE
|
||||
// Migrating InheritanceDemands requires this default ctor, so we can mark it critical
|
||||
protected SafeHandle()
|
||||
{
|
||||
@@ -201,12 +201,12 @@ public abstract class SafeHandle : CriticalFinalizerObject, IDisposable
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
#if !MONO
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern void InternalFinalize();
|
||||
|
||||
#endif
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||
#if !FEATURE_CORECLR
|
||||
[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
|
||||
@@ -273,7 +273,7 @@ public abstract class SafeHandle : CriticalFinalizerObject, IDisposable
|
||||
else
|
||||
InternalFinalize();
|
||||
}
|
||||
|
||||
#if !MONO
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
@@ -333,5 +333,6 @@ public abstract class SafeHandle : CriticalFinalizerObject, IDisposable
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
public extern void DangerousRelease();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace System.Runtime.InteropServices
|
||||
public Object pUnk;
|
||||
public int dwCookie;
|
||||
}
|
||||
|
||||
#if !FULL_AOT_RUNTIME
|
||||
[Obsolete("Use System.Runtime.InteropServices.ComTypes.IEnumConnections instead. http://go.microsoft.com/fwlink/?linkid=14202", false)]
|
||||
[Guid("B196B287-BAB4-101A-B69C-00AA00341D07")]
|
||||
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
@@ -41,4 +41,5 @@ namespace System.Runtime.InteropServices
|
||||
void Reset();
|
||||
void Clone(out UCOMIEnumConnections ppenum);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user