using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Security.AccessControl;
using System.Text;
namespace Microsoft.Win32
{
/// Represents a key-level node in the Windows registry. This class is a registry encapsulation.
// Token: 0x02000075 RID: 117
[ComVisible(true)]
public sealed class RegistryKey : MarshalByRefObject, IDisposable
{
// Token: 0x06000705 RID: 1797 RVA: 0x0001581C File Offset: 0x00013A1C
internal RegistryKey(RegistryHive hiveId)
: this(hiveId, new IntPtr((int)hiveId), false)
{
}
// Token: 0x06000706 RID: 1798 RVA: 0x0001582C File Offset: 0x00013A2C
internal RegistryKey(RegistryHive hiveId, IntPtr keyHandle, bool remoteRoot)
{
this.hive = hiveId;
this.handle = keyHandle;
this.qname = RegistryKey.GetHiveName(hiveId);
this.isRemoteRoot = remoteRoot;
this.isWritable = true;
}
// Token: 0x06000707 RID: 1799 RVA: 0x00015874 File Offset: 0x00013A74
internal RegistryKey(object data, string keyName, bool writable)
{
this.handle = data;
this.qname = keyName;
this.isWritable = writable;
}
// Token: 0x06000708 RID: 1800 RVA: 0x00015894 File Offset: 0x00013A94
static RegistryKey()
{
if (Path.DirectorySeparatorChar == '\\')
{
RegistryKey.RegistryApi = new Win32RegistryApi();
}
else
{
RegistryKey.RegistryApi = new UnixRegistryApi();
}
}
/// Performs a on the current key.
// Token: 0x06000709 RID: 1801 RVA: 0x000158BC File Offset: 0x00013ABC
void IDisposable.Dispose()
{
GC.SuppressFinalize(this);
this.Close();
}
// Token: 0x0600070A RID: 1802 RVA: 0x000158CC File Offset: 0x00013ACC
~RegistryKey()
{
this.Close();
}
/// Retrieves the name of the key.
/// The absolute (qualified) name of the key.
/// The is closed (closed keys cannot be accessed).
// Token: 0x170000D1 RID: 209
// (get) Token: 0x0600070B RID: 1803 RVA: 0x00015908 File Offset: 0x00013B08
public string Name
{
get
{
return this.qname;
}
}
/// Writes all the attributes of the specified open registry key into the registry.
// Token: 0x0600070C RID: 1804 RVA: 0x00015910 File Offset: 0x00013B10
public void Flush()
{
RegistryKey.RegistryApi.Flush(this);
}
/// Closes the key and flushes it to disk if its contents have been modified.
// Token: 0x0600070D RID: 1805 RVA: 0x00015920 File Offset: 0x00013B20
public void Close()
{
this.Flush();
if (!this.isRemoteRoot && this.IsRoot)
{
return;
}
RegistryKey.RegistryApi.Close(this);
this.handle = null;
}
/// Retrieves the count of subkeys of the current key.
/// The number of subkeys of the current key.
/// The user does not have read permission for the key.
/// The being manipulated is closed (closed keys cannot be accessed).
/// The user does not have the necessary registry rights.
/// A system error occurred, for example the current key has been deleted.
///
///
///
// Token: 0x170000D2 RID: 210
// (get) Token: 0x0600070E RID: 1806 RVA: 0x0001595C File Offset: 0x00013B5C
public int SubKeyCount
{
get
{
this.AssertKeyStillValid();
return RegistryKey.RegistryApi.SubKeyCount(this);
}
}
/// Retrieves the count of values in the key.
/// The number of name/value pairs in the key.
/// The user does not have read permission for the key.
/// The being manipulated is closed (closed keys cannot be accessed).
/// The user does not have the necessary registry rights.
/// A system error occurred, for example the current key has been deleted.
///
///
///
// Token: 0x170000D3 RID: 211
// (get) Token: 0x0600070F RID: 1807 RVA: 0x00015970 File Offset: 0x00013B70
public int ValueCount
{
get
{
this.AssertKeyStillValid();
return RegistryKey.RegistryApi.ValueCount(this);
}
}
/// Sets the specified name/value pair.
/// The name of the value to store.
/// The data to be stored.
///
/// is null.
///
/// is an unsupported data type.-or- is longer than the maximum length allowed (255 characters).
/// The that contains the specified value is closed (closed keys cannot be accessed).
/// The is read-only, and cannot be written to; for example, the key has not been opened with write access. -or-The object represents a root-level node, and the operating system is Windows Millennium Edition or Windows 98.
/// The user does not have the permissions required to create or modify registry keys.
/// The object represents a root-level node, and the operating system is Windows 2000, Windows XP, or Windows Server 2003.
///
///
///
///
// Token: 0x06000710 RID: 1808 RVA: 0x00015984 File Offset: 0x00013B84
public void SetValue(string name, object value)
{
this.AssertKeyStillValid();
if (value == null)
{
throw new ArgumentNullException("value");
}
if (name != null)
{
this.AssertKeyNameLength(name);
}
if (!this.IsWritable)
{
throw new UnauthorizedAccessException("Cannot write to the registry key.");
}
RegistryKey.RegistryApi.SetValue(this, name, value);
}
/// Sets the value of a name/value pair in the registry key, using the specified registry data type.
/// The name of the value to be stored.
/// The data to be stored.
/// The registry data type to use when storing the data.
///
/// is null.
///
/// is longer than the maximum length allowed (255 characters).-or- The type of did not match the registry data type specified by , therefore the data could not be converted properly.
/// The that contains the specified value is closed (closed keys cannot be accessed).
/// The is read-only, and cannot be written to; for example, the key has not been opened with write access.-or-The object represents a root-level node, and the operating system is Windows Millennium Edition or Windows 98.
/// The user does not have the permissions required to create or modify registry keys.
/// The object represents a root-level node, and the operating system is Windows 2000, Windows XP, or Windows Server 2003.
///
///
///
///
// Token: 0x06000711 RID: 1809 RVA: 0x000159D8 File Offset: 0x00013BD8
[ComVisible(false)]
public void SetValue(string name, object value, RegistryValueKind valueKind)
{
this.AssertKeyStillValid();
if (value == null)
{
throw new ArgumentNullException("value");
}
if (name != null)
{
this.AssertKeyNameLength(name);
}
if (!this.IsWritable)
{
throw new UnauthorizedAccessException("Cannot write to the registry key.");
}
RegistryKey.RegistryApi.SetValue(this, name, value, valueKind);
}
/// Retrieves a subkey as read-only.
/// The subkey requested, or null if the operation failed.
/// The name or path of the subkey to open read-only.
///
/// is null
///
/// is longer than the maximum length allowed (255 characters).
/// The is closed (closed keys cannot be accessed).
/// The user does not have the permissions required to read the registry key.
///
///
///
// Token: 0x06000712 RID: 1810 RVA: 0x00015A30 File Offset: 0x00013C30
public RegistryKey OpenSubKey(string name)
{
return this.OpenSubKey(name, false);
}
/// Retrieves a specified subkey.
/// The subkey requested, or null if the operation failed.
/// Name or path of the subkey to open.
/// Set to true if you need write access to the key.
///
/// is null.
///
/// is longer than the maximum length allowed (255 characters).
/// The is closed (closed keys cannot be accessed).
/// The user does not have the permissions required to access the registry key in the specified mode.
///
///
///
///
// Token: 0x06000713 RID: 1811 RVA: 0x00015A3C File Offset: 0x00013C3C
public RegistryKey OpenSubKey(string name, bool writable)
{
this.AssertKeyStillValid();
if (name == null)
{
throw new ArgumentNullException("name");
}
this.AssertKeyNameLength(name);
return RegistryKey.RegistryApi.OpenSubKey(this, name, writable);
}
/// Retrieves the value associated with the specified name. Returns null if the name/value pair does not exist in the registry.
/// The value associated with , or null if is not found.
/// The name of the value to retrieve.
/// The user does not have the permissions required to read from the registry key.
/// The that contains the specified value is closed (closed keys cannot be accessed).
/// The that contains the specified value has been marked for deletion.
/// The user does not have the necessary registry rights.
///
///
///
// Token: 0x06000714 RID: 1812 RVA: 0x00015A74 File Offset: 0x00013C74
public object GetValue(string name)
{
return this.GetValue(name, null);
}
/// Retrieves the value associated with the specified name. If the name is not found, returns the default value that you provide.
/// The value associated with , with any embedded environment variables left unexpanded, or if is not found.
/// The name of the value to retrieve.
/// The value to return if does not exist.
/// The user does not have the permissions required to read from the registry key.
/// The that contains the specified value is closed (closed keys cannot be accessed).
/// The that contains the specified value has been marked for deletion.
/// The user does not have the necessary registry rights.
///
///
///
// Token: 0x06000715 RID: 1813 RVA: 0x00015A80 File Offset: 0x00013C80
public object GetValue(string name, object defaultValue)
{
this.AssertKeyStillValid();
return RegistryKey.RegistryApi.GetValue(this, name, defaultValue, RegistryValueOptions.None);
}
/// Retrieves the value associated with the specified name and retrieval options. If the name is not found, returns the default value that you provide.
/// The value associated with , processed according to the specified , or if is not found.
/// The name of the value to retrieve.
/// The value to return if does not exist.
/// One of the values that specifies optional processing of the retrieved value.
/// The user does not have the permissions required to read from the registry key.
/// The that contains the specified value is closed (closed keys cannot be accessed).
/// The that contains the specified value has been marked for deletion.
///
/// is not a valid value; for example, an invalid value is cast to .
/// The user does not have the necessary registry rights.
///
///
///
// Token: 0x06000716 RID: 1814 RVA: 0x00015AA4 File Offset: 0x00013CA4
[ComVisible(false)]
public object GetValue(string name, object defaultValue, RegistryValueOptions options)
{
this.AssertKeyStillValid();
return RegistryKey.RegistryApi.GetValue(this, name, defaultValue, options);
}
/// Retrieves the registry data type of the value associated with the specified name.
/// A value representing the registry data type of the value associated with .
/// The name of the value whose registry data type is to be retrieved.
/// The user does not have the permissions required to read from the registry key.
/// The that contains the specified value is closed (closed keys cannot be accessed).
/// The subkey that contains the specified value does not exist.-or-The name/value pair specified by does not exist.This exception is not thrown on Windows 95, Windows 98, or Windows Millennium Edition.
/// The user does not have the necessary registry rights.
///
///
///
// Token: 0x06000717 RID: 1815 RVA: 0x00015AC8 File Offset: 0x00013CC8
[ComVisible(false)]
public RegistryValueKind GetValueKind(string name)
{
throw new NotImplementedException();
}
/// Creates a new subkey or opens an existing subkey for write access. The string is not case-sensitive.
/// A object that represents the existing or newly created subkey, or null if the operation failed. If a zero-length string is specified for , the current object is returned.
/// The name or path of the subkey to create or open.
///
/// is null.
/// The user does not have the permissions required to create or open the registry key.
///
/// is longer than the maximum length allowed (255 characters).
/// The on which this method is being invoked is closed (closed keys cannot be accessed).
/// The cannot be written to; for example, it was not opened as a writable key , or the user does not have the necessary access rights.
/// The nesting level exceeds 510.-or-A system error occurred, such as deletion of the key, or an attempt to create a key in the root.
///
///
///
///
// Token: 0x06000718 RID: 1816 RVA: 0x00015AD0 File Offset: 0x00013CD0
public RegistryKey CreateSubKey(string subkey)
{
this.AssertKeyStillValid();
this.AssertKeyNameNotNull(subkey);
this.AssertKeyNameLength(subkey);
if (!this.IsWritable)
{
throw new UnauthorizedAccessException("Cannot write to the registry key.");
}
return RegistryKey.RegistryApi.CreateSubKey(this, subkey);
}
/// Creates a new subkey or opens an existing subkey for write access, using the specified permission check option. The string is not case-sensitive.
/// A object that represents the existing or newly created subkey, or null if the operation failed. If a zero-length string is specified for , the current object is returned.
/// The name or path of the subkey to create or open.
/// One of the values that specifies whether the key is opened for read or read/write access.
///
/// is null.
/// The user does not have the permissions required to create or open the registry key.
///
/// is longer than the maximum length allowed (255 characters). -or- contains an invalid value.
/// The on which this method is being invoked is closed (closed keys cannot be accessed).
/// The cannot be written to; for example, it was not opened as a writable key, or the user does not have the necessary access rights.
/// The nesting level exceeds 510.-or-A system error occurred, such as deletion of the key, or an attempt to create a key in the root.
// Token: 0x06000719 RID: 1817 RVA: 0x00015B14 File Offset: 0x00013D14
[ComVisible(false)]
public RegistryKey CreateSubKey(string subkey, RegistryKeyPermissionCheck permissionCheck)
{
throw new NotImplementedException();
}
/// Creates a new subkey or opens an existing subkey for write access, using the specified permission check option and registry security. The string is not case-sensitive.
/// A object that represents existing or the newly created subkey, or null if the operation failed. If a zero-length string is specified for , the current object is returned.
/// The name or path of the subkey to create or open.
/// One of the values that specifies whether the key is opened for read or read/write access.
/// A object that specifies the access control security for the new key.
///
/// is null.
/// The user does not have the permissions required to create or open the registry key.
///
/// is longer than the maximum length allowed (255 characters). -or- contains an invalid value.
/// The on which this method is being invoked is closed (closed keys cannot be accessed).
/// The current cannot be written to; for example, it was not opened as a writable key, or the user does not have the necessary access rights.
/// The nesting level exceeds 510.-or-A system error occurred, such as deletion of the key, or an attempt to create a key in the root.
// Token: 0x0600071A RID: 1818 RVA: 0x00015B1C File Offset: 0x00013D1C
[ComVisible(false)]
public RegistryKey CreateSubKey(string subkey, RegistryKeyPermissionCheck permissionCheck, RegistrySecurity registrySecurity)
{
throw new NotImplementedException();
}
/// Deletes the specified subkey. The string is not case-sensitive.
/// The name of the subkey to delete.
/// The has child subkeys
/// The parameter does not specify a valid registry key
///
/// is null
/// The user does not have the permissions required to delete the key.
/// The being manipulated is closed (closed keys cannot be accessed).
/// The user does not have the necessary registry rights.
///
///
///
///
// Token: 0x0600071B RID: 1819 RVA: 0x00015B24 File Offset: 0x00013D24
public void DeleteSubKey(string subkey)
{
this.DeleteSubKey(subkey, true);
}
/// Deletes the specified subkey. The string subkey is not case-sensitive.
/// The name of the subkey to delete.
/// Indicates whether an exception should be raised if the specified subkey cannot be found. If this argument is true and the specified subkey does not exist, then an exception is raised. If this argument is false and the specified subkey does not exist, then no action is taken
///
/// has child subkeys.
///
/// does not specify a valid registry key and is true.
///
/// is null.
/// The user does not have the permissions required to delete the key.
/// The being manipulated is closed (closed keys cannot be accessed).
/// The user does not have the necessary registry rights.
///
///
///
///
// Token: 0x0600071C RID: 1820 RVA: 0x00015B30 File Offset: 0x00013D30
public void DeleteSubKey(string subkey, bool throwOnMissingSubKey)
{
this.AssertKeyStillValid();
this.AssertKeyNameNotNull(subkey);
this.AssertKeyNameLength(subkey);
if (!this.IsWritable)
{
throw new UnauthorizedAccessException("Cannot write to the registry key.");
}
RegistryKey registryKey = this.OpenSubKey(subkey);
if (registryKey == null)
{
if (throwOnMissingSubKey)
{
throw new ArgumentException("Cannot delete a subkey tree because the subkey does not exist.");
}
return;
}
else
{
if (registryKey.SubKeyCount > 0)
{
throw new InvalidOperationException("Registry key has subkeys and recursive removes are not supported by this method.");
}
registryKey.Close();
RegistryKey.RegistryApi.DeleteKey(this, subkey, throwOnMissingSubKey);
return;
}
}
/// Deletes a subkey and any child subkeys recursively. The string is not case-sensitive.
/// The subkey to delete.
///
/// is null.
/// Deletion of a root hive is attempted.-or- does not specify a valid registry subkey.
/// An I/O error has occurred.
/// The user does not have the permissions required to delete the key.
/// The being manipulated is closed (closed keys cannot be accessed).
/// The user does not have the necessary registry rights.
///
///
///
///
// Token: 0x0600071D RID: 1821 RVA: 0x00015BB4 File Offset: 0x00013DB4
public void DeleteSubKeyTree(string subkey)
{
this.AssertKeyStillValid();
this.AssertKeyNameNotNull(subkey);
this.AssertKeyNameLength(subkey);
RegistryKey registryKey = this.OpenSubKey(subkey, true);
if (registryKey == null)
{
throw new ArgumentException("Cannot delete a subkey tree because the subkey does not exist.");
}
registryKey.DeleteChildKeysAndValues();
registryKey.Close();
this.DeleteSubKey(subkey, false);
}
/// Deletes the specified value from this key.
/// The name of the value to delete.
///
/// is not a valid reference to a value.
/// The user does not have the permissions required to delete the value.
/// The being manipulated is closed (closed keys cannot be accessed).
/// The being manipulated is read-only.
///
///
///
///
// Token: 0x0600071E RID: 1822 RVA: 0x00015C04 File Offset: 0x00013E04
public void DeleteValue(string name)
{
this.DeleteValue(name, true);
}
/// Deletes the specified value from this key.
/// The name of the value to delete.
/// Indicates whether an exception should be raised if the specified value cannot be found. If this argument is true and the specified value does not exist, then an exception is raised. If this argument is false and the specified value does not exist, then no action is taken
///
/// is not a valid reference to a value and is true. -or- is null.
/// The user does not have the permissions required to delete the value.
/// The being manipulated is closed (closed keys cannot be accessed).
/// The being manipulated is read-only.
///
///
///
///
// Token: 0x0600071F RID: 1823 RVA: 0x00015C10 File Offset: 0x00013E10
public void DeleteValue(string name, bool throwOnMissingValue)
{
this.AssertKeyStillValid();
if (name == null)
{
throw new ArgumentNullException("name");
}
if (!this.IsWritable)
{
throw new UnauthorizedAccessException("Cannot write to the registry key.");
}
RegistryKey.RegistryApi.DeleteValue(this, name, throwOnMissingValue);
}
/// Returns the access control security for the current registry key.
/// A object that describes the access control permissions on the registry key represented by the current .
/// The user does not have the necessary permissions.
/// The being manipulated is closed (closed keys cannot be accessed).
/// The current key has been deleted.
///
///
///
// Token: 0x06000720 RID: 1824 RVA: 0x00015C58 File Offset: 0x00013E58
public RegistrySecurity GetAccessControl()
{
throw new NotImplementedException();
}
/// Returns the specified sections of the access control security for the current registry key.
/// A object that describes the access control permissions on the registry key represented by the current .
/// A bitwise combination of values that specifies the type of security information to get.
/// The user does not have the necessary permissions.
/// The being manipulated is closed (closed keys cannot be accessed).
/// The current key has been deleted.
///
///
///
// Token: 0x06000721 RID: 1825 RVA: 0x00015C60 File Offset: 0x00013E60
public RegistrySecurity GetAccessControl(AccessControlSections includeSections)
{
throw new NotImplementedException();
}
/// Retrieves an array of strings that contains all the subkey names.
/// An array of strings that contains the names of the subkeys for the current key.
/// The user does not have the permissions required to read from the key.
/// The being manipulated is closed (closed keys cannot be accessed).
/// The user does not have the necessary registry rights.
/// A system error occurred, for example the current key has been deleted.
///
///
///
// Token: 0x06000722 RID: 1826 RVA: 0x00015C68 File Offset: 0x00013E68
public string[] GetSubKeyNames()
{
this.AssertKeyStillValid();
return RegistryKey.RegistryApi.GetSubKeyNames(this);
}
/// Retrieves an array of strings that contains all the value names associated with this key.
/// An array of strings that contains the value names for the current key.
/// The user does not have the permissions required to read from the registry key.
/// The being manipulated is closed (closed keys cannot be accessed).
/// The user does not have the necessary registry rights.
/// A system error occurred; for example, the current key has been deleted.
///
///
///
// Token: 0x06000723 RID: 1827 RVA: 0x00015C7C File Offset: 0x00013E7C
public string[] GetValueNames()
{
this.AssertKeyStillValid();
return RegistryKey.RegistryApi.GetValueNames(this);
}
/// Opens a new that represents the requested key on a remote machine.
/// The requested .
/// The HKEY to open, from the enumeration.
/// The remote machine.
///
/// is invalid.
///
/// is not found.
///
/// is null.
/// The user does not have the proper permissions to perform this operation.
/// The user does not have the necessary registry rights.
///
///
///
// Token: 0x06000724 RID: 1828 RVA: 0x00015C90 File Offset: 0x00013E90
[MonoTODO("Not implemented on unix")]
public static RegistryKey OpenRemoteBaseKey(RegistryHive hKey, string machineName)
{
if (machineName == null)
{
throw new ArgumentNullException("machineName");
}
return RegistryKey.RegistryApi.OpenRemoteBaseKey(hKey, machineName);
}
/// Retrieves the specified subkey for read or read/write access.
/// A object representing the subkey requested, or null if the operation failed.
/// The name or path of the subkey to create or open.
/// One of the values that specifies whether the key is opened for read or read/write access.
///
/// is null
///
/// is longer than the maximum length allowed (255 characters). -or- contains an invalid value.
/// The is closed (closed keys cannot be accessed).
/// The user does not have the permissions required to read the registry key.
// Token: 0x06000725 RID: 1829 RVA: 0x00015CB0 File Offset: 0x00013EB0
[ComVisible(false)]
public RegistryKey OpenSubKey(string name, RegistryKeyPermissionCheck permissionCheck)
{
throw new NotImplementedException();
}
/// Retrieves the specified subkey for read or read/write access, requesting the specified access rights.
/// A object representing the subkey requested, or null if the operation failed.
/// The name or path of the subkey to create or open.
/// One of the values that specifies whether the key is opened for read or read/write access.
/// A bitwise combination of values that specifies the desired security access.
///
/// is null
///
/// is longer than the maximum length allowed (255 characters). -or- contains an invalid value.
/// The is closed (closed keys cannot be accessed).
///
/// includes invalid registry rights values.-or-The user does not have the requested permissions.
// Token: 0x06000726 RID: 1830 RVA: 0x00015CB8 File Offset: 0x00013EB8
[ComVisible(false)]
public RegistryKey OpenSubKey(string name, RegistryKeyPermissionCheck permissionCheck, RegistryRights rights)
{
throw new NotImplementedException();
}
/// Applies Windows access control security to an existing registry key.
/// A object that specifies the access control security to apply to the current subkey.
/// The current object represents a key with access control security, and the caller does not have rights.
///
/// is null.
/// The being manipulated is closed (closed keys cannot be accessed).
///
///
///
// Token: 0x06000727 RID: 1831 RVA: 0x00015CC0 File Offset: 0x00013EC0
public void SetAccessControl(RegistrySecurity registrySecurity)
{
throw new NotImplementedException();
}
/// Retrieves a string representation of this key.
/// A string representing the key. If the specified key is invalid (cannot be found) then null is returned.
/// The being accessed is closed (closed keys cannot be accessed).
// Token: 0x06000728 RID: 1832 RVA: 0x00015CC8 File Offset: 0x00013EC8
public override string ToString()
{
this.AssertKeyStillValid();
return RegistryKey.RegistryApi.ToString(this);
}
// Token: 0x170000D4 RID: 212
// (get) Token: 0x06000729 RID: 1833 RVA: 0x00015CDC File Offset: 0x00013EDC
internal bool IsRoot
{
get
{
return this.hive != null;
}
}
// Token: 0x170000D5 RID: 213
// (get) Token: 0x0600072A RID: 1834 RVA: 0x00015CEC File Offset: 0x00013EEC
private bool IsWritable
{
get
{
return this.isWritable;
}
}
// Token: 0x170000D6 RID: 214
// (get) Token: 0x0600072B RID: 1835 RVA: 0x00015CF4 File Offset: 0x00013EF4
internal RegistryHive Hive
{
get
{
if (!this.IsRoot)
{
throw new NotSupportedException();
}
return (RegistryHive)((int)this.hive);
}
}
// Token: 0x170000D7 RID: 215
// (get) Token: 0x0600072C RID: 1836 RVA: 0x00015D14 File Offset: 0x00013F14
internal object Handle
{
get
{
return this.handle;
}
}
// Token: 0x0600072D RID: 1837 RVA: 0x00015D1C File Offset: 0x00013F1C
private void AssertKeyStillValid()
{
if (this.handle == null)
{
throw new ObjectDisposedException("Microsoft.Win32.RegistryKey");
}
}
// Token: 0x0600072E RID: 1838 RVA: 0x00015D34 File Offset: 0x00013F34
private void AssertKeyNameNotNull(string subKeyName)
{
if (subKeyName == null)
{
throw new ArgumentNullException("name");
}
}
// Token: 0x0600072F RID: 1839 RVA: 0x00015D48 File Offset: 0x00013F48
private void AssertKeyNameLength(string name)
{
if (name.Length > 255)
{
throw new ArgumentException("Name of registry key cannot be greater than 255 characters");
}
}
// Token: 0x06000730 RID: 1840 RVA: 0x00015D68 File Offset: 0x00013F68
private void DeleteChildKeysAndValues()
{
if (this.IsRoot)
{
return;
}
string[] subKeyNames = this.GetSubKeyNames();
foreach (string text in subKeyNames)
{
RegistryKey registryKey = this.OpenSubKey(text, true);
registryKey.DeleteChildKeysAndValues();
registryKey.Close();
this.DeleteSubKey(text, false);
}
string[] valueNames = this.GetValueNames();
foreach (string text2 in valueNames)
{
this.DeleteValue(text2, false);
}
}
// Token: 0x06000731 RID: 1841 RVA: 0x00015DF8 File Offset: 0x00013FF8
internal static string DecodeString(byte[] data)
{
string text = Encoding.Unicode.GetString(data);
int num = text.IndexOf('\0');
if (num != -1)
{
text = text.TrimEnd(new char[1]);
}
return text;
}
// Token: 0x06000732 RID: 1842 RVA: 0x00015E30 File Offset: 0x00014030
internal static IOException CreateMarkedForDeletionException()
{
throw new IOException("Illegal operation attempted on a registry key that has been marked for deletion.");
}
// Token: 0x06000733 RID: 1843 RVA: 0x00015E3C File Offset: 0x0001403C
private static string GetHiveName(RegistryHive hive)
{
switch (hive + -2147483648)
{
case (RegistryHive)0:
return "HKEY_CLASSES_ROOT";
case (RegistryHive)1:
return "HKEY_CURRENT_USER";
case (RegistryHive)2:
return "HKEY_LOCAL_MACHINE";
case (RegistryHive)3:
return "HKEY_USERS";
case (RegistryHive)4:
return "HKEY_PERFORMANCE_DATA";
case (RegistryHive)5:
return "HKEY_CURRENT_CONFIG";
case (RegistryHive)6:
return "HKEY_DYN_DATA";
default:
throw new NotImplementedException(string.Format("Registry hive '{0}' is not implemented.", hive.ToString()));
}
}
// Token: 0x040000EC RID: 236
private object handle;
// Token: 0x040000ED RID: 237
private object hive;
// Token: 0x040000EE RID: 238
private readonly string qname;
// Token: 0x040000EF RID: 239
private readonly bool isRemoteRoot;
// Token: 0x040000F0 RID: 240
private readonly bool isWritable;
// Token: 0x040000F1 RID: 241
private static readonly IRegistryApi RegistryApi;
}
}