- View the system registry by using 64-bit versions of Windows
- Summary
- View 64-bit and 32-bit registry keys
- Reflected keys
- Registry Key. Open Remote Base Key Метод
- Определение
- Перегрузки
- OpenRemoteBaseKey(RegistryHive, String)
- Параметры
- Возвращаемое значение
- Исключения
- Примеры
- Комментарии
- См. также раздел
- Применяется к
- OpenRemoteBaseKey(RegistryHive, String, RegistryView)
- Параметры
- Возвращаемое значение
- Исключения
- Комментарии
- Registry Key Security and Access Rights
- RegOpenKeyA function (winreg.h)
- Syntax
- Parameters
- Return value
- Remarks
View the system registry by using 64-bit versions of Windows
This article describes how to view the Windows registry by using 64-bit versions of Windows.
Original product version: В Windows 10 — all editions
Original KB number: В 305097
Summary
The registry in 64-bit versions of Windows is divided into 32-bit and 64-bit keys. Many of the 32-bit keys have the same names as their 64-bit counterparts, and vice versa.
The default 64-bit version of Registry Editor (Regedit.exe) that is included with 64-bit versions of Windows displays both 64-bit keys and 32-bit keys. The WOW64 registry redirector presents 32-bit programs with different keys for 32-bit program registry entries. In the 64-bit version of Registry Editor, 32-bit keys are displayed under the HKEY_LOCAL_MACHINE\Software\WOW6432Node registry key.
View 64-bit and 32-bit registry keys
You can view or edit both 64-bit and 32-bit registry keys and values by using the default 64-bit version of Registry Editor. To view or edit 64-bit keys, you must use the 64-bit version of Registry Editor (Regedit.exe). You can also view or edit 32-bit keys and values by using the 32-bit version of Registry Editor in the %systemroot%\Syswow64 folder. There are no differences in the way you perform tasks between the 32-bit version of Registry Editor and the 64-bit version of Registry Editor. To open the 32-bit version of Registry Editor, follow these steps:
Click Start, and then click Run.
In the Open box, type %systemroot%\syswow64\regedit , and then click OK.
You must close the 64-bit version of Registry Editor before you can open the 32-bit version (and vice versa) unless you start the second instance of Registry Editor with the -m switch. For example, if the 64-bit version of Registry Editor is already running, type %systemroot%\syswow64\regedit -m in step 2 to start the 32-bit version of Registry Editor.
To support the co-existence of 32-bit and 64-bit COM registration and program states, WOW64 presents 32-bit programs with an alternate view of the registry. 32-bit programs see a 32-bit HKEY_LOCAL_MACHINE\Software tree ( HKEY_LOCAL_MACHINE\Software\WOW6432Node ) that is completely separate from the true 64-bit HKEY_LOCAL_MACHINE\Software tree. This isolates HKEY_CLASSES_ROOT , because the per-computer portion of this tree resides within the HKEY_LOCAL_MACHINE\Software registry key.
To enable 64-bit/32-bit program interoperability through COM and other mechanisms, WOW64 uses a Registry Reflector that mirrors certain registry keys and values between the 64-bit and 32-bit registry views. The reflector is intelligent, in that is only reflects COM activation data.
Reflected keys
The WOW64 Registry reflector may modify the contents of keys and values during the reflection process to adjust path names, and so on. Because of this, the 32-bit and 64-bit contents may differ. For example, pathnames that contain the system32 registry entry are written as SysWOW64 in the 32-bit section of the registry. The following keys are reflected:
- HKEY_LOCAL_MACHINE\Software\Classes
- HKEY_LOCAL_MACHINE\Software\COM3
- HKEY_LOCAL_MACHINE\Software\Ole
- HKEY_LOCAL_MACHINE\Software\EventSystem
- HKEY_LOCAL_MACHINE\Software\RPC
—>
Registry Key. Open Remote Base Key Метод
Определение
Открывает новый объект T:Microsoft.Win32.RegistryKey, который представляет запрошенный раздел на удаленном компьютере в указанном представлении реестра. Opens a new T:Microsoft.Win32.RegistryKey that represents the requested key on a remote machine, with the option of specified registry view.
Перегрузки
Открытие нового раздела RegistryKey, который представляет запрошенный раздел на удаленном компьютере. Opens a new RegistryKey that represents the requested key on a remote machine.
Открывает новый раздел реестра, который представляет запрошенный раздел на удаленном компьютере в указанном представлении. Opens a new registry key that represents the requested key on a remote machine with the specified view.
OpenRemoteBaseKey(RegistryHive, String)
Открытие нового раздела RegistryKey, который представляет запрошенный раздел на удаленном компьютере. Opens a new RegistryKey that represents the requested key on a remote machine.
Параметры
Открываемый раздел HKEY, из перечисления RegistryHive. The HKEY to open, from the RegistryHive enumeration.
Удаленный компьютер. The remote machine.
Возвращаемое значение
Запрошенный раздел реестра. The requested registry key.
Исключения
hKey недопустим. hKey is invalid.
machineName не найден. machineName is not found.
machineName имеет значение null . machineName is null .
У пользователя отсутствуют разрешения, необходимые для выполнения этой операции. The user does not have the proper permissions to perform this operation.
У пользователя отсутствуют необходимые права доступа к реестру. The user does not have the necessary registry rights.
Примеры
В следующем примере кода показано, как открыть раздел реестра на удаленном компьютере и перечислить значения ключа. The following code example shows how to open a registry key on a remote computer and enumerate the values of the key. На удаленном компьютере должна быть запущена служба удаленного реестра. The remote computer must be running the remote registry service. При вызове программы укажите имя удаленного компьютера в виде аргумента командной строки. Specify the name of the remote computer as a command-line argument when invoking the program.
Комментарии
Если имеет значение, открывается реестр локального machineName компьютера String.Empty . The local machine registry is opened if machineName is String.Empty. Запрошенный ключ должен быть корневым ключом на удаленном компьютере и определяется соответствующим RegistryHive значением. The requested key must be a root key on the remote machine, and is identified by the appropriate RegistryHive value.
Для удаленного открытия ключа необходимо, чтобы на сервере и клиентском компьютере была запущена служба удаленного реестра и было включено удаленное администрирование. In order for a key to be opened remotely, both the server and client machines must be running the remote registry service, and have remote administration enabled.
См. также раздел
Применяется к
OpenRemoteBaseKey(RegistryHive, String, RegistryView)
Открывает новый раздел реестра, который представляет запрошенный раздел на удаленном компьютере в указанном представлении. Opens a new registry key that represents the requested key on a remote machine with the specified view.
Параметры
Открываемый раздел HKEY из перечисления RegistryHive. The HKEY to open from the RegistryHive enumeration.
Удаленный компьютер. The remote machine.
Представление реестра для использования. The registry view to use.
Возвращаемое значение
Запрошенный раздел реестра. The requested registry key.
Исключения
Недопустимое значение hKey или view . hKey or view is invalid.
machineName не найден. machineName is not found.
machineName имеет значение null . machineName is null .
У пользователя отсутствуют необходимые права доступа к реестру. The user does not have the necessary registry rights.
У пользователя отсутствуют разрешения, необходимые для выполнения этой операции. The user does not have the required permissions to perform this operation.
Комментарии
Если имеет значение, открывается реестр локального machineName компьютера String.Empty . The local machine registry is opened if machineName is String.Empty. Запрошенный ключ должен быть корневым ключом на удаленном компьютере и определяется соответствующим RegistryHive значением. The requested key must be a root key on the remote machine, and is identified by the appropriate RegistryHive value.
Для удаленного открытия ключа необходимо, чтобы на сервере и клиентском компьютере была запущена служба удаленного реестра и было включено удаленное администрирование. In order for a key to be opened remotely, both the server and client machines must be running the remote registry service, and have remote administration enabled.
В 64-разрядных версиях Windows части реестра хранятся отдельно для 32-разрядных и 64-разрядных приложений. On the 64-bit versions of Windows, portions of the registry are stored separately for 32-bit and 64-bit applications. Существует 32-разрядное представление для 32-разрядных приложений и 64-разрядное представление для 64-разрядных приложений. There is a 32-bit view for 32-bit applications and a 64-bit view for 64-bit applications. Если view параметр имеет значение, Registry64 но удаленный компьютер работает под управлением 32-разрядной операционной системы, возвращаемый ключ будет использовать Registry32 представление. If view is Registry64 but the remote machine is running a 32-bit operating system, the returned key will use the Registry32 view.
Registry Key Security and Access Rights
The Windows security model enables you to control access to registry keys. For more information about security, see Access-Control Model.
You can specify a security descriptor for a registry key when you call the RegCreateKeyEx or RegSetKeySecurity function. If you specify NULL, the key gets a default security descriptor. The ACLs in a default security descriptor for a key are inherited from its direct parent key.
The valid access rights for registry keys include the DELETE, READ_CONTROL, WRITE_DAC, and WRITE_OWNER standard access rights. Registry keys do not support the SYNCHRONIZE standard access right.
The following table lists the specific access rights for registry key objects.
Value | Meaning |
---|---|
KEY_ALL_ACCESS (0xF003F) | Combines the STANDARD_RIGHTS_REQUIRED, KEY_QUERY_VALUE, KEY_SET_VALUE, KEY_CREATE_SUB_KEY, KEY_ENUMERATE_SUB_KEYS, KEY_NOTIFY, and KEY_CREATE_LINK access rights. |
KEY_CREATE_LINK (0x0020) | Reserved for system use. |
KEY_CREATE_SUB_KEY (0x0004) | Required to create a subkey of a registry key. |
KEY_ENUMERATE_SUB_KEYS (0x0008) | Required to enumerate the subkeys of a registry key. |
KEY_EXECUTE (0x20019) | Equivalent to KEY_READ. |
KEY_NOTIFY (0x0010) | Required to request change notifications for a registry key or for subkeys of a registry key. |
KEY_QUERY_VALUE (0x0001) | Required to query the values of a registry key. |
KEY_READ (0x20019) | Combines the STANDARD_RIGHTS_READ, KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, and KEY_NOTIFY values. |
KEY_SET_VALUE (0x0002) | Required to create, delete, or set a registry value. |
KEY_WOW64_32KEY (0x0200) | Indicates that an application on 64-bit Windows should operate on the 32-bit registry view. This flag is ignored by 32-bit Windows. For more information, see Accessing an Alternate Registry View. This flag must be combined using the OR operator with the other flags in this table that either query or access registry values. Windows 2000: This flag is not supported. |
KEY_WOW64_64KEY (0x0100) | Indicates that an application on 64-bit Windows should operate on the 64-bit registry view. This flag is ignored by 32-bit Windows. For more information, see Accessing an Alternate Registry View. This flag must be combined using the OR operator with the other flags in this table that either query or access registry values. Windows 2000: This flag is not supported. |
KEY_WRITE (0x20006) | Combines the STANDARD_RIGHTS_WRITE, KEY_SET_VALUE, and KEY_CREATE_SUB_KEY access rights. |
When you call the RegOpenKeyEx function, the system checks the requested access rights against the key’s security descriptor. If the user does not have the correct access to the registry key, the open operation fails. If an administrator needs access to the key, the solution is to enable the SE_TAKE_OWNERSHIP_NAME privilege and open the registry key with WRITE_OWNER access. For more information, see Enabling and Disabling Privileges.
You can request the ACCESS_SYSTEM_SECURITY access right to a registry key if you want to read or write the key’s system access control list (SACL). For more information, see Access-Control Lists (ACLs) and SACL Access Right.
To view the current access rights for a key, including the predefined keys, use the Registry Editor (Regedt32.exe). After navigating to the desired key, go to the Edit menu and select Permissions.
RegOpenKeyA function (winreg.h)
Opens the specified registry key.
Syntax
Parameters
A handle to an open registry key. This handle is returned by the RegCreateKeyEx or RegOpenKeyEx function, or it can be one of the following predefined keys:
HKEY_CLASSES_ROOT HKEY_CURRENT_CONFIG HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS
The name of the registry key to be opened. This key must be a subkey of the key identified by the hKey parameter.
Key names are not case sensitive.
If this parameter is NULL or a pointer to an empty string, the function returns the same handle that was passed in.
A pointer to a variable that receives a handle to the opened key. If the key is not one of the predefined registry keys, call the RegCloseKey function after you have finished using the handle.
Return value
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is a nonzero error code defined in Winerror.h. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
Remarks
The RegOpenKey function uses the default security access mask to open a key. If opening the key requires a different access right, the function fails, returning ERROR_ACCESS_DENIED. An application should use the RegOpenKeyEx function to specify an access mask in this situation.
RegOpenKey does not create the specified key if the key does not exist in the database.
If your service or application impersonates different users, do not use this function with HKEY_CURRENT_USER. Instead, call the RegOpenCurrentUser function.
The winreg.h header defines RegOpenKey as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.