diff options
Diffstat (limited to 'mcs/class/referencesource/mscorlib/system/runtime/interopservices')
59 files changed, 155 insertions, 694 deletions
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsHelper.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsHelper.cs index 11642f14bde..e06be4a4830 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsHelper.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsHelper.cs @@ -14,8 +14,6 @@ ** Date: April 2008 **/ -#if FEATURE_COMINTEROP - namespace System.Runtime.InteropServices { // // #ComEventsFeature @@ -206,5 +204,3 @@ namespace System.Runtime.InteropServices { } } - -#endif diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsInfo.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsInfo.cs index 061d585e352..41dfc22d252 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsInfo.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsInfo.cs @@ -15,8 +15,6 @@ **/ -#if FEATURE_COMINTEROP - namespace System.Runtime.InteropServices { using System; @@ -96,5 +94,3 @@ namespace System.Runtime.InteropServices { } } - -#endif diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsMethod.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsMethod.cs index af2f083b5bc..e5c403a993f 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsMethod.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsMethod.cs @@ -21,7 +21,6 @@ using System.Diagnostics; using System.Runtime.InteropServices; using System.Reflection; -#if FEATURE_COMINTEROP namespace System.Runtime.InteropServices { @@ -249,5 +248,3 @@ namespace System.Runtime.InteropServices { #endregion } } - -#endif diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsSink.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsSink.cs index 458a0cc21db..d243a760953 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsSink.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/ComEventsSink.cs @@ -14,7 +14,6 @@ ** Date: April 2008 **/ -#if FEATURE_COMINTEROP namespace System.Runtime.InteropServices { using System; @@ -289,5 +288,3 @@ namespace System.Runtime.InteropServices { #endregion }; } - -#endif diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/arraywithoffset.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/arraywithoffset.cs index a5c8c8d6912..d6e858960ba 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/arraywithoffset.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/arraywithoffset.cs @@ -70,17 +70,8 @@ namespace System.Runtime.InteropServices { [MethodImplAttribute(MethodImplOptions.InternalCall)] private extern int CalculateCount(); - #if !FEATURE_CORECLR - [System.Runtime.ForceTokenStabilization] - #endif //!FEATURE_CORECLR private Object m_array; - #if !FEATURE_CORECLR - [System.Runtime.ForceTokenStabilization] - #endif //!FEATURE_CORECLR private int m_offset; - #if !FEATURE_CORECLR - [System.Runtime.ForceTokenStabilization] - #endif //!FEATURE_CORECLR private int m_count; } diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/attributes.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/attributes.cs index 6a45bbc64ce..1b6027e25a2 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/attributes.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/attributes.cs @@ -79,10 +79,8 @@ namespace System.Runtime.InteropServices{ InterfaceIsIUnknown = 1, InterfaceIsIDispatch = 2, -#if FEATURE_COMINTEROP [System.Runtime.InteropServices.ComVisible(false)] InterfaceIsIInspectable = 3, -#endif // FEATURE_COMINTEROP } [AttributeUsage(AttributeTargets.Interface, Inherited = false)] @@ -165,7 +163,7 @@ namespace System.Runtime.InteropServices{ public String Value { get { return _importClassName; } } } -#if FEATURE_COMINTEROP || MOBILE_LEGACY +#if MOBILE_LEGACY [AttributeUsage(AttributeTargets.Method, Inherited = false)] [System.Runtime.InteropServices.ComVisible(true)] public sealed class LCIDConversionAttribute : Attribute @@ -395,7 +393,6 @@ namespace System.Runtime.InteropServices{ } public TypeLibVarFlags Value { get {return _val;} } } -#endif //FEATURE_COMINTEROP [Serializable] [System.Runtime.InteropServices.ComVisible(true)] @@ -410,9 +407,7 @@ namespace System.Runtime.InteropServices{ VT_CY = 6, VT_DATE = 7, VT_BSTR = 8, -#if FEATURE_COMINTEROP VT_DISPATCH = 9, -#endif // FEATURE_COMINTEROP VT_ERROR = 10, VT_BOOL = 11, VT_VARIANT = 12, @@ -451,7 +446,7 @@ namespace System.Runtime.InteropServices{ [Serializable] [System.Runtime.InteropServices.ComVisible(true)] - // Note that this enum should remain in-[....] with the CorNativeType enum in corhdr.h + // Note that this enum should remain in-sync with the CorNativeType enum in corhdr.h public enum UnmanagedType { Bool = 0x2, // 4 byte boolean value (true != 0, false == 0) @@ -478,9 +473,7 @@ namespace System.Runtime.InteropServices{ Currency = 0xf, // A currency -#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF || MONO BStr = 0x13, // OLE Unicode BSTR -#endif //FEATURE_COMINTEROP || FEATURE_LEGACYNETCF LPStr = 0x14, // Ptr to SBCS string @@ -492,17 +485,13 @@ namespace System.Runtime.InteropServices{ IUnknown = 0x19, // COM IUnknown pointer. -#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF || MONO IDispatch = 0x1a, // COM IDispatch pointer -#endif //FEATURE_COMINTEROP || FEATURE_LEGACYNETCF Struct = 0x1b, // Structure -#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF || MONO Interface = 0x1c, // COM interface SafeArray = 0x1d, // OLE SafeArray -#endif //FEATURE_COMINTEROP || FEATURE_LEGACYNETCF ByValArray = 0x1e, // Array of fixed size (only valid in structs) @@ -510,7 +499,6 @@ namespace System.Runtime.InteropServices{ SysUInt = 0x20, -#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF || MONO VBByRefStr = 0x22, AnsiBStr = 0x23, // OLE BSTR containing SBCS characters @@ -518,7 +506,6 @@ namespace System.Runtime.InteropServices{ TBStr = 0x24, // Ptr to OS preferred (SBCS/Unicode) BSTR VariantBool = 0x25, // OLE defined BOOLEAN (2 bytes, true == -1, false == 0) -#endif //FEATURE_COMINTEROP || FEATURE_LEGACYNETCF FunctionPtr = 0x26, // Function pointer @@ -528,20 +515,15 @@ namespace System.Runtime.InteropServices{ LPStruct = 0x2b, // Pointer to a structure -#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF || MONO CustomMarshaler = 0x2c, -#endif //FEATURE_COMINTEROP || FEATURE_LEGACYNETCF Error = 0x2d, -#if FEATURE_COMINTEROP [System.Runtime.InteropServices.ComVisible(false)] IInspectable = 0x2e, [System.Runtime.InteropServices.ComVisible(false)] HString = 0x2f, // Windows Runtime HSTRING - -#endif //FEATURE_COMINTEROP } #if !MONO @@ -620,11 +602,9 @@ namespace System.Runtime.InteropServices{ short sizeParamIndex, int sizeConst, string marshalType, RuntimeType marshalTypeRef, string marshalCookie, int iidParamIndex) { _val = val; -#if FEATURE_COMINTEROP SafeArraySubType = safeArraySubType; SafeArrayUserDefinedSubType = safeArrayUserDefinedSubType; IidParameterIndex = iidParamIndex; -#endif // FEATURE_COMINTEROP ArraySubType = arraySubType; SizeParamIndex = sizeParamIndex; SizeConst = sizeConst; @@ -644,14 +624,12 @@ namespace System.Runtime.InteropServices{ } public UnmanagedType Value { get { return _val; } } -#if FEATURE_COMINTEROP // Fields used with SubType = SafeArray. public VarEnum SafeArraySubType; public Type SafeArrayUserDefinedSubType; // Field used with iid_is attribute (interface pointers). public int IidParameterIndex; -#endif // FEATURE_COMINTEROP // Fields used with SubType = ByValArray and LPArray. // Array size = parameter(PI) * PM + C @@ -1018,7 +996,7 @@ namespace System.Runtime.InteropServices{ public int Value { get { return _val; } } } -#if FEATURE_COMINTEROP || MOBILE_LEGACY +#if MOBILE_LEGACY [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)] [System.Runtime.InteropServices.ComVisible(true)] public sealed class ComAliasNameAttribute : Attribute @@ -1059,7 +1037,6 @@ namespace System.Runtime.InteropServices{ public int MajorVersion { get {return _major;} } public int MinorVersion { get {return _minor;} } } -#endif //FEATURE_COMINTEROP [AttributeUsage(AttributeTargets.Interface, Inherited = false)] [System.Runtime.InteropServices.ComVisible(true)] @@ -1075,8 +1052,6 @@ namespace System.Runtime.InteropServices{ public Type CoClass { get { return _CoClass; } } } -#if FEATURE_COMINTEROP || MONO - [AttributeUsage(AttributeTargets.Interface, Inherited = false)] [System.Runtime.InteropServices.ComVisible(true)] public sealed class ComEventInterfaceAttribute : Attribute @@ -1135,8 +1110,6 @@ namespace System.Runtime.InteropServices{ public int RevisionNumber { get {return _revision;} } } -#endif //FEATURE_COMINTEROP - [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct, Inherited = false)] [System.Runtime.InteropServices.ComVisible(true)] public sealed class BestFitMappingAttribute : Attribute @@ -1176,7 +1149,6 @@ namespace System.Runtime.InteropServices{ } } -#if FEATURE_COMINTEROP [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)] [System.Runtime.InteropServices.ComVisible(false)] public sealed class ManagedToNativeComInteropStubAttribute : Attribute @@ -1193,7 +1165,6 @@ namespace System.Runtime.InteropServices{ public Type ClassType { get { return _classType; } } public String MethodName { get { return _methodName; } } } -#endif // FEATURE_COMINTEROP } diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/criticalhandle.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/criticalhandle.cs index d44cc0480e7..308fa38c840 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/criticalhandle.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/criticalhandle.cs @@ -152,9 +152,6 @@ public abstract class CriticalHandle : CriticalFinalizerObject, IDisposable #if DEBUG private String _stackTrace; // Where we allocated this CriticalHandle. #endif - #if !FEATURE_CORECLR - [System.Runtime.ForceTokenStabilization] - #endif //!FEATURE_CORECLR protected IntPtr handle; // This must be protected so derived classes can use out params. private bool _isClosed; // Set by SetHandleAsInvalid or Close/Dispose/finalization. diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/expando/iexpando.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/expando/iexpando.cs index dacf2750093..3b90935e18d 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/expando/iexpando.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/expando/iexpando.cs @@ -11,7 +11,7 @@ // represented by MemberInfo objects. // // <EMAIL>Author: darylo</EMAIL> -// Date: [....] 98 +// Date: March 98 // // The IExpando Interface. namespace System.Runtime.InteropServices.Expando { diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/gchandle.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/gchandle.cs index 5480f22e98b..5fcee00f2c4 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/gchandle.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/gchandle.cs @@ -44,7 +44,7 @@ namespace System.Runtime.InteropServices [System.Runtime.InteropServices.ComVisible(true)] public struct GCHandle { - // IMPORTANT: This must be kept in [....] with the GCHandleType enum. + // IMPORTANT: This must be kept in sync with the GCHandleType enum. private const GCHandleType MaxHandleType = GCHandleType.Pinned; #if MDA_SUPPORTED diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/iexception.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/iexception.cs index 299e56be3e7..cb32bb05279 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/iexception.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/iexception.cs @@ -26,6 +26,7 @@ namespace System.Runtime.InteropServices { [System.Runtime.InteropServices.ComVisible(true)] public interface _Exception { +#if !FEATURE_CORECLR // This contains all of our V1 Exception class's members. // From Object @@ -62,14 +63,23 @@ namespace System.Runtime.InteropServices { } [System.Security.SecurityCritical] // auto-generated_required void GetObjectData(SerializationInfo info, StreamingContext context); +#endif + // + // This method is intentionally included in CoreCLR to make Exception.get_InnerException "newslot virtual final". + // Some phone apps include MEF from desktop Silverlight. MEF's ComposablePartException depends on implicit interface + // implementations of get_InnerException to be provided by the base class. It works only if Exception.get_InnerException + // is virtual. + // Exception InnerException { get; } - + +#if !FEATURE_CORECLR MethodBase TargetSite { get; } +#endif } } diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/marshal.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/marshal.cs index 881e33230ec..b1ad7f42420 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/marshal.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/marshal.cs @@ -32,10 +32,7 @@ namespace System.Runtime.InteropServices using Win32Native = Microsoft.Win32.Win32Native; using Microsoft.Win32.SafeHandles; using System.Diagnostics.Contracts; - using System.Diagnostics.Tracing; -#if FEATURE_CLASSIC_COMINTEROP using System.Runtime.InteropServices.ComTypes; -#endif [Serializable] public enum CustomQueryInterfaceMode @@ -53,7 +50,7 @@ namespace System.Runtime.InteropServices #if FEATURE_CORECLR [System.Security.SecurityCritical] // auto-generated #endif - public static class Marshal + public static partial class Marshal { //==================================================================== // Defines used inside the Marshal class. @@ -204,12 +201,7 @@ namespace System.Runtime.InteropServices throw new ArgumentNullException("structure"); // we never had a check for generics here Contract.EndContractBlock(); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.MarshalSizeOf(structure.GetType().GetFullNameForEtw()); - } -#endif + return SizeOfHelper(structure.GetType(), true); } @@ -230,13 +222,6 @@ namespace System.Runtime.InteropServices throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), "t"); Contract.EndContractBlock(); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.MarshalSizeOf(t.GetFullNameForEtw()); - } -#endif - return SizeOfHelper(t, true); } @@ -296,13 +281,6 @@ namespace System.Runtime.InteropServices if (t == null) throw new ArgumentNullException("t"); Contract.EndContractBlock(); - -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.BeginMarshalOffsetOf(t.GetFullNameForEtw(), fieldName != null ? fieldName : ""); - } -#endif FieldInfo f = t.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (f == null) @@ -310,15 +288,9 @@ namespace System.Runtime.InteropServices RtFieldInfo rtField = f as RtFieldInfo; if (rtField == null) throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeFieldInfo"), "fieldName"); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.EndMarshalOffsetOf(t.GetFullNameForEtw(), fieldName != null ? fieldName : ""); - } -#endif + return OffsetOfHelper(rtField); } - public static IntPtr OffsetOf<T>(string fieldName) { return OffsetOf(typeof(T), fieldName); @@ -339,22 +311,9 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static extern IntPtr InternalUnsafeAddrOfPinnedArrayElement(Array arr, int index); + public static extern IntPtr UnsafeAddrOfPinnedArrayElement(Array arr, int index); [System.Security.SecurityCritical] - public static IntPtr UnsafeAddrOfPinnedArrayElement(Array arr, int index) - { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && arr != null && arr.Length > index && arr.GetValue(index) != null) - { - // Not a strongly-typed array, use the type of the element index being requested. - FrameworkEventSource.Log.MarshalUnsafeAddrOfPinnedArrayElement(arr.GetValue(index).GetType().GetFullNameForEtw()); - } -#endif - return InternalUnsafeAddrOfPinnedArrayElement(arr, index); - } - - [System.Security.SecurityCritical] public static IntPtr UnsafeAddrOfPinnedArrayElement<T>(T[] arr, int index) { return UnsafeAddrOfPinnedArrayElement((Array)arr, index); @@ -968,19 +927,7 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static extern int InternalGetExceptionCode(); - - [System.Security.SecurityCritical] - public static int GetExceptionCode() - { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.MarshalGetExceptionCode(); - } -#endif - return InternalGetExceptionCode(); - } + public static extern int GetExceptionCode(); //==================================================================== @@ -991,22 +938,8 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall), ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - private static extern void InternalStructureToPtr(Object structure, IntPtr ptr, bool fDeleteOld); - - [System.Security.SecurityCritical] [System.Runtime.InteropServices.ComVisible(true)] - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - public static void StructureToPtr(Object structure, IntPtr ptr, bool fDeleteOld) - { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && structure != null) - { - FrameworkEventSource.Log.MarshalStructureToPtr(structure.GetType().GetFullNameForEtw(), fDeleteOld.ToString()); - } -#endif - InternalStructureToPtr(structure, ptr, fDeleteOld); - } - + public static extern void StructureToPtr(Object structure, IntPtr ptr, bool fDeleteOld); [System.Security.SecurityCritical] public static void StructureToPtr<T>(T structure, IntPtr ptr, bool fDeleteOld) @@ -1021,19 +954,7 @@ namespace System.Runtime.InteropServices [System.Runtime.InteropServices.ComVisible(true)] public static void PtrToStructure(IntPtr ptr, Object structure) { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && structure != null) - { - FrameworkEventSource.Log.BeginMarshalPtrToStructure(structure.GetType().GetFullNameForEtw()); - } -#endif PtrToStructureHelper(ptr, structure, false); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && structure != null) - { - FrameworkEventSource.Log.EndMarshalPtrToStructure(structure.GetType().GetFullNameForEtw()); - } -#endif } [System.Security.SecurityCritical] @@ -1066,26 +987,11 @@ namespace System.Runtime.InteropServices StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.BeginMarshalPtrToStructure(rt.GetFullNameForEtw()); - } -#endif - Object structure = rt.CreateInstanceDefaultCtor(false /*publicOnly*/, false /*skipCheckThis*/, false /*fillCache*/, ref stackMark); PtrToStructureHelper(ptr, structure, true); - -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.EndMarshalPtrToStructure(rt.GetFullNameForEtw()); - } -#endif - return structure; } - + [System.Security.SecurityCritical] public static T PtrToStructure<T>(IntPtr ptr) { @@ -1107,20 +1013,8 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static extern void InternalDestroyStructure(IntPtr ptr, Type structuretype); - [System.Runtime.InteropServices.ComVisible(true)] - [System.Security.SecurityCritical] - public static void DestroyStructure(IntPtr ptr, Type structuretype) - { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && structuretype != null) - { - FrameworkEventSource.Log.MarshalDestroyStructure(structuretype.GetFullNameForEtw()); - } -#endif - InternalDestroyStructure(ptr, structuretype); - } + public static extern void DestroyStructure(IntPtr ptr, Type structuretype); [System.Security.SecurityCritical] public static void DestroyStructure<T>(IntPtr ptr) @@ -1168,24 +1062,12 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required public static void ThrowExceptionForHR(int errorCode) { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.MarshalThrowExceptionForHR(); - } -#endif if (errorCode < 0) ThrowExceptionForHRInternal(errorCode, IntPtr.Zero); } [System.Security.SecurityCritical] // auto-generated_required public static void ThrowExceptionForHR(int errorCode, IntPtr errorInfo) { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && (int)errorInfo != -1) - { - FrameworkEventSource.Log.MarshalThrowExceptionForHR2(); - } -#endif if (errorCode < 0) ThrowExceptionForHRInternal(errorCode, errorInfo); } @@ -1201,12 +1083,6 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required public static Exception GetExceptionForHR(int errorCode) { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.MarshalGetExceptionForHR(); - } -#endif if (errorCode < 0) return GetExceptionForHRInternal(errorCode, IntPtr.Zero); else @@ -1215,12 +1091,6 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required public static Exception GetExceptionForHR(int errorCode, IntPtr errorInfo) { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && (int)errorInfo != -1) - { - FrameworkEventSource.Log.MarshalGetExceptionForHR2(); - } -#endif if (errorCode < 0) return GetExceptionForHRInternal(errorCode, errorInfo); else @@ -1250,7 +1120,6 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] - [ForceTokenStabilization] internal static extern int GetHRForException_WinRT(Exception e); #if !FEATURE_PAL @@ -1436,8 +1305,6 @@ namespace System.Runtime.InteropServices #if FEATURE_COMINTEROP -#if FEATURE_CLASSIC_COMINTEROP - internal static readonly Guid ManagedNameGuid = new Guid("{0F21F359-AB84-41E8-9A78-36D110E6D2F9}"); //==================================================================== @@ -1654,13 +1521,6 @@ namespace System.Runtime.InteropServices typeInfo.GetDocumentation(-1, out strTypeLibName, out strDocString, out dwHelpContext, out strHelpFile); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.MarshalGetTypeInfoName(typeInfo.GetType().GetFullNameForEtw()); - } -#endif - return strTypeLibName; } @@ -1812,19 +1672,12 @@ namespace System.Runtime.InteropServices // This method is identical to Type.GetTypeFromCLSID. Since it's interop specific, we expose it // on Marshal for more consistent API surface. +#if !FEATURE_CORECLR [System.Security.SecuritySafeCritical] +#endif //!FEATURE_CORECLR public static Type GetTypeFromCLSID(Guid clsid) { - Type t = RuntimeType.GetTypeFromCLSIDImpl(clsid, null, false); - -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && t != null && clsid != null) - { - FrameworkEventSource.Log.MarshalGetTypeFromCLSID(t.GetFullNameForEtw(), clsid.ToString()); - } -#endif - - return t; + return RuntimeType.GetTypeFromCLSIDImpl(clsid, null, false); } //==================================================================== @@ -1835,8 +1688,6 @@ namespace System.Runtime.InteropServices [MethodImplAttribute(MethodImplOptions.InternalCall)] public static extern IntPtr /* ITypeInfo* */ GetITypeInfoForType(Type t); -#endif // FEATURE_CLASSIC_COMINTEROP - //==================================================================== // return the IUnknown* for an Object if the current context // is the one where the RCW was first seen. Will return null @@ -1845,12 +1696,6 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required public static IntPtr /* IUnknown* */ GetIUnknownForObject(Object o) { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && o != null) - { - FrameworkEventSource.Log.MarshalGetIUnknownForObject(o.GetType().GetFullNameForEtw()); - } -#endif return GetIUnknownForObjectNative(o, false); } @@ -1904,14 +1749,6 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required public static IntPtr /* IUnknown* */ GetComInterfaceForObject(Object o, Type T) { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && o != null && T != null) - { - // The managed ETW class only allows three parameters, so we have to improvise in passing all four - string interfaceAndMode = o.GetType().ImplementInterface(typeof(System.Runtime.InteropServices.ICustomQueryInterface)) ? "1:1" : "0:1"; - FrameworkEventSource.Log.MarshalGetComInterfaceForObject(o.GetType().GetFullNameForEtw(), T.GetFullNameForEtw(), interfaceAndMode); - } -#endif return GetComInterfaceForObjectNative(o, T, false, true); } @@ -1930,16 +1767,6 @@ namespace System.Runtime.InteropServices public static IntPtr /* IUnknown* */ GetComInterfaceForObject(Object o, Type T, CustomQueryInterfaceMode mode) { bool bEnableCustomizedQueryInterface = ((mode == CustomQueryInterfaceMode.Allow) ? true : false); - -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && o != null && T != null) - { - // The managed ETW class only allows three parameters, so we have to improvise in passing all four - string interfaceAndMode = o.GetType().ImplementInterface(typeof(System.Runtime.InteropServices.ICustomQueryInterface)) ? "1:" : "0:"; - interfaceAndMode += bEnableCustomizedQueryInterface ? "1" : "0"; - FrameworkEventSource.Log.MarshalGetComInterfaceForObject(o.GetType().GetFullNameForEtw(), T.GetFullNameForEtw(), interfaceAndMode); - } -#endif return GetComInterfaceForObjectNative(o, T, false, bEnableCustomizedQueryInterface); } @@ -1965,21 +1792,7 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static extern Object InternalGetObjectForIUnknown(IntPtr /* IUnknown* */ pUnk); - - [System.Security.SecurityCritical] - public static Object GetObjectForIUnknown(IntPtr /* IUnknown* */ pUnk) - { - Object o = InternalGetObjectForIUnknown(pUnk); - -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && o != null) - { - FrameworkEventSource.Log.MarshalGetObjectForIUnknown(o.GetType().GetFullNameForEtw()); - } -#endif - return o; - } + public static extern Object GetObjectForIUnknown(IntPtr /* IUnknown* */ pUnk); //==================================================================== // Return a unique Object given an IUnknown. This ensures that you @@ -1991,22 +1804,7 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static extern Object InternalGetUniqueObjectForIUnknown(IntPtr unknown); - - [System.Security.SecurityCritical] - public static Object GetUniqueObjectForIUnknown(IntPtr unknown) - { - Object o = InternalGetUniqueObjectForIUnknown(unknown); - -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && o != null) - { - FrameworkEventSource.Log.MarshalGetUniqueObjectForIUnknown(o.GetType().GetFullNameForEtw()); - } -#endif - - return o; - } + public static extern Object GetUniqueObjectForIUnknown(IntPtr unknown); //==================================================================== // return an Object for IUnknown, using the Type T, @@ -2022,20 +1820,8 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static extern IntPtr InternalCreateAggregatedObject(IntPtr pOuter, Object o); - - [System.Security.SecurityCritical] - public static IntPtr CreateAggregatedObject(IntPtr pOuter, Object o) - { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && o != null) - { - FrameworkEventSource.Log.MarshalCreateAggregatedObject(o.GetType().GetFullNameForEtw()); - } -#endif - return InternalCreateAggregatedObject(pOuter,o); - } - + public static extern IntPtr CreateAggregatedObject(IntPtr pOuter, Object o); + [System.Security.SecurityCritical] public static IntPtr CreateAggregatedObject<T>(IntPtr pOuter, T o) { @@ -2052,24 +1838,16 @@ namespace System.Runtime.InteropServices [MethodImplAttribute(MethodImplOptions.InternalCall)] public static extern bool AreComObjectsAvailableForCleanup(); -#endif // FEATURE_COMINTEROP - - //==================================================================== // check if the object is classic COM component //==================================================================== #if !FEATURE_CORECLR // with FEATURE_CORECLR, the whole type is SecurityCritical [System.Security.SecuritySafeCritical] #endif -#if FEATURE_COMINTEROP [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] public static extern bool IsComObject(Object o); -#else - public static bool IsComObject(Object o) - { - return false; - } + #endif // FEATURE_COMINTEROP [System.Security.SecurityCritical] // auto-generated_required @@ -2083,7 +1861,6 @@ namespace System.Runtime.InteropServices return pNewMem; } -#if FEATURE_COMINTEROP || FEATURE_LEGACYNETCF [System.Security.SecurityCritical] // auto-generated_required unsafe public static IntPtr StringToCoTaskMemUni(String s) { @@ -2160,7 +1937,17 @@ namespace System.Runtime.InteropServices } } -#endif //FEATURE_COMINTEROP || FEATURE_LEGACYNETCF + [System.Security.SecurityCritical] // auto-generated_required + public static IntPtr ReAllocCoTaskMem(IntPtr pv, int cb) + { + IntPtr pNewMem = Win32Native.CoTaskMemRealloc(pv, new UIntPtr((uint)cb)); + if (pNewMem == IntPtr.Zero && cb != 0) + { + throw new OutOfMemoryException(); + } + return pNewMem; + } + #if FEATURE_COMINTEROP //==================================================================== @@ -2316,13 +2103,6 @@ namespace System.Runtime.InteropServices if (o == null) return null; -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.MarshalCreateWrapperOfType(o.GetType().GetFullNameForEtw(), t.GetFullNameForEtw()); - } -#endif - // Make sure the object is a COM object. if (!o.GetType().IsCOMObject) throw new ArgumentException(Environment.GetResourceString("Argument_ObjNotComObject"), "o"); @@ -2406,16 +2186,6 @@ namespace System.Runtime.InteropServices // BSTR allocation and dealocation. //==================================================================== [System.Security.SecurityCritical] // auto-generated_required - public static IntPtr ReAllocCoTaskMem(IntPtr pv, int cb) - { - IntPtr pNewMem = Win32Native.CoTaskMemRealloc(pv, new UIntPtr((uint)cb)); - if (pNewMem == IntPtr.Zero && cb != 0) { - throw new OutOfMemoryException(); - } - return pNewMem; - } - - [System.Security.SecurityCritical] // auto-generated_required public static void FreeBSTR(IntPtr ptr) { if (IsNotWin32Atom(ptr)) { @@ -2423,7 +2193,6 @@ namespace System.Runtime.InteropServices } } - [System.Security.SecurityCritical] // auto-generated_required public static IntPtr StringToBSTR(String s) { @@ -2450,19 +2219,7 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal static extern void InternalGetNativeVariantForObject(Object obj, /* VARIANT * */ IntPtr pDstNativeVariant); - - [System.Security.SecurityCritical] - public static void GetNativeVariantForObject(Object obj, /* VARIANT * */ IntPtr pDstNativeVariant) - { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && obj != null) - { - FrameworkEventSource.Log.MarshalGetNativeVariantForObject(obj.GetType().GetFullNameForEtw()); - } -#endif - InternalGetNativeVariantForObject(obj, pDstNativeVariant); - } + public static extern void GetNativeVariantForObject(Object obj, /* VARIANT * */ IntPtr pDstNativeVariant); [System.Security.SecurityCritical] public static void GetNativeVariantForObject<T>(T obj, IntPtr pDstNativeVariant) @@ -2473,50 +2230,23 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal static extern Object InternalGetObjectForNativeVariant(/* VARIANT * */ IntPtr pSrcNativeVariant ); - - [System.Security.SecurityCritical] - public static Object GetObjectForNativeVariant(/* VARIANT * */ IntPtr pSrcNativeVariant ) - { - return InternalGetObjectForNativeVaraintLogging(pSrcNativeVariant); - } + public static extern Object GetObjectForNativeVariant(/* VARIANT * */ IntPtr pSrcNativeVariant ); [System.Security.SecurityCritical] public static T GetObjectForNativeVariant<T>(IntPtr pSrcNativeVariant) { - return (T)InternalGetObjectForNativeVaraintLogging(pSrcNativeVariant); - } - - [System.Security.SecurityCritical] - internal static object InternalGetObjectForNativeVaraintLogging(IntPtr pSrcNativeVariant) - { - Object o = InternalGetObjectForNativeVariant(pSrcNativeVariant); - -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && o != null) - { - FrameworkEventSource.Log.MarshalGetObjectForNativeVariant(o.GetType().GetFullNameForEtw()); - } -#endif - - return o; + return (T)GetObjectForNativeVariant(pSrcNativeVariant); } [System.Security.SecurityCritical] // auto-generated_required [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static extern Object[] InternalGetObjectsForNativeVariants(/* VARIANT * */ IntPtr aSrcNativeVariant, int cVars ); - - [System.Security.SecurityCritical] - public static Object[] GetObjectsForNativeVariants(/* VARIANT * */ IntPtr aSrcNativeVariant, int cVars ) - { - return InternalGetObjectsForNativeVariantsLogging(aSrcNativeVariant, cVars); - } + public static extern Object[] GetObjectsForNativeVariants(/* VARIANT * */ IntPtr aSrcNativeVariant, int cVars ); [System.Security.SecurityCritical] public static T[] GetObjectsForNativeVariants<T>(IntPtr aSrcNativeVariant, int cVars) { - object[] objects = InternalGetObjectsForNativeVariantsLogging(aSrcNativeVariant, cVars); + object[] objects = GetObjectsForNativeVariants(aSrcNativeVariant, cVars); T[] result = null; if (objects != null) @@ -2528,40 +2258,6 @@ namespace System.Runtime.InteropServices return result; } - [System.Security.SecurityCritical] - internal static Object[] InternalGetObjectsForNativeVariantsLogging(/* VARIANT * */ IntPtr aSrcNativeVariant, int cVars) - { - Object[] objects = InternalGetObjectsForNativeVariants(aSrcNativeVariant, cVars); - -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && objects != null) - { - // Since we can only return up to 3 parameters with the managed ETW library, create a formatted string with all - // the object type names in it. The format of the string is: - // <length of type name 1>:<type name 1>:<length of type name 2>:<type name 2>... - StringBuilder sb = new StringBuilder(); - foreach (Object o in objects) - { - if (sb.Length > 0) - sb.Append(":"); - - if (o != null) - { - String typeName = o.GetType().GetFullNameForEtw(); - sb.Append(typeName.Length); - sb.Append(":"); - sb.Append(typeName); - } - } - - FrameworkEventSource.Log.MarshalGetObjectsForNativeVariants(sb.ToString()); - } -#endif - - return objects; - } - - /// <summary> /// <para>Returns the first valid COM slot that GetMethodInfoForSlot will work on /// This will be 3 for IUnknown based interfaces and 7 for IDispatch based interfaces. </para> @@ -2569,19 +2265,7 @@ namespace System.Runtime.InteropServices [System.Security.SecurityCritical] // auto-generated_required [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static extern int InternalGetStartComSlot(Type t); - - [System.Security.SecurityCritical] - public static int GetStartComSlot(Type t) - { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && t != null) - { - FrameworkEventSource.Log.MarshalGetStartComSlot(t.GetFullNameForEtw()); - } -#endif - return InternalGetStartComSlot(t); - } + public static extern int GetStartComSlot(Type t); /// <summary> /// <para>Returns the last valid COM slot that GetMethodInfoForSlot will work on. </para> @@ -2648,7 +2332,6 @@ namespace System.Runtime.InteropServices [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern void FCallGenerateGuidForType(ref Guid result, Type type); -#if FEATURE_CLASSIC_COMINTEROP //==================================================================== // This method generates a PROGID for the specified type. If the type // has a PROGID in the metadata then it is returned otherwise a stable @@ -2774,7 +2457,6 @@ namespace System.Runtime.InteropServices [SuppressUnmanagedCodeSecurity] [System.Security.SecurityCritical] // auto-generated private static extern void GetActiveObject(ref Guid rclsid, IntPtr reserved, [MarshalAs(UnmanagedType.Interface)] out Object ppunk); -#endif // FEATURE_CLASSIC_COMINTEROP //======================================================================== // Private method called from remoting to support ServicedComponents. @@ -2806,15 +2488,12 @@ namespace System.Runtime.InteropServices [MethodImplAttribute(MethodImplOptions.InternalCall)] public static extern void ChangeWrapperHandleStrength(Object otp, bool fIsWeak); -#if !FEATURE_CORECLR - [System.Runtime.ForceTokenStabilization] -#endif //!FEATURE_CORECLR [System.Security.SecurityCritical] [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void InitializeWrapperForWinRT(object o, ref IntPtr pUnk); -#if FEATURE_COMINTEROP_MANAGED_ACTIVATION +#if FEATURE_COMINTEROP_WINRT_MANAGED_ACTIVATION [System.Security.SecurityCritical] [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -2942,13 +2621,6 @@ namespace System.Runtime.InteropServices if (c == null || (c != typeof(Delegate) && c != typeof(MulticastDelegate))) throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), "t"); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.MarshalGetDelegateForFunctionPointer(t.GetFullNameForEtw()); - } -#endif - return GetDelegateForFunctionPointerInternal(ptr, t); } @@ -2969,14 +2641,6 @@ namespace System.Runtime.InteropServices throw new ArgumentNullException("d"); Contract.EndContractBlock(); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) - && d.Target != null - && d.Method != null) - { - FrameworkEventSource.Log.MarshalGetFunctionPointerForDelegate(d.Target.GetType().GetFullNameForEtw(), d.Method.GetFullNameForEtw()); - } -#endif return GetFunctionPointerForDelegateInternal(d); } @@ -2990,7 +2654,7 @@ namespace System.Runtime.InteropServices [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern IntPtr GetFunctionPointerForDelegateInternal(Delegate d); -#if FEATURE_COMINTEROP && (FEATURE_CRYPTO || FEATURE_X509_SECURESTRINGS || FEATURE_CORESYSTEM) +#if FEATURE_COMINTEROP [System.Security.SecurityCritical] // auto-generated_required public static IntPtr SecureStringToBSTR(SecureString s) { if( s == null) { @@ -3000,6 +2664,7 @@ namespace System.Runtime.InteropServices return s.ToBSTR(); } +#endif [System.Security.SecurityCritical] // auto-generated_required public static IntPtr SecureStringToCoTaskMemAnsi(SecureString s) { @@ -3023,13 +2688,14 @@ namespace System.Runtime.InteropServices return s.ToUniStr(false); } - +#if FEATURE_COMINTEROP [System.Security.SecurityCritical] // auto-generated_required public static void ZeroFreeBSTR(IntPtr s) { Win32Native.ZeroMemory(s, (UIntPtr)(Win32Native.SysStringLen(s) * 2)); FreeBSTR(s); } +#endif [System.Security.SecurityCritical] // auto-generated_required public static void ZeroFreeCoTaskMemAnsi(IntPtr s) @@ -3044,9 +2710,7 @@ namespace System.Runtime.InteropServices Win32Native.ZeroMemory(s, (UIntPtr)(Win32Native.lstrlenW(s) * 2)); FreeCoTaskMem(s); } -#endif // FEATURE_COMINTEROP && (FEATURE_CRYPTO || FEATURE_X509_SECURESTRINGS) -#if FEATURE_CRYPTO || FEATURE_X509_SECURESTRINGS || FEATURE_CORESYSTEM [System.Security.SecurityCritical] // auto-generated_required public static IntPtr SecureStringToGlobalAllocAnsi(SecureString s) { if( s == null) { @@ -3066,7 +2730,6 @@ namespace System.Runtime.InteropServices return s.ToUniStr(true); } -#endif // FEATURE_CRYPTO || FEATURE_X509_SECURESTRINGS [System.Security.SecurityCritical] // auto-generated_required public static void ZeroFreeGlobalAllocAnsi(IntPtr s) { @@ -3119,9 +2782,3 @@ namespace System.Runtime.InteropServices #endif // FEATURE_COMINTEROP && !FEATURE_CORECLR } - - - - - - diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/pinvokemap.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/pinvokemap.cs index 5eb48c8e3ac..9b2f099b4ee 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/pinvokemap.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/pinvokemap.cs @@ -9,7 +9,7 @@ // PInvokeMap is an enum that defines the PInvoke attributes. These // values are defined in CorHdr.h. // -// <EMAIL>Author: [....]</EMAIL> +// <EMAIL>Author: meichint</EMAIL> // Date: Sep 99 // namespace System.Runtime.InteropServices { diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/safebuffer.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/safebuffer.cs index 95d518b390e..6e243c8411a 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/safebuffer.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/safebuffer.cs @@ -135,7 +135,6 @@ using System.Diagnostics.Contracts; _numBytes = checked((UIntPtr) (numElements * sizeOfEachElement)); } -#if !FEATURE_CORECLR /// <summary> /// Specifies the the size of the region in memory, as the number of /// elements in an array. Must be called before using the SafeBuffer. @@ -145,7 +144,6 @@ using System.Diagnostics.Contracts; { Initialize(numElements, Marshal.AlignedSizeOf<T>()); } -#endif // Callers should ensure that they check whether the pointer ref param // is null when AcquirePointer returns. If it is not null, they must diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/safehandle.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/safehandle.cs index 65e02de3ae3..6536f3c77d2 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/safehandle.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/safehandle.cs @@ -150,9 +150,6 @@ public abstract partial class SafeHandle : CriticalFinalizerObject, IDisposable [MarshalAs(UnmanagedType.LPWStr)] private String _stackTrace; // Where we allocated this SafeHandle. #endif -#if !FEATURE_CORECLR - [System.Runtime.ForceTokenStabilization] - #endif //!FEATURE_CORECLR protected IntPtr handle; // this must be protected so derived classes can use out params. private int _state; // Combined ref count and closed/disposed flags (so we can atomically modify them). private bool _ownsHandle; // Whether we can release this handle. @@ -208,9 +205,6 @@ public abstract partial class SafeHandle : CriticalFinalizerObject, IDisposable extern void InternalFinalize(); #endif [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] -#if !FEATURE_CORECLR - [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] -#endif protected void SetHandle(IntPtr handle) { this.handle = handle; } @@ -231,9 +225,6 @@ public abstract partial class SafeHandle : CriticalFinalizerObject, IDisposable // and get back information for an entirely unrelated resource). [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] [ResourceExposure(ResourceScope.None)] -#if !FEATURE_CORECLR - [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] -#endif public IntPtr DangerousGetHandle() { return handle; @@ -241,9 +232,6 @@ public abstract partial class SafeHandle : CriticalFinalizerObject, IDisposable public bool IsClosed { [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] -#if !FEATURE_CORECLR - [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] -#endif get { return (_state & 1) == 1; } } diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/IClosable.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/IClosable.cs index 3a2f02690ee..e15957adfcc 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/IClosable.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/IClosable.cs @@ -18,7 +18,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime [ComImport] [Guid("30d5a829-7fa4-4026-83bb-d75bae4ea99e")] [WindowsRuntimeImport] - [ForceTokenStabilization] internal interface IClosable { void Close(); @@ -33,7 +32,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime } [SecurityCritical] - [ForceTokenStabilization] public void Close() { IDisposable _this = JitHelpers.UnsafeCast<IDisposable>(this); @@ -50,7 +48,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime Contract.Assert(false, "This class is never instantiated"); } - [ForceTokenStabilization] [SecurityCritical] private void Dispose() { diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/attributes.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/attributes.cs index 8be810c5641..8dfd4c70ca5 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/attributes.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/attributes.cs @@ -4,9 +4,9 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> using System; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortocollectionadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortocollectionadapter.cs index 215e0d159cd..248643a3c15 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortocollectionadapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortocollectionadapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Runtime; @@ -36,7 +36,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // int Count { get } [Pure] [SecurityCritical] - [ForceTokenStabilization] internal int Count() { IBindableVector _this = JitHelpers.UnsafeCast<IBindableVector>(this); @@ -52,7 +51,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // bool IsSynchronized { get } [Pure] [SecurityCritical] - [ForceTokenStabilization] internal bool IsSynchronized() { return false; @@ -61,7 +59,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // object SyncRoot { get } [Pure] [SecurityCritical] - [ForceTokenStabilization] internal object SyncRoot() { return this; @@ -70,7 +67,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // void CopyTo(Array array, int index) [Pure] [SecurityCritical] - [ForceTokenStabilization] internal void CopyTo(Array array, int arrayIndex) { if (array == null) @@ -89,7 +85,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime throw new ArgumentOutOfRangeException("arrayIndex"); // Does the dimension in question have sufficient space to copy the expected number of entries? - // We perform this check before valid index check to ensure the exception message is in [....] with + // We perform this check before valid index check to ensure the exception message is in sync with // the following snippet that uses regular framework code: // // ArrayList list = new ArrayList(); diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortolistadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortolistadapter.cs index 9842d24a937..e8aa7ecb1fb 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortolistadapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/bindablevectortolistadapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Runtime; @@ -35,7 +35,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // object this[int index] { get } [SecurityCritical] - [ForceTokenStabilization] internal object Indexer_Get(int index) { if (index < 0) @@ -47,7 +46,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // object this[int index] { set } [SecurityCritical] - [ForceTokenStabilization] internal void Indexer_Set(int index, object value) { if (index < 0) @@ -59,7 +57,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // int Add(object value) [SecurityCritical] - [ForceTokenStabilization] internal int Add(object value) { IBindableVector _this = JitHelpers.UnsafeCast<IBindableVector>(this); @@ -76,7 +73,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // bool Contains(object item) [SecurityCritical] - [ForceTokenStabilization] internal bool Contains(object item) { IBindableVector _this = JitHelpers.UnsafeCast<IBindableVector>(this); @@ -87,7 +83,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // void Clear() [SecurityCritical] - [ForceTokenStabilization] internal void Clear() { IBindableVector _this = JitHelpers.UnsafeCast<IBindableVector>(this); @@ -97,7 +92,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // bool IsFixedSize { get } [Pure] [SecurityCritical] - [ForceTokenStabilization] internal bool IsFixedSize() { return false; @@ -106,7 +100,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // bool IsReadOnly { get } [Pure] [SecurityCritical] - [ForceTokenStabilization] internal bool IsReadOnly() { return false; @@ -114,7 +107,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // int IndexOf(object item) [SecurityCritical] - [ForceTokenStabilization] internal int IndexOf(object item) { IBindableVector _this = JitHelpers.UnsafeCast<IBindableVector>(this); @@ -135,7 +127,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // void Insert(int index, object item) [SecurityCritical] - [ForceTokenStabilization] internal void Insert(int index, object item) { if (index < 0) @@ -147,7 +138,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // bool Remove(object item) [SecurityCritical] - [ForceTokenStabilization] internal void Remove(object item) { IBindableVector _this = JitHelpers.UnsafeCast<IBindableVector>(this); @@ -168,7 +158,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // void RemoveAt(int index) [SecurityCritical] - [ForceTokenStabilization] internal void RemoveAt(int index) { if (index < 0) diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrikeyvaluepairimpl.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrikeyvaluepairimpl.cs index 25c3184066d..44b63f91154 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrikeyvaluepairimpl.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrikeyvaluepairimpl.cs @@ -4,8 +4,8 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Collections.Generic; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clripropertyvalueimpl.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clripropertyvalueimpl.cs index c7781abf070..3dc29580b28 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clripropertyvalueimpl.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clripropertyvalueimpl.cs @@ -4,9 +4,9 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Diagnostics.Contracts; @@ -475,7 +475,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime return (T)(object)ipv.GetDouble(); } else { - BCLDebug.Assert(false, "T in coersion function wasn't understood as a type that can be coerced - make sure that CoerceScalarValue and NumericScalarTypes are in [....]"); + BCLDebug.Assert(false, "T in coersion function wasn't understood as a type that can be coerced - make sure that CoerceScalarValue and NumericScalarTypes are in sync"); } } diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrireferenceimpl.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrireferenceimpl.cs index b8730c204ec..831358e2d52 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrireferenceimpl.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/clrireferenceimpl.cs @@ -4,14 +4,13 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Collections; using System.Diagnostics.Contracts; -using System.Diagnostics.Tracing; using System.Reflection; using System.Security; @@ -78,6 +77,10 @@ namespace System.Runtime.InteropServices.WindowsRuntime // We have T in an IReference<T>. Need to QI for IReference<T> with the appropriate GUID, call // the get_Value property, allocate an appropriately-sized managed object, marshal the native object // to the managed object, and free the native method. Also we want the return value boxed (aka normal value type boxing). + // + // This method is called by VM. Mark the method with FriendAccessAllowed attribute to ensure that the unreferenced method + // optimization skips it and the code will be saved into NGen image. + [System.Runtime.CompilerServices.FriendAccessAllowed] internal static Object UnboxHelper(Object wrapper) { Contract.Requires(wrapper != null); @@ -104,7 +107,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime _value = obj; // This should not fail but I'm making a cast here anyway just in case - // we have a bug (that _value is not an array) or there is a runtime failure + // we have a _list = (IList) _value; } @@ -263,6 +266,10 @@ namespace System.Runtime.InteropServices.WindowsRuntime // We have T in an IReferenceArray<T>. Need to QI for IReferenceArray<T> with the appropriate GUID, call // the get_Value property, allocate an appropriately-sized managed object, marshal the native object // to the managed object, and free the native method. + // + // This method is called by VM. Mark the method with FriendAccessAllowed attribute to ensure that the unreferenced method + // optimization skips it and the code will be saved into NGen image. + [System.Runtime.CompilerServices.FriendAccessAllowed] internal static Object UnboxHelper(Object wrapper) { Contract.Requires(wrapper != null); @@ -286,28 +293,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime Contract.Requires(obj != null, "Null should not be boxed."); Contract.Ensures(Contract.Result<Object>() != null); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.BeginCreateIReference(); - } -#endif - - Object returnObj = CreateIReferenceWorker(obj); - -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.EndCreateIReference(returnObj != null ? returnObj.GetType().GetFullNameForEtw() : ""); - } -#endif - - return returnObj; - } - - [SecuritySafeCritical] - private static Object CreateIReferenceWorker(Object obj) - { Type type = obj.GetType(); if (type.IsArray) diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/custompropertyimpl.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/custompropertyimpl.cs index 6344d096343..bf762dbefe9 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/custompropertyimpl.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/custompropertyimpl.cs @@ -4,13 +4,12 @@ // // ==--== // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; using System.Reflection; using System.Diagnostics.Contracts; -using System.Diagnostics.Tracing; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Runtime.Serialization; @@ -69,77 +68,26 @@ namespace System.Runtime.InteropServices.WindowsRuntime public object GetValue(object target) { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.BeginCustomPropertyImplGetValue(target != null ? target.GetType().GetFullNameForEtw() : "", m_property.GetFullNameForEtw()); - } -#endif - object o = InvokeInternal(target, null, true); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.EndCustomPropertyImplGetValue(target != null ? target.GetType().GetFullNameForEtw() : "", m_property.GetFullNameForEtw()); - } -#endif - return o; + return InvokeInternal(target, null, true); } // Unlike normal .Net, Jupiter properties can have at most one indexer parameter. A null // indexValue here means that the property has an indexer argument and its value is null. public object GetValue(object target, object indexValue) { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.BeginCustomPropertyImplGetValueIndexValue(target != null ? target.GetType().GetFullNameForEtw() : "", indexValue != null ? indexValue.GetType().GetFullNameForEtw() : ""); - } -#endif - object o = InvokeInternal(target, new object[] { indexValue }, true); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.EndCustomPropertyImplGetValueIndexValue(target != null ? target.GetType().GetFullNameForEtw() : "", indexValue != null ? indexValue.GetType().GetFullNameForEtw() : ""); - } -#endif - return o; + return InvokeInternal(target, new object[] { indexValue }, true); } public void SetValue(object target, object value) { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.BeginCustomPropertyImplSetValue(target != null ? target.GetType().GetFullNameForEtw() : "", value != null ? value.GetType().GetFullNameForEtw() : ""); - } -#endif InvokeInternal(target, new object[] { value }, false); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.EndCustomPropertyImplSetValue(target != null ? target.GetType().GetFullNameForEtw() : "", value != null ? value.GetType().GetFullNameForEtw() : ""); - } -#endif } // Unlike normal .Net, Jupiter properties can have at most one indexer parameter. A null // indexValue here means that the property has an indexer argument and its value is null. public void SetValue(object target, object value, object indexValue) { -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.BeginCustomPropertyImplSetValueIndexValue(target != null ? target.GetType().GetFullNameForEtw() : "", value != null ? value.GetType().GetFullNameForEtw() : "", indexValue != null ? indexValue.GetType().GetFullNameForEtw() : ""); - } -#endif InvokeInternal(target, new object[] { indexValue, value }, false); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.EndCustomPropertyImplSetValueIndexValue(target != null ? target.GetType().GetFullNameForEtw() : "", value != null ? value.GetType().GetFullNameForEtw() : "", indexValue != null ? indexValue.GetType().GetFullNameForEtw() : ""); - } -#endif - } [SecuritySafeCritical] diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/dictionarytomapadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/dictionarytomapadapter.cs index db7e014764b..94a0d9e60c5 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/dictionarytomapadapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/dictionarytomapadapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/enumeratortoiteratoradapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/enumeratortoiteratoradapter.cs index a4ee4b1ed8a..60e229954f0 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/enumeratortoiteratoradapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/enumeratortoiteratoradapter.cs @@ -4,9 +4,9 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Collections; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtoken.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtoken.cs index 5f96a90e75d..092e43a2bcc 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtoken.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtoken.cs @@ -4,9 +4,9 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> using System; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtokentable.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtokentable.cs index 2de657df7f7..152e46f3403 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtokentable.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtokentable.cs @@ -4,9 +4,9 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Collections.Generic; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iactivationfactory.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iactivationfactory.cs index b0cfa61eead..bdcfc012d91 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iactivationfactory.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iactivationfactory.cs @@ -4,9 +4,9 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>LadiPro</OWNER> +// <OWNER>RByers</OWNER> +// <OWNER>ShawnFa</OWNER> using System; using System.Runtime.InteropServices; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/icustomproperty.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/icustomproperty.cs index 0d199998982..4eafca925e7 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/icustomproperty.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/icustomproperty.cs @@ -4,7 +4,7 @@ // // ==--== // -// <OWNER>[....]</OWNER> +// <OWNER>yzha</OWNER> using System; using System.Diagnostics.Contracts; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/icustompropertyprovider.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/icustompropertyprovider.cs index bc692915c60..d505dfac3bb 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/icustompropertyprovider.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/icustompropertyprovider.cs @@ -4,13 +4,12 @@ // // ==--== // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.StubHelpers; using System.Reflection; using System.Diagnostics.Contracts; -using System.Diagnostics.Tracing; using System.Runtime.InteropServices; using System.Collections; using System.Collections.Generic; @@ -54,24 +53,11 @@ namespace System.Runtime.InteropServices.WindowsRuntime Contract.Requires(target != null); Contract.Requires(propertyName != null); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.BeginICustomPropertyProviderCreateProperty(target.GetType().GetFullNameForEtw(), propertyName); - } -#endif // Only return public instance/static properties PropertyInfo propertyInfo = target.GetType().GetProperty( propertyName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.EndICustomPropertyProviderCreateProperty(target.GetType().GetFullNameForEtw(), propertyName); - } -#endif - if (propertyInfo == null) return null; else @@ -99,13 +85,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime Contract.Requires(target != null); Contract.Requires(propertyName != null); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.BeginICustomPropertyProviderCreateIndexedProperty(target.GetType().GetFullNameForEtw(), propertyName, indexedParamType != null ? indexedParamType.GetFullNameForEtw() : ""); - } -#endif - // Only return public instance/static properties PropertyInfo propertyInfo = target.GetType().GetProperty( propertyName, @@ -116,13 +95,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime null // ignore type modifier ); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.EndICustomPropertyProviderCreateIndexedProperty(target.GetType().GetFullNameForEtw(), propertyName, indexedParamType != null ? indexedParamType.GetFullNameForEtw() : ""); - } -#endif - if (propertyInfo == null) return null; else @@ -250,7 +222,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { return _target.GetType(); } - } + } // // override ToString() to make sure callers get correct IStringable.ToString() behavior in native code @@ -259,7 +231,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { return WindowsRuntime.IStringableHelper.ToString(_target); } - + // // IGetProxyTarget - unwraps the target object and use it for data binding // diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iiterable.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iiterable.cs index ff1ad9c9229..58db0a50ade 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iiterable.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iiterable.cs @@ -4,8 +4,8 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>LadiPro</OWNER> +// <OWNER>ShawnFa</OWNER> using System; using System.Collections.Generic; @@ -18,7 +18,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime [ComImport] [Guid("faa585ea-6214-4217-afda-7f46de5869b3")] [WindowsRuntimeImport] - [System.Runtime.ForceTokenStabilization] internal interface IIterable<T> : IEnumerable<T> { [Pure] @@ -28,7 +27,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime [ComImport] [Guid("036d2c08-df29-41af-8aa2-d774be62ba6f")] [WindowsRuntimeImport] - [System.Runtime.ForceTokenStabilization] internal interface IBindableIterable { [Pure] diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iiterator.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iiterator.cs index 157e907da04..ab9251987c9 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iiterator.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iiterator.cs @@ -4,9 +4,9 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>LadiPro</OWNER> +// <OWNER>RByers</OWNER> +// <OWNER>ShawnFa</OWNER> using System; using System.Diagnostics.Contracts; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/imap.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/imap.cs index b3a62c8c79e..dda04d6350c 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/imap.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/imap.cs @@ -4,8 +4,8 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>LadiPro</OWNER> +// <OWNER>ShawnFa</OWNER> using System; using System.Collections.Generic; @@ -19,7 +19,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime [ComImport] [Guid("3c2925fe-8519-45c1-aa79-197b6718c1c1")] [WindowsRuntimeImport] - [System.Runtime.ForceTokenStabilization] internal interface IMap<K, V> : IIterable<IKeyValuePair<K, V>> { [Pure] @@ -38,7 +37,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime [ComImport] [Guid("e480ce40-a338-4ada-adcf-272272e48cb9")] [WindowsRuntimeImport] - [System.Runtime.ForceTokenStabilization] internal interface IMapView<K, V> : IIterable<IKeyValuePair<K, V>> { [Pure] @@ -54,7 +52,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime [ComImport] [Guid("02b51929-c1c4-4a7e-8940-0312b5c18500")] [WindowsRuntimeImport] - [System.Runtime.ForceTokenStabilization] internal interface IKeyValuePair<K, V> { [Pure] diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/imapviewtoireadonlydictionaryadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/imapviewtoireadonlydictionaryadapter.cs index 4817cbcf25c..cd73d355f8c 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/imapviewtoireadonlydictionaryadapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/imapviewtoireadonlydictionaryadapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; @@ -98,7 +98,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime value = _this.Lookup(key); return true; } - catch (Exception ex) // Still may hit this case due to a ----, or a potential bug. + catch (Exception ex) // Still may hit this case due to a ----, or a potential { if (__HResults.E_BOUNDS == ex._HResult) { diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ipropertyvalue.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ipropertyvalue.cs index cdec88e445f..086f209f758 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ipropertyvalue.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ipropertyvalue.cs @@ -4,9 +4,9 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>LadiPro</OWNER> +// <OWNER>RByers</OWNER> +// <OWNER>ShawnFa</OWNER> using System; using System.Diagnostics.Contracts; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlydictionarytoimapviewadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlydictionarytoimapviewadapter.cs index 32433c99c73..9a9c98ab416 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlydictionarytoimapviewadapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlydictionarytoimapviewadapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlylisttoivectorviewadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlylisttoivectorviewadapter.cs index bec4e3e70d0..1bf26b164de 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlylisttoivectorviewadapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireadonlylisttoivectorviewadapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireference.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireference.cs index 04e568a8f99..bf53a3a6a96 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireference.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ireference.cs @@ -4,9 +4,9 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>LadiPro</OWNER> +// <OWNER>RByers</OWNER> +// <OWNER>ShawnFa</OWNER> using System; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/irestrictederrorinfo.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/irestrictederrorinfo.cs index e07268eb805..1c1f66c7d03 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/irestrictederrorinfo.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/irestrictederrorinfo.cs @@ -4,12 +4,15 @@ // // ==--== // -// <OWNER>[....]</OWNER> +// <OWNER>ShawnFa</OWNER> using System; namespace System.Runtime.InteropServices.WindowsRuntime { +#if FEATURE_CORECLR + [System.Runtime.CompilerServices.FriendAccessAllowed] +#endif [ComImport] [Guid("82BA7092-4C88-427D-A7BC-16DD93FEB67E")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iteratortoenumeratoradapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iteratortoenumeratoradapter.cs index ab7dce2e033..e1460806c42 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iteratortoenumeratoradapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iteratortoenumeratoradapter.cs @@ -4,8 +4,8 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Collections; @@ -92,7 +92,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // This method is invoked when GetEnumerator is called on a WinRT-backed implementation of IEnumerable. [SecurityCritical] - [ForceTokenStabilization] internal IEnumerator GetEnumerator_Stub() { IBindableIterable _this = JitHelpers.UnsafeCast<IBindableIterable>(this); diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ivector.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ivector.cs index dc931010608..9f74c73ef48 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ivector.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ivector.cs @@ -4,8 +4,8 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>LadiPro</OWNER> +// <OWNER>ShawnFa</OWNER> using System; using System.Collections.Generic; @@ -19,7 +19,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime [ComImport] [Guid("913337e9-11a1-4345-a3a2-4e7f956e222d")] [WindowsRuntimeImport] - [System.Runtime.ForceTokenStabilization] internal interface IVector<T> : IIterable<T> { [Pure] @@ -45,7 +44,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime [ComImport] [Guid("913337e9-11a1-4345-a3a2-4e7f956e222d")] [WindowsRuntimeImport] - [System.Runtime.ForceTokenStabilization] internal interface IVector_Raw<T> : IIterable<T> { [Pure] @@ -70,7 +68,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime [ComImport] [Guid("bbe1fa4c-b0e3-4583-baef-1f1b2e483e56")] [WindowsRuntimeImport] - [System.Runtime.ForceTokenStabilization] internal interface IVectorView<T> : IIterable<T> { [Pure] @@ -86,7 +83,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime [ComImport] [Guid("393de7de-6fd0-4c0d-bb71-47244a113e93")] [WindowsRuntimeImport] - [System.Runtime.ForceTokenStabilization] internal interface IBindableVector : IBindableIterable { [Pure] diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ivectorviewtoireadonlylistadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ivectorviewtoireadonlylistadapter.cs index 2e0631196df..14e43b37e0a 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ivectorviewtoireadonlylistadapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/ivectorviewtoireadonlylistadapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iwinrtclassactivator.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iwinrtclassactivator.cs index 8cc05316e35..c049d558057 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iwinrtclassactivator.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iwinrtclassactivator.cs @@ -4,7 +4,7 @@ // // ==--== // -// <OWNER>[....]</OWNER> +// <OWNER>ShawnFa</OWNER> using System; using System.Security; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectoradapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectoradapter.cs index 7212db3e4f3..fa9e01eb236 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectoradapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectoradapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectorviewadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectorviewadapter.cs index 80cd46fb64d..08e99c52631 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectorviewadapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtobindablevectorviewadapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtovectoradapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtovectoradapter.cs index 7f5e9cf83fa..a093837c5af 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtovectoradapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/listtovectoradapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/managedactivationfactory.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/managedactivationfactory.cs index a519b59eac5..dd963c54a2b 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/managedactivationfactory.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/managedactivationfactory.cs @@ -4,13 +4,12 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Diagnostics.Contracts; -using System.Diagnostics.Tracing; using System.Reflection; using System.Runtime.InteropServices; using System.Security; @@ -48,12 +47,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime // with at least one ActivatableAttribute or StaticAttribute. if (!(type is RuntimeType) || !type.IsExportedToWindowsRuntime) throw new ArgumentException(Environment.GetResourceString("Argument_TypeNotActivatableViaWindowsRuntime", type), "type"); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.ManagedActivationFactoryConstructor(type.GetFullNameForEtw()); - } -#endif m_type = type; } diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptocollectionadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptocollectionadapter.cs index ecaedd87be0..c04a9a0cf63 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptocollectionadapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptocollectionadapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptodictionaryadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptodictionaryadapter.cs index 320397249b3..8b68eca2b56 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptodictionaryadapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/maptodictionaryadapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/mapviewtoreadonlycollectionadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/mapviewtoreadonlycollectionadapter.cs index d9ea83ecbe7..8854c87e36f 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/mapviewtoreadonlycollectionadapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/mapviewtoreadonlycollectionadapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/nativemethods.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/nativemethods.cs index 7f94167b414..f9cec78699e 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/nativemethods.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/nativemethods.cs @@ -4,9 +4,9 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>LadiPro</OWNER> +// <OWNER>RByers</OWNER> +// <OWNER>ShawnFa</OWNER> using System; using System.Runtime.InteropServices; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/propertyvalue.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/propertyvalue.cs index 047b4112770..3cd8d0fd79b 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/propertyvalue.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/propertyvalue.cs @@ -4,10 +4,10 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>BLanders</OWNER> +// <OWNER>LadiPro</OWNER> +// <OWNER>RByers</OWNER> +// <OWNER>ShawnFa</OWNER> using System; using System.Diagnostics.Contracts; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/runtimeclass.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/runtimeclass.cs index bb5a3e4604c..3d55152acc4 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/runtimeclass.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/runtimeclass.cs @@ -25,7 +25,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime { [ComImport] [Guid("96369f54-8eb6-48f0-abce-c1b211e627c3")] [WindowsRuntimeImport] - [ForceTokenStabilization] internal interface IStringable { string ToString(); diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortocollectionadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortocollectionadapter.cs index af4674c3a0d..0443ed2d142 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortocollectionadapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortocollectionadapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortolistadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortolistadapter.cs index edc20f2b6ba..51858b00038 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortolistadapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectortolistadapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectorviewtoreadonlycollectionadapter.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectorviewtoreadonlycollectionadapter.cs index b704460e7f9..f1e95611b3a 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectorviewtoreadonlycollectionadapter.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/vectorviewtoreadonlycollectionadapter.cs @@ -5,7 +5,7 @@ // ==--== // // <OWNER>GPaperin</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsfoundationeventhandler.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsfoundationeventhandler.cs index 611fd89c955..66a9662514b 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsfoundationeventhandler.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsfoundationeventhandler.cs @@ -4,7 +4,7 @@ // // ==--== // -// <OWNER>[....]</OWNER> +// <OWNER>ShawnFa</OWNER> using System; @@ -13,6 +13,5 @@ namespace System.Runtime.InteropServices.WindowsRuntime // WindowsFoundationEventHandler<T> a copy of the definition for the Windows.Foundation.EventHandler<T> delegate [Guid("9de1c535-6ae1-11e0-84e1-18a905bcc53f")] [WindowsRuntimeImport] - [System.Runtime.ForceTokenStabilization] internal delegate void WindowsFoundationEventHandler<T>(object sender, T args); } diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemarshal.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemarshal.cs index a27bc01bad4..c186cf73fe5 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemarshal.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemarshal.cs @@ -4,14 +4,13 @@ // // ==--== // -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Collections.Generic; using System.Diagnostics.Contracts; -using System.Diagnostics.Tracing; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -1203,7 +1202,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime return false; } -#if FEATURE_COMINTEROP_MANAGED_ACTIVATION +#if FEATURE_COMINTEROP_WINRT_MANAGED_ACTIVATION // Get an IActivationFactory * for a managed type [SecurityCritical] internal static IntPtr GetActivationFactoryForType(Type type) @@ -1279,25 +1278,18 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (type == null) throw new ArgumentNullException("type"); -#if !FEATURE_CORECLR - if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) - { - FrameworkEventSource.Log.WindowsRuntimeMarshalGetActivationFactory(type.GetFullNameForEtw()); - } -#endif - if (type.IsWindowsRuntimeObject && type.IsImport) { return (IActivationFactory)Marshal.GetNativeActivationFactory(type); } else { -#if !FEATURE_CORECLR +#if FEATURE_COMINTEROP_WINRT_MANAGED_ACTIVATION return GetManagedActivationFactory(type); -#else // FEATURE_CORECLR +#else // Managed factories are not supported so as to minimize public surface (and test effort) throw new NotSupportedException(); -#endif // !FEATURE_CORECLR +#endif } } diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemetadata.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemetadata.cs index 137a190b607..ff320ed95cd 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemetadata.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemetadata.cs @@ -4,7 +4,7 @@ // // ==--== // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> namespace System.Runtime.InteropServices.WindowsRuntime { diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/winrtclassactivator.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/winrtclassactivator.cs index 3de33410c57..0aa99ce421f 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/winrtclassactivator.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/winrtclassactivator.cs @@ -4,7 +4,7 @@ // // ==--== // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> using System; using System.Security; |