The Registry Hierarchy

The Registry is structured as a set of subtrees of keys that contain per-computer and per-user databases. The per-computer information includes information about hardware and software installed on the computer. The per-user information includes the information in user profiles, such as desktop settings, individual preferences for certain software, and personal printer and network settings. In versions of Windows for MS-DOS, per-computer information was saved in the Win.ini and System.ini files, but it was not possible to save separate information for individual users.

In the Windows NT Registry, each individual key can contain data items called value entries and can also contain additional subkeys. In the Registry structure, keys are analogous to directories, and the value entries are analogous to files.

Figure 23.5 shows the subtrees of the Windows NT Registry.

Figure 23.5 The subtrees of the Windows NT Registry

Each of these subtrees is described in detail later in this chapter. Each of the root key names begins with "HKEY_" to indicate to software developers that this is a handle that can be used by a program. A handle is a value used to uniquely identify a resource so that a program can access it.

Table 23.1 identifies and defines these subtrees.

Table 23.1 Registry Subtrees

Root key name

Description

HKEY_LOCAL_MACHINE

Contains information about the local computer system, including hardware and operating system data such as bus type, system memory, device drivers, and startup control data.

HKEY_CLASSES_ROOT

Contains the associations between applications and file types (by filename extension). It also contains object linking and embedding (OLE) Registry information associated with COM objects, and file-class association data (equivalent to the Registry in Windows for MS-DOS). The entries in this subtree are the same as in HKEY_LOCAL_MACHINE\Software\Classes.

For detailed information on HKEY_CLASSES_ROOT, see the OLE Programmer's Reference in the Windows NT 4.0 Software Developer's Kit.

HKEY_CURRENT_CONFIG

Contains configuration data for the current hardware profile. Hardware profiles are sets of changes to the standard configuration of services and devices established by data in the Software and System keys under HKEY_LOCAL_MACHINE. Only the changes appear in HKEY_CURRENT_CONFIG.

The entries in this subtree also appear in: HKEY_LOCAL_MACHINE\System\CurrentControlSet\HardwareProfiles\Current.

HKEY_CURRENT_USER

Contains the user profile for the user who is logged on, including environment variables, desktop settings, network connections, printers, and application preferences.

HKEY_USERS

Contains all actively loaded user profiles, including HKEY_CURRENT_USER, and the default profile. Users who are accessing a server remotely do not have profiles under this key on the server; their profiles are loaded into the Registry on their own computers.