From: Alaa Masoud Date: Tue, 19 Feb 2019 17:54:29 +0000 (+0300) Subject: Remove dead code (dotnet/corefx#35405) X-Git-Tag: submit/tizen/20210909.063632~11031^2~2411 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98668c43baeb577bab20333da3b4cefe8c56c0b3;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Remove dead code (dotnet/corefx#35405) Commit migrated from https://github.com/dotnet/corefx/commit/9ccba7612721c347c8373cd4d226b1ac1329a73f --- diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs index 63485dd..1b6489c 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs @@ -192,11 +192,6 @@ namespace Internal.NativeCrypto } } - private static class BCryptGetPropertyStrings - { - public const string BCRYPT_HASH_LENGTH = "HashDigestLength"; - } - private static Exception CreateCryptographicException(NTSTATUS ntStatus) { int hr = ((int)ntStatus) | 0x01000000; @@ -227,7 +222,7 @@ namespace Internal.NativeCrypto public static extern NTSTATUS BCryptImportKey(SafeAlgorithmHandle hAlgorithm, IntPtr hImportKey, string pszBlobType, out SafeKeyHandle hKey, IntPtr pbKeyObject, int cbKeyObject, byte[] pbInput, int cbInput, int dwFlags); [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] - public static extern unsafe NTSTATUS BCryptEncrypt(SafeKeyHandle hKey, byte* pbInput, int cbInput, IntPtr paddingInfo, [In,Out] byte [] pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags); + public static extern unsafe NTSTATUS BCryptEncrypt(SafeKeyHandle hKey, byte* pbInput, int cbInput, IntPtr paddingInfo, [In, Out] byte[] pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags); [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] public static extern unsafe NTSTATUS BCryptDecrypt(SafeKeyHandle hKey, byte* pbInput, int cbInput, IntPtr paddingInfo, [In, Out] byte[] pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileShareMode.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileShareMode.cs deleted file mode 100644 index aeefd42..0000000 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileShareMode.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. - -internal partial class Interop -{ - internal partial class Kernel32 - { - internal partial class FileShareMode - { - internal const int FILE_SHARE_READ = 0x00000001; - internal const int FILE_SHARE_WRITE = 0x00000002; - } - } -} diff --git a/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/AdaptationHelpers.cs b/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/AdaptationHelpers.cs deleted file mode 100644 index 3eb99dd..0000000 --- a/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/AdaptationHelpers.cs +++ /dev/null @@ -1,50 +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.ComponentModel.Composition; -using System.ComponentModel.Composition.Hosting; - -namespace Microsoft.Internal -{ - internal static class AdaptationHelpers - { - internal static CompositionResult TryInvoke(Action action) - { - try - { - action(); - return CompositionResult.SucceededResult; - } - catch (CompositionException ex) - { - return new CompositionResult(ex.Errors); - } - } - - internal static CompositionResult TryInvoke(Func action) - { - try - { - T value = action(); - return new CompositionResult(value); - } - catch (CompositionException ex) - { - return new CompositionResult(ex.Errors); - } - } - - internal static TValue GetValueFromAtomicComposition(AtomicComposition atomicComposition, object key, TValue defaultResult) - { - TValue result; - if (atomicComposition != null && atomicComposition.TryGetValue(key, out result)) - { - return result; - } - - return defaultResult; - } - } -} diff --git a/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj b/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj index 4d732ca..6aa81ad 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj +++ b/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj @@ -14,7 +14,6 @@ - diff --git a/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNIProxy.cs b/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNIProxy.cs index b61f623..9c77897 100644 --- a/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNIProxy.cs +++ b/src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNIProxy.cs @@ -24,13 +24,6 @@ namespace System.Data.SqlClient.SNI private const int DefaultSqlServerDacPort = 1434; private const string SqlServerSpnHeader = "MSSQLSvc"; - internal class SspiClientContextResult - { - internal const uint OK = 0; - internal const uint Failed = 1; - internal const uint KerberosTicketMissing = 2; - } - public static readonly SNIProxy Singleton = new SNIProxy(); /// @@ -238,7 +231,7 @@ namespace System.Data.SqlClient.SNI { result = handle.SendAsync(clonedPacket, true); } - + return result; } diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj b/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj index 7d84f4a..c4c878b 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj @@ -29,7 +29,6 @@ - diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ConfigurationHandler.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ConfigurationHandler.cs index 1cb2044..84551db 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ConfigurationHandler.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ConfigurationHandler.cs @@ -11,100 +11,6 @@ using System.Globalization; namespace System.DirectoryServices.AccountManagement { - internal class ConfigurationHandler : IConfigurationSectionHandler - { - public virtual object Create(object parent, object configContext, XmlNode section) - { - ConfigSettings configSettings = null; - bool foundDebugging = false; - System.Enum debugLevelEnum = (System.Enum)GlobalConfig.DefaultDebugLevel; - string debugLogFile = null; - - foreach (XmlNode child in section.ChildNodes) - { - switch (child.Name) - { -#if DEBUG - case "Debugging": - if (foundDebugging) - throw new ConfigurationErrorsException( - String.Format( - CultureInfo.CurrentCulture, - SR.ConfigHandlerConfigSectionsUnique, - "Debugging")); - - RemoveEnumAttribute(child, "Debugging", "debugLevel", typeof(DebugLevel), ref debugLevelEnum); - RemoveStringAttribute(child, "Debugging", "debugLogFile", out debugLogFile); - - foundDebugging = true; - break; -#endif - - default: - throw new ConfigurationErrorsException( - string.Format( - CultureInfo.CurrentCulture, - SR.ConfigHandlerUnknownConfigSection, - child.Name)); - } - } - - if (foundDebugging) - configSettings = new ConfigSettings((DebugLevel)debugLevelEnum, debugLogFile); - else - configSettings = new ConfigSettings(); - - // We need to always return an object so if we haven't read the debug section just create a default object. - return (configSettings); - } - -#if DEBUG - private void RemoveEnumAttribute(XmlNode node, string sectionName, string attributeName, Type enumType, ref System.Enum value) - { - XmlNode attribute = node.Attributes.RemoveNamedItem(attributeName); - if (null != attribute) - { - try - { - // case-insensitive, for ease of use - value = (System.Enum)System.Enum.Parse(enumType, attribute.Value, true); - } - catch (ArgumentException) - { - throw new ConfigurationErrorsException( - String.Format( - CultureInfo.CurrentCulture, - SR.ConfigHandlerInvalidEnumAttribute, - attributeName, - sectionName)); - } - } - } - - private void RemoveStringAttribute(XmlNode node, string sectionName, string attributeName, out string value) - { - value = null; - XmlNode attribute = node.Attributes.RemoveNamedItem(attributeName); - if (null != attribute) - { - value = attribute.Value as string; - - if (value == null) - throw new ConfigurationErrorsException( - String.Format( - CultureInfo.CurrentCulture, - SR.ConfigHandlerInvalidStringAttribute, - attributeName, - sectionName)); - - // Treat empty string the same as no string - if (value.Length == 0) - value = null; - } - } -#endif - } - internal class ConfigSettings { public ConfigSettings(DebugLevel debugLevel, string debugLogFile) diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/RejectedClaimChange.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/RejectedClaimChange.cs deleted file mode 100644 index dc94585..0000000 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/RejectedClaimChange.cs +++ /dev/null @@ -1,17 +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; - -namespace System.DirectoryServices.AccountManagement -{ - internal enum RejectedClaimChange - { - Allowed = 0, // change allowed - TimeRangeNotAllowed = 1, // change rejected: store doesn't support time-limited claims - DuplicateTypeNotAllowed = 2, // change rejected: store doesn't allow multiple of this type of claim - TypeNotAllowed = 3, // change rejected: store doesn't support claims of this type - NotAllowed = 4 // change rejected: other reason (e.g., removal of a mandatory claim) - } -} diff --git a/src/libraries/System.DirectoryServices/src/Interop/AdsAuthentication.cs b/src/libraries/System.DirectoryServices/src/Interop/AdsAuthentication.cs deleted file mode 100644 index 7d5ee8f..0000000 --- a/src/libraries/System.DirectoryServices/src/Interop/AdsAuthentication.cs +++ /dev/null @@ -1,19 +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.DirectoryServices.Interop -{ - internal enum AdsAuthentication - { - ADS_SECURE_AUTHENTICATION = 0x1, - ADS_USE_ENCRYPTION = 0x2, - ADS_USE_SSL = 0x2, - ADS_READONLY_SERVER = 0x4, - ADS_PROMPT_CREDENTIALS = 0x8, - ADS_NO_AUTHENTICATION = 0x10, - ADS_FAST_BIND = 0x20, - ADS_USE_SIGNING = 0x40, - ADS_USE_SEALING = 0x80 - } -} diff --git a/src/libraries/System.DirectoryServices/src/Interop/AdsStatus.cs b/src/libraries/System.DirectoryServices/src/Interop/AdsStatus.cs deleted file mode 100644 index b82fe4e..0000000 --- a/src/libraries/System.DirectoryServices/src/Interop/AdsStatus.cs +++ /dev/null @@ -1,13 +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.DirectoryServices.Interop -{ - internal enum AdsStatusEnum - { - ADS_STATUS_S_OK = 0, - ADS_STATUS_INVALID_SEARCHPREF = 1, - ADS_STATUS_INVALID_SEARCHPREFVALUE = 2 - } -} diff --git a/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj b/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj index 93fe402..d4477e6 100644 --- a/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj +++ b/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj @@ -124,14 +124,12 @@ - - diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/LocatorFlag.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/LocatorFlag.cs index 5a60b06..0f58e77 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/LocatorFlag.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/LocatorFlag.cs @@ -31,11 +31,4 @@ namespace System.DirectoryServices.ActiveDirectory ReturnDNSName = 0x40000000, ReturnFlatName = 0x80000000 } - - [Flags] - internal enum DcEnumFlag : int - { - OnlyDoSiteName = 0x01, - NotifyAfterSiteRecords = 0x02 - } } diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj b/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj index c8c08a0..15d562b 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj @@ -71,9 +71,6 @@ Common\Interop\Windows\Interop.FileOperations.cs - - Common\Interop\Windows\Interop.FileShareMode.cs - Common\Interop\Windows\Interop.FlushViewOfFile.cs diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System.Security.Cryptography.Xml.csproj b/src/libraries/System.Security.Cryptography.Xml/src/System.Security.Cryptography.Xml.csproj index 642c4b7..bd215e8 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System.Security.Cryptography.Xml.csproj +++ b/src/libraries/System.Security.Cryptography.Xml/src/System.Security.Cryptography.Xml.csproj @@ -66,7 +66,6 @@ - diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/TransformInputType.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/TransformInputType.cs deleted file mode 100644 index d9d58ab..0000000 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/TransformInputType.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; - -namespace System.Security.Cryptography.Xml -{ - internal enum TransformInputType - { - XmlDocument = 1, - XmlStream = 2, - XmlNodeSet = 3 - } -} diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionsEtwProvider.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionsEtwProvider.cs index 5b04e20..46e2b93 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionsEtwProvider.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionsEtwProvider.cs @@ -34,15 +34,6 @@ namespace System.Transactions Promote = 5 } - internal enum EnlistmentCallback - { - Done = 0, - Prepared = 1, - ForceRollback = 2, - Committed = 3, - Aborted = 4, - InDoubt = 5 - } internal enum TransactionScopeResult { CreatedTransaction = 0,