Merge pull request dotnet/corert#5148 from dotnet/nmirror
authorJan Kotas <jkotas@microsoft.com>
Sat, 23 Dec 2017 05:42:41 +0000 (21:42 -0800)
committerJan Kotas <jkotas@microsoft.com>
Fri, 29 Dec 2017 01:55:36 +0000 (17:55 -0800)
Merge nmirror to master

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
src/mscorlib/System.Private.CoreLib.csproj
src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
src/mscorlib/shared/System/Runtime/InteropServices/GuidAttribute.cs [new file with mode: 0644]
src/mscorlib/shared/System/Runtime/InteropServices/HandleRef.cs [moved from src/mscorlib/src/System/Runtime/InteropServices/HandleRef.cs with 69% similarity]
src/mscorlib/src/System/Runtime/InteropServices/Attributes.cs

index fcb499b..0729772 100644 (file)
     <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CriticalHandle.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\GcHandle.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\GCHandleCookieTable.cs" />
-    <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\HandleRef.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ICustomMarshaler.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\InvalidOleVariantTypeException.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Marshal.cs" />
index 90587d2..aaf6bfc 100644 (file)
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\DllImportSearchPath.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\ExternalException.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\FieldOffsetAttribute.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\GuidAttribute.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\HandleRef.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\InAttribute.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\LayoutKind.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\MarshalAsAttribute.cs" />
diff --git a/src/mscorlib/shared/System/Runtime/InteropServices/GuidAttribute.cs b/src/mscorlib/shared/System/Runtime/InteropServices/GuidAttribute.cs
new file mode 100644 (file)
index 0000000..cf60b9b
--- /dev/null
@@ -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; }
+    }
+}
@@ -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;
         }
     }
 }
index 4570da9..4141202 100644 (file)
@@ -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
     {