Remove dead code (dotnet/corefx#35405)
authorAlaa Masoud <alaa.masoud@live.com>
Tue, 19 Feb 2019 17:54:29 +0000 (20:54 +0300)
committerDan Moseley <danmose@microsoft.com>
Tue, 19 Feb 2019 17:54:29 +0000 (09:54 -0800)
Commit migrated from https://github.com/dotnet/corefx/commit/9ccba7612721c347c8373cd4d226b1ac1329a73f

16 files changed:
src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileShareMode.cs [deleted file]
src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/AdaptationHelpers.cs [deleted file]
src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNIProxy.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ConfigurationHandler.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/RejectedClaimChange.cs [deleted file]
src/libraries/System.DirectoryServices/src/Interop/AdsAuthentication.cs [deleted file]
src/libraries/System.DirectoryServices/src/Interop/AdsStatus.cs [deleted file]
src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj
src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/LocatorFlag.cs
src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj
src/libraries/System.Security.Cryptography.Xml/src/System.Security.Cryptography.Xml.csproj
src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/TransformInputType.cs [deleted file]
src/libraries/System.Transactions.Local/src/System/Transactions/TransactionsEtwProvider.cs

index 63485dd..1b6489c 100644 (file)
@@ -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 (file)
index aeefd42..0000000
+++ /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 (file)
index 3eb99dd..0000000
+++ /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<T> TryInvoke<T>(Func<T> action)
-        {
-            try
-            {
-                T value = action();
-                return new CompositionResult<T>(value);
-            }
-            catch (CompositionException ex)
-            {
-                return new CompositionResult<T>(ex.Errors);
-            }
-        }
-
-        internal static TValue GetValueFromAtomicComposition<TValue>(AtomicComposition atomicComposition, object key, TValue defaultResult)
-        {
-            TValue result;
-            if (atomicComposition != null && atomicComposition.TryGetValue(key, out result))
-            {
-                return result;
-            }
-
-            return defaultResult;
-        }
-    }
-}
index 4d732ca..6aa81ad 100644 (file)
@@ -14,7 +14,6 @@
     <Compile Include="TypeForwards.cs" />
   </ItemGroup>
   <ItemGroup Condition="'$(TargetGroup)' != 'netstandard'">
-    <Compile Include="Microsoft\Internal\AdaptationHelpers.cs" />
     <Compile Include="Microsoft\Internal\AttributeServices.cs" />
     <Compile Include="Microsoft\Internal\Collections\CollectionServices.cs" />
     <Compile Include="Microsoft\Internal\Collections\CollectionServices.CollectionOfObject.cs" />
index b61f623..9c77897 100644 (file)
@@ -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();
 
         /// <summary>
@@ -238,7 +231,7 @@ namespace System.Data.SqlClient.SNI
             {
                 result = handle.SendAsync(clonedPacket, true);
             }
-            
+
             return result;
         }
 
index 7d84f4a..c4c878b 100644 (file)
@@ -29,7 +29,6 @@
     <Compile Include="System\DirectoryServices\AccountManagement\PasswordInfo.cs" />
     <Compile Include="System\DirectoryServices\AccountManagement\MatchType.cs" />
     <Compile Include="System\DirectoryServices\AccountManagement\CredentialTypes.cs" />
-    <Compile Include="System\DirectoryServices\AccountManagement\RejectedClaimChange.cs" />
     <Compile Include="System\DirectoryServices\AccountManagement\ContextType.cs" />
     <Compile Include="System\DirectoryServices\AccountManagement\ContextOptions.cs" />
     <Compile Include="System\DirectoryServices\AccountManagement\SidType.cs" />
index 1cb2044..84551db 100644 (file)
@@ -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 (file)
index dc94585..0000000
+++ /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 (file)
index 7d5ee8f..0000000
+++ /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 (file)
index b82fe4e..0000000
+++ /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
-    }
-}
index 93fe402..d4477e6 100644 (file)
     <Compile Include="System\DirectoryServices\DirectoryServicesPermissionAttribute.cs" />
     <Compile Include="System\DirectoryServices\DirectoryServicesPermissionEntry.cs" />
     <Compile Include="System\DirectoryServices\DirectoryServicesPermissionEntryCollection.cs" />
-    <Compile Include="Interop\AdsAuthentication.cs" />
     <Compile Include="Interop\AdsOptions.cs" />
     <Compile Include="Interop\AdsPropertyOperation.cs" />
     <Compile Include="Interop\AdsSearchColumn.cs" />
     <Compile Include="Interop\AdsSearchPreferenceInfo.cs" />
     <Compile Include="Interop\AdsSearchPreferences.cs" />
     <Compile Include="Interop\AdsSortKey.cs" />
-    <Compile Include="Interop\AdsStatus.cs" />
     <Compile Include="Interop\AdsType.cs" />
     <Compile Include="Interop\AdsValue2.cs" />
     <Compile Include="Interop\AdsValueHelper2.cs" />
index 5a60b06..0f58e77 100644 (file)
@@ -31,11 +31,4 @@ namespace System.DirectoryServices.ActiveDirectory
         ReturnDNSName = 0x40000000,
         ReturnFlatName = 0x80000000
     }
-
-    [Flags]
-    internal enum DcEnumFlag : int
-    {
-        OnlyDoSiteName = 0x01,
-        NotifyAfterSiteRecords = 0x02
-    }
 }
index c8c08a0..15d562b 100644 (file)
@@ -71,9 +71,6 @@
     <Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.FileOperations.cs">
       <Link>Common\Interop\Windows\Interop.FileOperations.cs</Link>
     </Compile>
-    <Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.FileShareMode.cs">
-      <Link>Common\Interop\Windows\Interop.FileShareMode.cs</Link>
-    </Compile>
     <Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.FlushViewOfFile.cs">
       <Link>Common\Interop\Windows\Interop.FlushViewOfFile.cs</Link>
     </Compile>
index 642c4b7..bd215e8 100644 (file)
@@ -66,7 +66,6 @@
     <Compile Include="System\Security\Cryptography\Xml\SymmetricKeyWrap.cs" />
     <Compile Include="System\Security\Cryptography\Xml\Transform.cs" />
     <Compile Include="System\Security\Cryptography\Xml\TransformChain.cs" />
-    <Compile Include="System\Security\Cryptography\Xml\TransformInputType.cs" />
     <Compile Include="System\Security\Cryptography\Xml\Utils.cs" />
     <Compile Include="System\Security\Cryptography\Xml\XmlDecryptionTransform.cs" />
     <Compile Include="System\Security\Cryptography\Xml\XmlDsigBase64Transform.cs" />
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 (file)
index d9d58ab..0000000
+++ /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
-    }
-}
index 5b04e20..46e2b93 100644 (file)
@@ -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,