Remove obsolete Registry.DynData field from System.Private.CoreLib (#5724)
authorJustin Van Patten <jvp@justinvp.com>
Sat, 11 Jun 2016 13:06:22 +0000 (06:06 -0700)
committerJan Kotas <jkotas@microsoft.com>
Sat, 11 Jun 2016 13:06:22 +0000 (06:06 -0700)
Registry is internal in System.Private.CoreLib due to being pulled-in
by the dependency closure. The obsolete DynData field is only valid
on Win9X, so there's no need to allocate it and keep it around in
CoreCLR. Remove it from System.Private.CoreLib with an ifdef, along
with other references to the HKEY_DYN_DATA hive.

src/mscorlib/src/Microsoft/Win32/Registry.cs
src/mscorlib/src/Microsoft/Win32/RegistryKey.cs

index d1be7db9f1e5c14449ca15c84b6296371c2c9d3b..4faf29da7f1f7e3a19714478421dd60377f21a0d 100644 (file)
@@ -64,6 +64,7 @@ namespace Microsoft.Win32 {
          */
         public static readonly RegistryKey CurrentConfig      = RegistryKey.GetBaseKey(RegistryKey.HKEY_CURRENT_CONFIG);
         
+#if !FEATURE_CORECLR
         /**
          * Dynamic Data Root Key.
          * 
@@ -72,6 +73,7 @@ namespace Microsoft.Win32 {
          */
         [Obsolete("The DynData registry key only works on Win9x, which is no longer supported by the CLR.  On NT-based operating systems, use the PerformanceData registry key instead.")]
         public static readonly RegistryKey DynData            = RegistryKey.GetBaseKey(RegistryKey.HKEY_DYN_DATA);
+#endif
 
         //
         // Following function will parse a keyName and returns the basekey for it.
@@ -114,9 +116,11 @@ namespace Microsoft.Win32 {
                 case "HKEY_CURRENT_CONFIG": 
                     basekey = Registry.CurrentConfig;
                     break;
+#if !FEATURE_CORECLR
                 case "HKEY_DYN_DATA": 
                     basekey = RegistryKey.GetBaseKey(RegistryKey.HKEY_DYN_DATA);
                     break;                    
+#endif
                 default:
                     throw new ArgumentException(Environment.GetResourceString("Arg_RegInvalidKeyName", "keyName"));
             }            
index 2ef1bb25b1cc371fa865260ac765404827dcba3a..dcf31dc60c37c10022cf93e2b26061d9b750a72c 100644 (file)
@@ -83,7 +83,9 @@ namespace Microsoft.Win32 {
         Users = unchecked((int)0x80000003),
         PerformanceData = unchecked((int)0x80000004),
         CurrentConfig = unchecked((int)0x80000005),
+#if !FEATURE_CORECLR
         DynData = unchecked((int)0x80000006),
+#endif
     }
 
     /**
@@ -110,7 +112,9 @@ namespace Microsoft.Win32 {
         internal static readonly IntPtr HKEY_USERS                = new IntPtr(unchecked((int)0x80000003));
         internal static readonly IntPtr HKEY_PERFORMANCE_DATA     = new IntPtr(unchecked((int)0x80000004));
         internal static readonly IntPtr HKEY_CURRENT_CONFIG       = new IntPtr(unchecked((int)0x80000005));
+#if !FEATURE_CORECLR
         internal static readonly IntPtr HKEY_DYN_DATA             = new IntPtr(unchecked((int)0x80000006));
+#endif
 
         // Dirty indicates that we have munged data that should be potentially
         // written to disk.
@@ -138,7 +142,9 @@ namespace Microsoft.Win32 {
                 "HKEY_USERS",
                 "HKEY_PERFORMANCE_DATA",
                 "HKEY_CURRENT_CONFIG",
+#if !FEATURE_CORECLR
                 "HKEY_DYN_DATA"
+#endif
                 };
 
         // MSDN defines the following limits for registry key names & values: