Previous | Next

Overview of the Windows 98 Registry

The structure of the Windows 98 registry has not changed significantly from the Windows 95 registry. What has changed is that the code that handles the registry has become faster and more robust, and the registry now detects when certain problems arise, and automatically fixes them.

The registry is the central storage for all configuration data. The Windows 98 system configuration, the computer hardware configuration, configuration information about Win32-based applications, and user preferences are all stored in the registry. For example, any Windows 98 computer hardware configuration changes that are made with a Plug and Play device are immediately reflected in a configuration change in the registry. Because of these characteristics, the registry serves as the foundation for user, system, and network management in Windows 98.

The registry stores the data in a hierarchical form. Because the registry contains all settings required to configure memory, hardware peripherals, and Windows 98 – supplied network components, you will find that it is no longer necessary to configure settings in startup configuration and initialization files. Also, because all settings are stored in a central location, you can provide both local and remote support for system configuration using Windows 98 tools.

To properly manage resources, such as Internet requests (IRQs), I/O addresses, and direct memory accesses (DMAs), Windows 98 uses the registry to track devices and resources allocated for both Plug and Play–compliant devices, ACPI mechanisms, and legacy devices. The registry provides a centralized, dynamic data store for all Windows settings, with a "current configuration" branch that stores information on a per-configuration basis. For example, the Display option in Control Panel stores per-configuration information about display resolution changes and the Print option in Control Panel stores per-configuration information about the default printer.

Device Manager—which is accessed from the System option in Control Panel—provides a graphical representation of devices configured in Windows 98, and allows properties used by these devices to be viewed and changed, as appropriate. Device Manager also shows resources allocated for the configured devices. Through the resource configuration information maintained in the registry, Windows 98 is able to automatically identify and resolve device resource conflicts for Plug and Play – compliant devices. For legacy devices, Device Manager helps users quickly identify and resolve resource conflicts with devices in the system.

The registry is roughly analogous to the INI files used under Windows 3.x, with each key in the registry similar to a bracketed heading in an INI file and with registry values similar to entries under the INI headings. However, registry keys can contain subkeys, while INI files do not support nested headings. Registry values can also consist of binary data, rather than the simple strings used in INI files.

Although Microsoft discourages using INI files in favor of registry entries, some applications (particularly 16-bit, Windows-based applications) still use INI files. Windows 98 supports INI files solely for compatibility with those applications and related tools (such as setup programs). The Autoexec.bat and Config.sys files also still exist for compatibility with real-mode system components and to allow users to change certain default system settings, such as the PATH environment variable. New Win32-based applications can store their initialization information in the registry.

The Windows 98 registry provides the following benefits:

Because user-specific registry information can be maintained on a central network server when user profiles are enabled, users can have access to personal desktop and network access preferences when logging on to any computer, and settings for multiple users can be maintained on a single computer. Also, system policies can be used to enforce certain registry settings for individuals, workgroups, or all users.

For more information about system policies, see Chapter 8, "System Policies."

Overview of the Registry Files

Although the registry is logically one data store, physically it consists of three different files to allow maximum network configuration flexibility. Windows 98 uses the registry to store information in three major categories. Table 31.1 lists the files and describes the categories.

Table 31.1 Registry files

File Description
User.dat User-specific information, in the form of user profiles, is contained in the User.dat file. It contains logon names, desktop settings, Start menu settings, and so on. During Windows Setup, User.dat is automatically stored as a hidden file in the \Windows directory, but the file does not necessarily remain there. If User Profiles are enabled, users can have their own settings stored in \Windows\Profiles. In a network, this file may be located on a central server.
System.dat Hardware or computer-specific settings (the hardware profile) are contained in the System.dat file. It contains all the hardware configuration, Plug and Play settings, and application settings. It is always stored as a hidden file on the local machine in the Windows 98 directory.
Policy.pol System policies are designed to provide an override for any settings contained in the other two registry components. System policies can contain additional data specific to the network or corporate environment, as established by the network administrator. The system policies themselves are contained in the Policy.pol file. Unlike System.dat and User.dat, Policy.pol is not a mandatory component of a Windows 98 installation.

Benefits of the Registry Structure

Breaking the registry into three logical components provides several benefits, which are described in this section.

The registry components can be located in physically different locations. For example, the System.dat component and other Windows 98 system files might be located on the computer’s hard disk, and the User.dat component can be stored in one master network directory, and then copied to the hard disk during log on. With this configuration, users can log on to various computers on the network and still have their unique network privileges and desktop configuration, allowing the "roving user" network configuration for Windows 98.

The registry and all of the system files can be installed on the local hard disk. With this configuration, multiple users can share a single computer running Windows 98. Each user has a separate logon user name, separate user profile, separate privileges, and separate desktop configuration.

The network administrator can manage an entire network’s user privileges by having a single, global Policy.pol file. Or, the network administer can establish these policies on a server basis or on a per-user basis. In this fashion, a network administrator can centrally enforce a "common desktop configuration" for each user type. For example, a data-entry computer running Windows 98 can be configured so that only two applications (the data entry application and e-mail) can be run. Additionally, the network administrator can specify that data-entry users cannot modify this desktop configuration. In spite of this configuration, the computer running Windows 98 can fully participate in the network and is fully configurable if a different user with more network privileges logs on to the same computer.

Separate privileges can be assigned to users and to a computer. For example, if a user who has sharing privileges logs on to a computer running Windows 98 that has no sharing (no peer services), the user cannot access the computer’s resources. This feature is useful if certain computers contain sensitive data that should not be available to everyone on the corporate network.

How Windows 98 Components Use the Registry

The registry contains ordered pairs of keys and their associated values that are manipulated through the Win32 registry application programming interfaces (APIs). For example, the registry might have a Wallpaper key with an associated value of Work.bmp, meaning that the current desktop background is configured to use the Work bitmap.

Additionally, a special category of keys known as dynamic keys points to either a memory location or a callback function. Dynamic keys are used by device drivers or Windows 98 subsystems that want to register a dynamic data type, such as a counter, in the registry. In the case of network cards, the dynamic keys represent data, such as data transfer rates, number of framing errors, packets dropped, and so on. In general, dynamic keys are used for reporting data, not for storage in the disk-based registry. Because the dynamic keys exist only in memory, their data can be quickly updated and accessed. The data can be accessed by the system performance tools in Windows 98, which call upon the registry for the data they are monitoring.

Keys and values can be created either programmatically or by using the Registry Editor (REGEDIT) tool. The APIs for programmatically managing the registry are the Win32 registry APIs, which can be remotely invoked by the Microsoft remote procedure call (RPC) (distributed computing environment [DCE] – compliant) support built into Windows 98. Windows 98 includes both the client and server portions of Microsoft RPC, making the registry manageable remotely from another computer running Windows 98. In this scenario, the network administrator’s system is the RPC client. It accesses the registry APIs on the target computer running Windows 98 through the RPC server running on the target machine. This RPC access to the registry is secure, and network administrators can limit access to either specified privileged users or a group of network administrators.

With Windows 98, the operating system stores and checks the configuration information in the registry for most configuration settings during system startup. Windows 98 components and applications also use the registry for storing and accessing configuration information:

Figure 31.1 provides an overview of how Windows 98 components and applications use the registry.

Figure 31.1 Windows 98 registry overview

Windows 98 registry APIs can be used to get information into and out of the registry, and examine system, application, and user information stored in the registry.

A set of registry APIs can make information available through remote procedure calls (RPCs) to Windows 98 management tools from other vendors. This permits administrators to view and modify configuration information remotely for hardware and software components that store information in the registry. Notice that the registry APIs are accessible remotely using named pipes (client-side only), NetBIOS over NetBEUI, Windows Sockets on IPX, and Windows Sockets on Internet Protocol (IP).

Overview of the Main Registry Tools

This section contains a brief overview of tools you can use to modify the registry. The tools are described in more detail later in this chapter.

The simplest and safest way (and the recommended way) to modify the registry is to use the tools listed in Table 31.2.

Table 31.2 Recommended tools to modify the registry

Method Settings
Control Panel Most system settings. For example, you use Display properties to modify the appearance of screen elements.
System Policy Editor User settings, some system settings.
Third-party utilities Application-specific settings.

You can also modify the registry using Registry Editor, but use it sparingly and carefully. If you use Registry Editor, always back up the registry using Registry Checker before changing anything. See "Backing Up and Recovering the Registry" later in this chapter.

Wherever possible, use administrative tools, such as Control Panel or System Policy Editor to make configuration changes, rather than Registry Editor. This is to ensure values are stored properly in the registry when changing the configuration.

Registry Editor

The registry can be edited using the Registry Editor. The registry consists of various parallel "trees." Registry Editor is built on the RPC support and can edit the local Windows 98 registry as well as registries on remote computers running Windows 98. Registry Editor is powerful, yet rudimentary in design, and is intended for use by knowledgeable computer and network support staff, or power users. Most users will never use Registry Editor because registry entries are usually modified through the Control Panel, by applications, or by Plug and Play. Assigning an incorrect value to a registry entry or adding or deleting certain entries can result in a completely disabled operating system.

If you use Registry Editor to change values, you will not be warned if any entry is incorrect. Editing the registry directly by using Registry Editor can cause errors in loading hardware and software, and can prevent users from being able to start the computer.

Windows 98 writes much of its configuration information into two hidden files: System.dat and User.dat. These files are located in the directory specified during Setup that contains the Windows 98 files, which in most cases is C:\Windows. If the system is configured for multiple users, a separate User.dat file is created for each user, and each file is found in the user’s custom profiles area (Windows\Profiles\User_Name\User.dat). You can use the Registry Editor to edit the System.dat and User.dat files. The registry is automatically edited whenever the user makes changes through the Control Panel or from some other Windows 98 applet or application.

Any change made through the Registry Editor takes place immediately, and the new information is written into System.dat or User.dat, as appropriate.

Registry Checker

Registry Checker is a new system maintenance program that finds and fixes registry problems and that regularly backs up the registry. Windows 98 provides an MS-DOS-based program for scanning the registry, backing up, and restoring the registry and system configuration files. It also provides a Windows-based program for scanning and backing up the registry.

Registry Checker backs up the registry at startup, maintaining one backup for each day. It maintains up to five compressed backup copies of the registry. If a serious registry problem is found, Registry Checker restores the most recent registry from a backup copy. If a backup is not available, or if you type scanreg /fix at the command prompt, Registry Checker tries to repair the registry (you must exit Windows and run ScanReg from an MS-DOS command prompt).

Registries tend to grow in size, and the bigger the registry, the slower the performance. Registry Checker removes unused space in the registry, reducing the size of the registry file, and thus improving performance. During each boot, Registry Checker determines the amount of free space in the registry files. If there is an excess of free space, it compacts the registry, removing the excess.

Profile Editor

A user profile consists of user-specific information contained in the User.dat file, which is one of the three files in the Windows 98 registry. Optionally, a user profile can also contain special Windows 98 directories. You can enable user profiles after Windows 98 is installed, either locally on a single computer or for multiple computers. You can avoid having to go to each computer to enable user profiles by creating a system policy that can be downloaded automatically when the initial Windows 98 installation is complete. Profile Editor controls these user components of the registry.

System Policy Editor

The System Policy Editor (Poledit.exe) generates the system policies file, Policy.pol. This tool allows network administrators to define specific network policies or user configurations for Windows 98. A global system policy file can centrally enforce a common system configuration for all your users.

System Policy Editor is extensible by third parties; the ADM (administration configuration files) format is a text file that can be extended by network tool vendors or by network administrators as needed. The System Policy Editor works through local file I/O and is not RPC-enabled. Because the system policies file is located centrally on a network server, each server usually needs a copy. All the network administrator needs to do is connect to the network server and edit the system policies file.

Remote Registry Access

Many of the Win32 registry APIs use the remote procedure call (RPC) mechanism in Windows 98 to provide remote access to registry information across a network. As a result, desktop management applications can aid in the management and support of Windows-based computers, and the contents of the registry on a given computer can be queried over a network. Industry management mechanisms, such as Simple Network Management Protocol (SNMP) or DMI, can easily be integrated into Windows 98, simplifying the management and support burden of a management information systems (MIS) organization.

Overview of Other Registry Tools

The following is a description of additional tools for changing registry settings. These are the recommended tools for changing the registry.

Open With

Use the Open With dialog with the Windows shell to change the registered file types.

File Types

Select Folder Options from the View menu in Windows Explorer to access the File Types tab, which lets you inspect and alter registry settings for registered file types.

Control Panel

Control Panel contains several icons that, when double-clicked, will open property sheets. Registry settings can be altered with the property sheets.

Property sheets of applications

Some applications store their settings in the registry. You can update these settings by modifying the options in the appropriate application property sheet.

Device Manager

Use Device Manager to make direct modifications to system hardware and resource settings. Device Manager displays all the hardware on your computer, and gets this information from the registry.