From 457a90b88eba5c37cadc332ff64a9f92592297a9 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Fri, 22 Dec 2017 21:42:41 -0800 Subject: [PATCH] Merge pull request dotnet/corert#5148 from dotnet/nmirror Merge nmirror to master Signed-off-by: dotnet-bot --- src/mscorlib/System.Private.CoreLib.csproj | 1 - .../shared/System.Private.CoreLib.Shared.projitems | 2 ++ .../Runtime/InteropServices/GuidAttribute.cs | 17 +++++++++++++++ .../System/Runtime/InteropServices/HandleRef.cs | 25 +++++++++------------- .../System/Runtime/InteropServices/Attributes.cs | 11 ---------- 5 files changed, 29 insertions(+), 27 deletions(-) create mode 100644 src/mscorlib/shared/System/Runtime/InteropServices/GuidAttribute.cs rename src/mscorlib/{src => shared}/System/Runtime/InteropServices/HandleRef.cs (69%) diff --git a/src/mscorlib/System.Private.CoreLib.csproj b/src/mscorlib/System.Private.CoreLib.csproj index fcb499b..0729772 100644 --- a/src/mscorlib/System.Private.CoreLib.csproj +++ b/src/mscorlib/System.Private.CoreLib.csproj @@ -148,7 +148,6 @@ - diff --git a/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems b/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems index 90587d2..aaf6bfc 100644 --- a/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems +++ b/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems @@ -422,6 +422,8 @@ + + diff --git a/src/mscorlib/shared/System/Runtime/InteropServices/GuidAttribute.cs b/src/mscorlib/shared/System/Runtime/InteropServices/GuidAttribute.cs new file mode 100644 index 0000000..cf60b9b --- /dev/null +++ b/src/mscorlib/shared/System/Runtime/InteropServices/GuidAttribute.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.InteropServices +{ + [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct | AttributeTargets.Delegate, Inherited = false)] + public sealed class GuidAttribute : Attribute + { + public GuidAttribute(string guid) + { + Value = guid; + } + + public string Value { get; } + } +} diff --git a/src/mscorlib/src/System/Runtime/InteropServices/HandleRef.cs b/src/mscorlib/shared/System/Runtime/InteropServices/HandleRef.cs similarity index 69% rename from src/mscorlib/src/System/Runtime/InteropServices/HandleRef.cs rename to src/mscorlib/shared/System/Runtime/InteropServices/HandleRef.cs index 41eb1c2..b8dc0c0 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/HandleRef.cs +++ b/src/mscorlib/shared/System/Runtime/InteropServices/HandleRef.cs @@ -2,31 +2,27 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. - -using System; - namespace System.Runtime.InteropServices { public struct HandleRef { // ! Do not add or rearrange fields as the EE depends on this layout. //------------------------------------------------------------------ - internal Object m_wrapper; - internal IntPtr m_handle; + internal object _wrapper; + internal IntPtr _handle; //------------------------------------------------------------------ - - public HandleRef(Object wrapper, IntPtr handle) + public HandleRef(object wrapper, IntPtr handle) { - m_wrapper = wrapper; - m_handle = handle; + _wrapper = wrapper; + _handle = handle; } - public Object Wrapper + public object Wrapper { get { - return m_wrapper; + return _wrapper; } } @@ -34,19 +30,18 @@ namespace System.Runtime.InteropServices { get { - return m_handle; + return _handle; } } - public static explicit operator IntPtr(HandleRef value) { - return value.m_handle; + return value._handle; } public static IntPtr ToIntPtr(HandleRef value) { - return value.m_handle; + return value._handle; } } } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/Attributes.cs b/src/mscorlib/src/System/Runtime/InteropServices/Attributes.cs index 4570da9..4141202 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/Attributes.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/Attributes.cs @@ -161,17 +161,6 @@ namespace System.Runtime.InteropServices } } - [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct | AttributeTargets.Delegate, Inherited = false)] - public sealed class GuidAttribute : Attribute - { - internal String _val; - public GuidAttribute(String guid) - { - _val = guid; - } - public String Value { get { return _val; } } - } - [AttributeUsage(AttributeTargets.Interface, Inherited = false)] public sealed class CoClassAttribute : Attribute { -- 2.7.4