Exemplo n.º 1
0
        /// <summary>
        /// Open the specified subkey.
        /// </summary>
        public static RegistryKeyHandle OpenKey(
            RegistryKeyHandle key,
            string subKeyName,
            RegistryAccessRights rights = RegistryAccessRights.KEY_READ)
        {
            WindowsError result = Imports.RegOpenKeyExW(key, subKeyName, 0, rights, out RegistryKeyHandle subKey);

            if (result != WindowsError.ERROR_SUCCESS)
            {
                throw Errors.GetIoExceptionForError(result);
            }

            return(subKey);
        }
Exemplo n.º 2
0
 public static extern WindowsError RegOpenKeyExW(
     RegistryKeyHandle hKey,
     string lpSubKey,
     uint ulOptions,
     RegistryAccessRights samDesired,
     out RegistryKeyHandle phkResult);