From 4b9c387857d9dbc9f1fe0bdb046b57c3a4499be6 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Mon, 5 Mar 2018 19:32:00 -0800 Subject: Port changes in non-shared CoreLib partition --- .../Windows/mincore/Interop.CoCreateGuid.cs | 15 ----------- .../src/System.Private.CoreLib.csproj | 5 ---- src/System.Private.CoreLib/src/System/Guid.Unix.cs | 24 ----------------- .../src/System/Guid.Windows.cs | 31 ---------------------- 4 files changed, 75 deletions(-) delete mode 100644 src/Common/src/Interop/Windows/mincore/Interop.CoCreateGuid.cs delete mode 100644 src/System.Private.CoreLib/src/System/Guid.Unix.cs delete mode 100644 src/System.Private.CoreLib/src/System/Guid.Windows.cs (limited to 'src') diff --git a/src/Common/src/Interop/Windows/mincore/Interop.CoCreateGuid.cs b/src/Common/src/Interop/Windows/mincore/Interop.CoCreateGuid.cs deleted file mode 100644 index ac3bad582..000000000 --- a/src/Common/src/Interop/Windows/mincore/Interop.CoCreateGuid.cs +++ /dev/null @@ -1,15 +0,0 @@ -// 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. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class mincore - { - [DllImport("api-ms-win-core-com-l1-1-0.dll")] - internal extern static int CoCreateGuid(out Guid pguid); - } -} diff --git a/src/System.Private.CoreLib/src/System.Private.CoreLib.csproj b/src/System.Private.CoreLib/src/System.Private.CoreLib.csproj index 9f041c462..58f19377e 100644 --- a/src/System.Private.CoreLib/src/System.Private.CoreLib.csproj +++ b/src/System.Private.CoreLib/src/System.Private.CoreLib.csproj @@ -223,8 +223,6 @@ - - @@ -530,9 +528,6 @@ Interop\Windows\mincore\Interop.GetSystemDirectory.cs - - Interop\Windows\mincore\Interop.CoCreateGuid.cs - Interop\Windows\mincore\Interop.QueryUnbiasedInterruptTime.cs diff --git a/src/System.Private.CoreLib/src/System/Guid.Unix.cs b/src/System.Private.CoreLib/src/System/Guid.Unix.cs deleted file mode 100644 index 326362d04..000000000 --- a/src/System.Private.CoreLib/src/System/Guid.Unix.cs +++ /dev/null @@ -1,24 +0,0 @@ -// 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. - -using System.Diagnostics; -using System.Runtime.InteropServices; - -namespace System -{ - partial struct Guid - { - // This will create a new guid. Since we've now decided that constructors should 0-init, - // we need a method that allows users to create a guid. - public static Guid NewGuid() - { - // CoCreateGuid should never return Guid.Empty, since it attempts to maintain some - // uniqueness guarantees. It should also never return a known GUID, but it's unclear - // how extensively it checks for known values. - - Interop.Sys.CreateGuid(out Guid g); - return g; - } - } -} diff --git a/src/System.Private.CoreLib/src/System/Guid.Windows.cs b/src/System.Private.CoreLib/src/System/Guid.Windows.cs deleted file mode 100644 index f21dfbd6b..000000000 --- a/src/System.Private.CoreLib/src/System/Guid.Windows.cs +++ /dev/null @@ -1,31 +0,0 @@ -// 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 -{ - partial struct Guid - { - // This will create a new guid. Since we've now decided that constructors should 0-init, - // we need a method that allows users to create a guid. - public static Guid NewGuid() - { - // CoCreateGuid should never return Guid.Empty, since it attempts to maintain some - // uniqueness guarantees. It should also never return a known GUID, but it's unclear - // how extensively it checks for known values. - - Guid g; - int hr = Interop.mincore.CoCreateGuid(out g); - // We don't expect that this will ever throw an error, none are even documented, and so we don't want to pull - // in the HR to ComException mappings into the core library just for this so we will try a generic exception if - // we ever hit this condition. - if (hr != 0) - { - Exception ex = new Exception(); - ex.SetErrorCode(hr); - throw ex; - } - return g; - } - } -} -- cgit v1.2.3