328 references to RegistryKey
dotnet (39)
Commands\Workload\Install\MsiInstallerBase.cs (6)
123using RegistryKey hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); 127using RegistryKey hostKey = hklm.OpenSubKey($@"SOFTWARE\dotnet\Setup\InstalledVersions\{HostArchitecture}"); 468using RegistryKey hklm32 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); 475using RegistryKey installedSdkVersionsKey = hklm32.OpenSubKey(@$"SOFTWARE\dotnet\Setup\InstalledVersions\{HostArchitecture}\sdk");
Commands\Workload\Install\NetSdkMsiInstallerClient.InstallRecords.cs (14)
26using RegistryKey installedManifestsKey = Registry.LocalMachine.OpenSubKey(@$"SOFTWARE\Microsoft\dotnet\InstalledWorkloadSets\{HostArchitecture}"); 31using RegistryKey workloadSetFeatureBandKey = installedManifestsKey.OpenSubKey(workloadSetFeatureBand); 34using RegistryKey workloadSetPackageVersionKey = workloadSetFeatureBandKey.OpenSubKey(workloadSetPackageVersion); 89using RegistryKey installedManifestsKey = Registry.LocalMachine.OpenSubKey(@$"SOFTWARE\Microsoft\dotnet\InstalledManifests\{HostArchitecture}"); 106using RegistryKey manifestKey = installedManifestsKey.OpenSubKey(manifestPackageId); 109using RegistryKey manifestVersionKey = manifestKey.OpenSubKey(manifestVersion); 306using RegistryKey installedPacksKey = Registry.LocalMachine.OpenSubKey(@$"SOFTWARE\Microsoft\dotnet\InstalledPacks\{HostArchitecture}"); 308static void SetRecordMsiProperties(WorkloadPackRecord record, RegistryKey key) 320using RegistryKey packKey = installedPacksKey.OpenSubKey(packId); 324using RegistryKey packVersionKey = packKey.OpenSubKey(packVersion); 345using RegistryKey installedPackGroupsKey = Registry.LocalMachine.OpenSubKey(@$"SOFTWARE\Microsoft\dotnet\InstalledPackGroups\{HostArchitecture}"); 350using RegistryKey packGroupKey = installedPackGroupsKey.OpenSubKey(packGroupId); 353using RegistryKey packGroupVersionKey = packGroupKey.OpenSubKey(packGroupVersion); 367using RegistryKey packIdKey = packGroupVersionKey.OpenSubKey(packId);
Commands\Workload\Install\WorkloadInstallRecords\RegistryWorkloadInstallationRecordRepository.cs (6)
30private readonly RegistryKey _baseKey = Registry.LocalMachine; 43RegistryKey baseKey, string basePath) 70using RegistryKey key = _baseKey.OpenSubKey(BasePath); 83using RegistryKey wrk = _baseKey.OpenSubKey(Path.Combine(BasePath, $"{sdkFeatureBand}")); 88private static IEnumerable<WorkloadId> GetWorkloadInstallationRecordsFromRegistry(RegistryKey sdkFeatureBandWorkloadRegistry) 102using RegistryKey workloadRecordKey = _baseKey.CreateSubKey(subkeyName);
Commands\Workload\SignCheck.cs (2)
54using RegistryKey policyKey = Registry.LocalMachine.OpenSubKey(s_WorkloadPolicyKey); 70using RegistryKey policyKey = Registry.LocalMachine.OpenSubKey(s_WorkloadPolicyKey);
Installer\Windows\WindowsUtils.cs (5)
63using RegistryKey localMachineKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64); 64using RegistryKey auKey = localMachineKey?.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired"); 65using RegistryKey cbsKey = localMachineKey?.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending"); 66using RegistryKey sessionKey = localMachineKey?.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Session Manager");
Telemetry\DevDeviceIDGetter.cs (5)
44using (var key = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64).OpenSubKey(@"SOFTWARE\Microsoft\DeveloperTools")) 86using (RegistryKey baseKey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64)) 88using(var key = baseKey.CreateSubKey(@"SOFTWARE\Microsoft\DeveloperTools"))
Telemetry\DockerContainerDetectorForTelemetry.cs (1)
19using (RegistryKey subkey
finalizer (8)
Program.cs (8)
72using (RegistryKey? key = Registry.LocalMachine.OpenSubKey(registryPath)) 110using var hkInstallerDependenciesKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Classes\Installer\Dependencies", writable: true); 122using var hkProviderKey = hkInstallerDependenciesKey.OpenSubKey(providerKeyName, writable: true); 129using var hkDependentsKey = hkProviderKey.OpenSubKey("Dependents", writable: true); 226using (RegistryKey? key = Registry.LocalMachine.OpenSubKey(workloadKey, writable: true)) 242static void DeleteEmptyKeyToRoot(RegistryKey key, string name) 249using (RegistryKey? k = key.OpenSubKey(tempName)) 259using (RegistryKey? parentKey = key.OpenSubKey(tempName, writable: true))
IIS.FunctionalTests (5)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (1)
101var iisRegistryKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\InetStp", writable: false);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\TestRegistryKey.cs (3)
11private readonly RegistryKey _baseHive; 12private readonly RegistryKey _subKey; 15public TestRegistryKey(RegistryKey baseHive, string keyName, string valueName, object value)
src\Shared\TransportTestHelpers\HttpSysHttp3SupportedAttribute.cs (1)
28using var key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\services\HTTP\Parameters");
IIS.LongTests (6)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (1)
101var iisRegistryKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\InetStp", writable: false);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\TestRegistryKey.cs (3)
11private readonly RegistryKey _baseHive; 12private readonly RegistryKey _subKey; 15public TestRegistryKey(RegistryKey baseHive, string keyName, string valueName, object value)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
139using (var localMachine = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32))
IIS.NewHandler.FunctionalTests (6)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (1)
101var iisRegistryKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\InetStp", writable: false);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\TestRegistryKey.cs (3)
11private readonly RegistryKey _baseHive; 12private readonly RegistryKey _subKey; 15public TestRegistryKey(RegistryKey baseHive, string keyName, string valueName, object value)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
139using (var localMachine = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32))
IIS.NewShim.FunctionalTests (6)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (1)
101var iisRegistryKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\InetStp", writable: false);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\TestRegistryKey.cs (3)
11private readonly RegistryKey _baseHive; 12private readonly RegistryKey _subKey; 15public TestRegistryKey(RegistryKey baseHive, string keyName, string valueName, object value)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
139using (var localMachine = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32))
IIS.ShadowCopy.Tests (4)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (1)
101var iisRegistryKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\InetStp", writable: false);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\TestRegistryKey.cs (3)
11private readonly RegistryKey _baseHive; 12private readonly RegistryKey _subKey; 15public TestRegistryKey(RegistryKey baseHive, string keyName, string valueName, object value)
IISExpress.FunctionalTests (5)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\TestRegistryKey.cs (3)
11private readonly RegistryKey _baseHive; 12private readonly RegistryKey _subKey; 15public TestRegistryKey(RegistryKey baseHive, string keyName, string valueName, object value)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
139using (var localMachine = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32))
Microsoft.AspNetCore.DataProtection (23)
DataProtectionBuilderExtensions.cs (1)
192public static IDataProtectionBuilder PersistKeysToRegistry(this IDataProtectionBuilder builder, RegistryKey registryKey)
KeyManagement\XmlKeyManager.cs (1)
690RegistryKey? regKeyStorageKey = null;
LoggingExtensions.cs (3)
158public static partial void ReadingDataFromRegistryKeyValue(this ILogger logger, RegistryKey registryKeyName, string value); 266public static partial void RemovingDataFromRegistryKeyValue(this ILogger logger, RegistryKey registryKeyName, string value); 269public static partial void FailedToRemoveDataFromRegistryKeyValue(this ILogger logger, RegistryKey registryKeyName, string valueName, Exception exception);
RegistryPolicyResolver.cs (8)
25private readonly Func<RegistryKey?> _getPolicyRegKey; 34internal RegistryPolicyResolver(RegistryKey policyRegKey, IActivator activator) 40private static List<string> ReadKeyEscrowSinks(RegistryKey key) 65using (var registryKey = _getPolicyRegKey()) 71private RegistryPolicy? ResolvePolicyCore(RegistryKey? policyRegKey) 114private static CngCbcAuthenticatedEncryptorConfiguration GetCngCbcAuthenticatedEncryptorConfiguration(RegistryKey key) 150private static CngGcmAuthenticatedEncryptorConfiguration GetCngGcmAuthenticatedEncryptorConfiguration(RegistryKey key) 174private static ManagedAuthenticatedEncryptorConfiguration GetManagedAuthenticatedEncryptorConfiguration(RegistryKey key)
Repositories\RegistryXmlRepository.cs (10)
23private static readonly Lazy<RegistryKey?> _defaultRegistryKeyLazy = new Lazy<RegistryKey?>(GetDefaultHklmStorageKey); 32public RegistryXmlRepository(RegistryKey registryKey, ILoggerFactory loggerFactory) 48public static RegistryKey? DefaultRegistryKey => _defaultRegistryKeyLazy.Value; 53public RegistryKey RegistryKey { get; } 80private static RegistryKey? GetDefaultHklmStorageKey() 86using (var hklmBaseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, registryView)) 96var aspnetBaseKey = hklmBaseKey.OpenSubKey(aspnetAutoGenKeysBaseKeyName, writable: true); 127private XElement? ReadElementFromRegKey(RegistryKey regKey, string valueName)
Microsoft.AspNetCore.DataProtection.Tests (13)
Internal\KeyManagementOptionsSetupTest.cs (4)
99private static void WithUniqueTempRegKey(Action<RegistryKey> testCode) 102var uniqueSubkey = LazyHkcuTempKey.Value.CreateSubKey(uniqueName); 114private static readonly Lazy<RegistryKey> LazyHkcuTempKey = new Lazy<RegistryKey>(() =>
RegistryPolicyResolverTests.cs (4)
271private static RegistryPolicy WithUniqueTempRegKey(Func<RegistryKey, RegistryPolicy> testCode) 274var uniqueSubkey = LazyHkcuTempKey.Value.CreateSubKey(uniqueName); 286private static readonly Lazy<RegistryKey> LazyHkcuTempKey = new Lazy<RegistryKey>(() =>
Repositories\RegistryXmlRepositoryTests.cs (5)
25var retVal = repository.RegistryKey; 222private static void WithUniqueTempRegKey(Action<RegistryKey> testCode) 225var uniqueSubkey = LazyHkcuTempKey.Value.CreateSubKey(uniqueName); 237private static readonly Lazy<RegistryKey> LazyHkcuTempKey = new Lazy<RegistryKey>(() =>
Microsoft.AspNetCore.InternalTesting.Tests (4)
MaximumOSVersionTest.cs (2)
42var versionKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion"); 55var versionKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
MinimumOSVersionTest.cs (2)
41var versionKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion"); 54var versionKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
src\Shared\TransportTestHelpers\HttpSysHttp3SupportedAttribute.cs (1)
28using var key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\services\HTTP\Parameters");
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
src\SignalR\common\Shared\TestCertificates.cs (1)
18var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
Microsoft.Build (10)
Evaluation\IntrinsicFunctions.cs (10)
304using (RegistryKey key = GetBaseKeyFromKeyName(keyName, view, out string subKeyName)) 308using (RegistryKey subKey = key.OpenSubKey(subKeyName, false)) 770private static RegistryKey GetBaseKeyFromKeyName(string keyName, RegistryView view, out string subKeyName) 788RegistryKey basekey = null; 793basekey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, view); 796basekey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, view); 799basekey = RegistryKey.OpenBaseKey(RegistryHive.ClassesRoot, view); 802basekey = RegistryKey.OpenBaseKey(RegistryHive.Users, view); 805basekey = RegistryKey.OpenBaseKey(RegistryHive.PerformanceData, view); 808basekey = RegistryKey.OpenBaseKey(RegistryHive.CurrentConfig, view);
Microsoft.Build.CommandLine.UnitTests (10)
RegistryDelegates.cs (3)
12internal delegate RegistryKey OpenBaseKey(RegistryHive hive, RegistryView view); 21internal delegate IEnumerable<string> GetRegistrySubKeyNames(RegistryKey baseKey, string subKey); 30internal delegate string GetRegistrySubKeyDefaultValue(RegistryKey baseKey, string subKey);
RegistryHelper.cs (7)
22internal static IEnumerable<string>? GetSubKeyNames(RegistryKey baseKey, string subkey) 26using (RegistryKey? subKey = baseKey.OpenSubKey(subkey)) 43internal static string? GetDefaultValue(RegistryKey baseKey, string subkey) 47using (RegistryKey? key = baseKey.OpenSubKey(subkey)) 65internal static RegistryKey OpenBaseKey(RegistryHive hive, RegistryView view) 67RegistryKey key = RegistryKey.OpenBaseKey(hive, view);
Microsoft.Build.Engine.UnitTests (10)
Evaluation\Expander_Tests.cs (10)
1795RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); 1817RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); 1842RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); 1865RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); 1887RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); 1909RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); 3820RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); 3844RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); 3868RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); 3892RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test");
Microsoft.Build.Framework (3)
EncodingUtilities.cs (1)
302using RegistryKey? windowsVersionRegistry = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
NativeMethods.cs (2)
648using (RegistryKey fileSystemKey = Registry.LocalMachine.OpenSubKey(WINDOWS_FILE_SYSTEM_REGISTRY_KEY)) 701using (RegistryKey policyKey = Registry.LocalMachine.OpenSubKey(WINDOWS_SAC_REGISTRY_KEY))
Microsoft.Build.Tasks.Core (33)
AssemblyFoldersEx.cs (3)
153using (RegistryKey baseKey = openBaseKey(hive, view)) 233using (RegistryKey keyPlatform = baseKey.OpenSubKey(directoryKey.RegistryKey, false)) 291private bool IsVersionInsideRange(Version v, RegistryKey keyPlatform)
BootstrapperUtil\Util.cs (4)
173RegistryKey bootstrapperBaseRegKey = Registry.LocalMachine.OpenSubKey(BOOTSTRAPPER_REGISTRY_PATH_BASE); 181RegistryKey additionalPackagePathsRegKey = bootstrapperBaseRegKey.OpenSubKey(BOOTSTRAPPER_REGISTRY_ADDITIONAL_PACKAGE_PATHS_KEYNAME); 215private static string ReadRegistryString(RegistryKey key, string path, string registryValue) 217RegistryKey subKey = key.OpenSubKey(path, false);
ManifestUtil\ComImporter.cs (12)
146private void CheckForUnknownSubKeys(RegistryKey key) 151private void CheckForUnknownSubKeys(RegistryKey key, string[] knownNames) 165private void CheckForUnknownValues(RegistryKey key) 170private void CheckForUnknownValues(RegistryKey key, string[] knownNames) 191using (RegistryKey userKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\CLASSES\\CLSID")) 199using (RegistryKey machineKey = Registry.ClassesRoot.OpenSubKey("CLSID")) 210using (RegistryKey classesRootKey = RegistryKey.OpenBaseKey(RegistryHive.ClassesRoot, RegistryView.Registry32)) 212using (RegistryKey clsidKey = classesRootKey.OpenSubKey("CLSID")) 225private bool GetRegisteredClassInfo(RegistryKey rootKey, Guid clsid, ref ClassInfo info) 233RegistryKey classKey = rootKey.OpenSubKey(sclsid); 247RegistryKey subKey = classKey.OpenSubKey(subKeyName);
ManifestUtil\SecurityUtil.cs (3)
929using (RegistryKey localMachineKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32)) 931using (RegistryKey versionIndependentToolKey = localMachineKey.OpenSubKey(versionIndependentToolKeyName, writable: false))
ManifestUtil\Util.cs (1)
280RegistryKey key = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", false);
RegistryDelegates.cs (3)
12internal delegate RegistryKey OpenBaseKey(RegistryHive hive, RegistryView view); 21internal delegate IEnumerable<string> GetRegistrySubKeyNames(RegistryKey baseKey, string subKey); 30internal delegate string GetRegistrySubKeyDefaultValue(RegistryKey baseKey, string subKey);
RegistryHelper.cs (7)
22internal static IEnumerable<string>? GetSubKeyNames(RegistryKey baseKey, string subkey) 26using (RegistryKey? subKey = baseKey.OpenSubKey(subkey)) 43internal static string? GetDefaultValue(RegistryKey baseKey, string subkey) 47using (RegistryKey? key = baseKey.OpenSubKey(subkey)) 65internal static RegistryKey OpenBaseKey(RegistryHive hive, RegistryView view) 67RegistryKey key = RegistryKey.OpenBaseKey(hive, view);
Microsoft.Build.Utilities.Core (15)
AssemblyFoldersEx.cs (3)
153using (RegistryKey baseKey = openBaseKey(hive, view)) 233using (RegistryKey keyPlatform = baseKey.OpenSubKey(directoryKey.RegistryKey, false)) 291private bool IsVersionInsideRange(Version v, RegistryKey keyPlatform)
RegistryDelegates.cs (3)
12internal delegate RegistryKey OpenBaseKey(RegistryHive hive, RegistryView view); 21internal delegate IEnumerable<string> GetRegistrySubKeyNames(RegistryKey baseKey, string subKey); 30internal delegate string GetRegistrySubKeyDefaultValue(RegistryKey baseKey, string subKey);
RegistryHelper.cs (7)
22internal static IEnumerable<string>? GetSubKeyNames(RegistryKey baseKey, string subkey) 26using (RegistryKey? subKey = baseKey.OpenSubKey(subkey)) 43internal static string? GetDefaultValue(RegistryKey baseKey, string subkey) 47using (RegistryKey? key = baseKey.OpenSubKey(subkey)) 65internal static RegistryKey OpenBaseKey(RegistryHive hive, RegistryView view) 67RegistryKey key = RegistryKey.OpenBaseKey(hive, view);
ToolLocationHelper.cs (2)
2681using (RegistryKey baseKey = openBaseKey(registryHive, registryView)) 2733using (RegistryKey versionKey = baseKey.OpenSubKey(platformSDKsRegistryKey))
Microsoft.DotNet.Cli.Utils (14)
DependencyProvider.cs (9)
51public readonly RegistryKey BaseKey; 127using RegistryKey dependentsKey = BaseKey.CreateSubKey(Path.Combine(DependentsKeyPath, dependent), writable: true); 149using RegistryKey? dependentsKey = BaseKey.OpenSubKey(DependentsKeyPath, writable: true); 154using RegistryKey? providerKey = BaseKey.OpenSubKey(DependenciesKeyRelativePath, writable: true); 165using RegistryKey? dependentsKey = BaseKey.OpenSubKey(DependentsKeyPath); 177using RegistryKey? providerKey = BaseKey.OpenSubKey(ProviderKeyPath); 185var baseKey = allUsers ? Registry.LocalMachine : Registry.CurrentUser; 186using RegistryKey? dependenciesKey = baseKey.OpenSubKey(DependenciesKeyRelativePath); 190using RegistryKey? providerKey = dependenciesKey?.OpenSubKey(providerKeyName);
UILanguageOverride.cs (1)
131using RegistryKey? windowsVersionRegistry = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
WindowsRegistryEnvironmentPathEditor.cs (4)
14using (RegistryKey? environmentKey = OpenEnvironmentKeyIfExists(writable: false, sdkEnvironmentVariableTarget: currentUserBeforeEvaluation)) 22using (RegistryKey? environmentKey = OpenEnvironmentKeyIfExists(writable: true, sdkEnvironmentVariableTarget: sdkEnvironmentVariableTarget)) 40private static RegistryKey? OpenEnvironmentKeyIfExists(bool writable, SdkEnvironmentVariableTarget sdkEnvironmentVariableTarget) 42RegistryKey baseKey;
Microsoft.DotNet.Cli.Utils.Tests (3)
DependencyProviderTests.cs (3)
97using RegistryKey providerKey = Registry.CurrentUser.CreateSubKey(Path.Combine(DependencyProvider.DependenciesKeyRelativePath, providerKeyName), writable: true); 114using RegistryKey providerKey = Registry.CurrentUser.CreateSubKey(Path.Combine(DependencyProvider.DependenciesKeyRelativePath, providerKeyName), writable: true); 130using RegistryKey providerKey = dep.BaseKey.OpenSubKey(DependencyProvider.DependenciesKeyRelativePath, writable: true);
Microsoft.Extensions.AI.Evaluation.Console (6)
Telemetry\DeviceIdHelper.cs (6)
72using RegistryKey baseKey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64); 73using RegistryKey? key = baseKey.OpenSubKey(RegistryKeyPath); 103using RegistryKey baseKey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64); 104using RegistryKey key = baseKey.CreateSubKey(RegistryKeyPath);
Microsoft.VisualBasic.Core (5)
Microsoft\VisualBasic\Interaction.vb (5)
322Dim UserKey As RegistryKey 323Dim AppSectionKey As RegistryKey = Nothing 353Dim rk As RegistryKey 412Dim rk As RegistryKey = Nothing 452Dim rk As RegistryKey
Microsoft.VisualStudio.LanguageServices (8)
CodeMarkers\ManagedCodeMarkers.cs (3)
356using (RegistryKey baseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, registryView)) 357using (RegistryKey key = baseKey.OpenSubKey(regRoot + "\\Performance"))
Options\LocalUserRegistryOptionPersister.cs (5)
20private readonly RegistryKey _registryKey; 22private LocalUserRegistryOptionPersister(RegistryKey registryKey) 36var root = (__VsLocalRegistryRootHandle.RegHandle_LocalMachine == handle) ? Registry.LocalMachine : Registry.CurrentUser; 44using var subKey = _registryKey.OpenSubKey(path); 128using var subKey = _registryKey.CreateSubKey(path);
Microsoft.Win32.Registry (23)
artifacts\obj\Microsoft.Win32.Registry\Debug\net10.0\Microsoft.Win32.Registry.notsupported.cs (23)
11public static readonly Microsoft.Win32.RegistryKey ClassesRoot; 12public static readonly Microsoft.Win32.RegistryKey CurrentConfig; 13public static readonly Microsoft.Win32.RegistryKey CurrentUser; 14public static readonly Microsoft.Win32.RegistryKey LocalMachine; 15public static readonly Microsoft.Win32.RegistryKey PerformanceData; 16public static readonly Microsoft.Win32.RegistryKey Users; 39public Microsoft.Win32.RegistryKey CreateSubKey(string subkey) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 40public Microsoft.Win32.RegistryKey CreateSubKey(string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 41public Microsoft.Win32.RegistryKey CreateSubKey(string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, Microsoft.Win32.RegistryOptions registryOptions) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 42public Microsoft.Win32.RegistryKey CreateSubKey(string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, Microsoft.Win32.RegistryOptions registryOptions, System.Security.AccessControl.RegistrySecurity? registrySecurity) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 43public Microsoft.Win32.RegistryKey CreateSubKey(string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, System.Security.AccessControl.RegistrySecurity? registrySecurity) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 44public Microsoft.Win32.RegistryKey CreateSubKey(string subkey, bool writable) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 45public Microsoft.Win32.RegistryKey CreateSubKey(string subkey, bool writable, Microsoft.Win32.RegistryOptions options) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 54public static Microsoft.Win32.RegistryKey FromHandle(Microsoft.Win32.SafeHandles.SafeRegistryHandle handle) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 55public static Microsoft.Win32.RegistryKey FromHandle(Microsoft.Win32.SafeHandles.SafeRegistryHandle handle, Microsoft.Win32.RegistryView view) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 66public static Microsoft.Win32.RegistryKey OpenBaseKey(Microsoft.Win32.RegistryHive hKey, Microsoft.Win32.RegistryView view) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 67public static Microsoft.Win32.RegistryKey OpenRemoteBaseKey(Microsoft.Win32.RegistryHive hKey, string machineName) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 68public static Microsoft.Win32.RegistryKey OpenRemoteBaseKey(Microsoft.Win32.RegistryHive hKey, string machineName, Microsoft.Win32.RegistryView view) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 69public Microsoft.Win32.RegistryKey? OpenSubKey(string name) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 70public Microsoft.Win32.RegistryKey? OpenSubKey(string name, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 71public Microsoft.Win32.RegistryKey? OpenSubKey(string name, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, System.Security.AccessControl.RegistryRights rights) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 72public Microsoft.Win32.RegistryKey? OpenSubKey(string name, bool writable) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } 73public Microsoft.Win32.RegistryKey? OpenSubKey(string name, System.Security.AccessControl.RegistryRights rights) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); }
Microsoft.Win32.Registry.AccessControl (3)
artifacts\obj\Microsoft.Win32.Registry.AccessControl\Debug\net10.0\Microsoft.Win32.Registry.AccessControl.notsupported.cs (3)
11public static System.Security.AccessControl.RegistrySecurity GetAccessControl(this Microsoft.Win32.RegistryKey key) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_RegistryAccessControl); } 12public static System.Security.AccessControl.RegistrySecurity GetAccessControl(this Microsoft.Win32.RegistryKey key, System.Security.AccessControl.AccessControlSections includeSections) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_RegistryAccessControl); } 13public static void SetAccessControl(this Microsoft.Win32.RegistryKey key, System.Security.AccessControl.RegistrySecurity registrySecurity) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_RegistryAccessControl); }
MSBuildTaskHost (2)
NativeMethods.cs (2)
648using (RegistryKey fileSystemKey = Registry.LocalMachine.OpenSubKey(WINDOWS_FILE_SYSTEM_REGISTRY_KEY)) 701using (RegistryKey policyKey = Registry.LocalMachine.OpenSubKey(WINDOWS_SAC_REGISTRY_KEY))
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
14[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.Win32.RegistryKey))]
PresentationCore (7)
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (2)
297RegistryKey regkey = Registry.LocalMachine; 298RegistryKey recognizerKey = regkey.OpenSubKey(GestureRecognizerPath);
System\Windows\Diagnostics\VisualDiagnostics.cs (1)
343RegistryKey key = Registry.LocalMachine.OpenSubKey(c_devmodeRegKey);
System\Windows\Input\Stylus\Common\StylusLogic.cs (2)
328RegistryKey stylusKey = null; // This object has finalizer to close the key. 329RegistryKey touchKey = null; // This object has finalizer to close the key.
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (1)
79RegistryKey key = null; // This object has finalizer to close the key.
System\Windows\Input\TextCompositionManager.cs (1)
903RegistryKey key = Registry.CurrentUser.OpenSubKey("Control Panel\\Input Method");
PresentationFramework (21)
MS\Internal\IO\Packaging\PackageFilter.cs (7)
513RegistryKey iFilterIidKey = 529private static RegistryKey FindSubkey(RegistryKey containingKey, string[] keyPath) 531RegistryKey currentKey = containingKey; 553RegistryKey mimeContentType = FindSubkey(Registry.ClassesRoot, _mimeContentTypeKey); 554RegistryKey mimeTypeKey = (mimeContentType?.OpenSubKey(contentType.ToString())); 579RegistryKey persistentHandlerKey =
System\Windows\Application.cs (1)
2294using (RegistryKey soundKey = Registry.CurrentUser.OpenSubKey(regPath))
System\Windows\Documents\RtfToXamlReader.cs (1)
3708RegistryKey rk = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes");
System\Windows\Documents\Serialization\SerializerDescriptor.cs (4)
33private static string GetNonEmptyRegistryString(RegistryKey key, string value) 129internal void WriteToRegistryKey(RegistryKey key) 151internal static SerializerDescriptor CreateFromRegistry(RegistryKey plugIns, string keyName) 158RegistryKey key = plugIns.OpenSubKey(keyName);
System\Windows\Documents\Serialization\SerializerProvider.cs (5)
43RegistryKey plugIns = _rootKey.CreateSubKey(_registryPath); 74RegistryKey plugIns = _rootKey.CreateSubKey(_registryPath); 82RegistryKey newPlugIn = plugIns.CreateSubKey(serializerKey); 100RegistryKey plugIns = _rootKey.CreateSubKey(_registryPath); 221private static readonly RegistryKey _rootKey = Registry.LocalMachine;
System\Windows\Markup\RestrictiveXamlXmlReader.cs (3)
40using (RegistryKey hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)) 44using (RegistryKey xpsDangerKey = hklm.OpenSubKey(AllowedTypesForRestrictiveXamlContexts, false))
PresentationUI (3)
MS\Internal\Documents\RightsManagementProvider.cs (2)
393using (RegistryKey defaultRMKey = Registry.CurrentUser.OpenSubKey( 461using (RegistryKey defaultRMKey = Registry.CurrentUser.CreateSubKey(
MS\Internal\Documents\RMPublishingDialog.cs (1)
324using (RegistryKey defaultRMKey = Registry.CurrentUser.OpenSubKey(
RunTests (2)
ProcDumpUtil.cs (2)
18using var registryKey = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps", writable: true); 28using var registryKey = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps", writable: true);
SignalR.Client.FunctionalTestApp (1)
src\SignalR\common\Shared\TestCertificates.cs (1)
18var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
System.Windows.Forms (14)
System\Windows\Forms\Application.cs (2)
139public static RegistryKey CommonAppDataRegistry 672public static RegistryKey UserAppDataRegistry
System\Windows\Forms\ComponentModel\COM2Interop\IComPropertyBrowser.cs (2)
48void LoadState(RegistryKey? key); 54void SaveState(RegistryKey? key);
System\Windows\Forms\Controls\Labels\LinkUtilities.cs (2)
29RegistryKey? key = Registry.CurrentUser.OpenSubKey(IESettingsRegPath); 128RegistryKey? key = null;
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (2)
2267void IComPropertyBrowser.SaveState(RegistryKey? key) 2281void IComPropertyBrowser.LoadState(RegistryKey? key)
System\Windows\Forms\Input\InputLanguage.cs (5)
110using RegistryKey? key = Registry.LocalMachine.OpenSubKey($@"{KeyboardLayoutsRegistryPath}\{LayoutId}"); 147using RegistryKey? key = Registry.LocalMachine.OpenSubKey(KeyboardLayoutsRegistryPath); 153using RegistryKey? subKey = key.OpenSubKey(subKeyName); 214using RegistryKey? key = Registry.CurrentUser.OpenSubKey(UserProfileRegistryPath); 219using RegistryKey? subKey = key.OpenSubKey(language);
System\Windows\Forms\Internal\RegistryKeyExtensions.cs (1)
10public static string? GetMUIString(this RegistryKey? key, string keyName, string fallbackKeyName)
System.Windows.Forms.Design (9)
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (1)
297using RegistryKey? regkey = Registry.LocalMachine.OpenSubKey(
System\Windows\Forms\Design\DocumentDesigner.AxToolboxItem.cs (6)
47using RegistryKey? key = Registry.ClassesRoot.OpenSubKey(controlKey); 50using RegistryKey? verKey = key?.OpenSubKey("Version"); 248using RegistryKey? key = Registry.ClassesRoot.OpenSubKey(controlKey) 255using RegistryKey? tlbKey = key.OpenSubKey("TypeLib"); 260using RegistryKey? verKey = key.OpenSubKey("Version"); 302using RegistryKey? inprocServerKey = key.OpenSubKey("InprocServer32");
System\Windows\Forms\Design\DocumentDesigner.cs (2)
755RegistryKey key = null; 756RegistryKey designtimeKey = null;
System.Windows.Forms.Primitives (2)
System\Windows\Forms\Internals\ScaleHelper.cs (1)
239using RegistryKey? key = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Accessibility");
Windows\Win32\Pinvoke.RegLoadMUIString.cs (1)
13public static unsafe bool RegLoadMUIString(RegistryKey key, string keyName, out string localizedValue)
System.Windows.Forms.Tests (2)
System\Windows\Forms\ApplicationTests.cs (1)
332using RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Accessibility");
System\Windows\Forms\LinkUtilitiesTests.cs (1)
15RegistryKey? key = Registry.CurrentUser.OpenSubKey(LinkUtilities.IEMainRegPath);