200 likes | 380 Views
Microsoft Windows Internals, 4 ed. Chapter 4. Management Mechanisms The Registry 965202095 謝承璋 2008 年 05 月 07 日. Introduction. The registry is the repository for both systemwide and per-user settings. Regedit.exe A tool for editing the registry.
E N D
Microsoft Windows Internals, 4ed • Chapter 4. Management Mechanisms • The Registry 965202095謝承璋 2008年05月07日
Introduction • The registry is the repository for both systemwide and per-user settings. • Regedit.exe • A tool for editing the registry. • Windows Server 2003 Deployment Kit http://www.microsoft.com/windowsserver2003/techinfo/reskit/deploykit.mspx.
Registry Usage • 3 principal times that configuration data is read: • During the boot process. • During login. • During applications' startup. • On an idle system there should be no registry activity.
Registry Data Types • The registry is a database whose structure is similar to that of a disk volume. • The registry contains keys, which are similar to a disk's directories, and values, which are comparable to files on a disk. • A key is a container that can consist of subkeys or values. • Values store data. • Top-level keys are root keys. • Only root keys are not subkeys.
Registry Data Types (Cont.) • Regedit displays the unnamed value as (Default). • The majority of registry values are REG_DWORD, REG_BINARY, or REG_SZ. • The REG_LINK type lets a key transparently point to another key or value. • Links aren't saved; they must be dynamically created after each reboot.
Registry Logical Structure • Why do root-key names begin with an H? • Because the root-key names represent Windows handles (H) to keys (KEY).
HKEY_CURRENT_USER • The HKCU root key contains • the preferences and software configuration of the locally logged-on user. • It points to the currently logged-on user's user profile, located on the hard disk at • \Documents and Settings\<username>\Ntuser.dat.
HKEY_USERS • HKU contains • a subkey for each loaded user profile and user class registration database on the system. • It also contains a subkey named HKU\.DEFAULT that is linked to the profile for the system.
HKEY_USERS (Cont.) • The following registry value defines the location of system profiles • HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList\ProfilesDirectory. • It is by default set to • %SystemDrive%\Documents and Settings.
HKEY_CLASSES_ROOT • The data under HKEY_CLASSES_ROOT comes from two sources: • 1. The per-user class registration data in HKCU\SOFTWARE\Classes • 2. Systemwide class registration data in HKLM\SOFTWARE\Classes
HKEY_CLASSES_ROOT (Cont.) • The reason that there is a separation of per-user registration data from systemwide registration data is customizations. • Nonprivileged users can read systemwide data. • They can add new keys and values to systemwide data (which are mirrored in their per-user data). • But they can modify existing keys and values in their private data only.
HKEY_LOCAL_MACHINE • HKLM is the root key that contains all the systemwide configuration subkeys: • HARDWARE • SAM • SECURITY • SOFTWARE • SYSTEM.
HKLM • The HKLM\HARDWARE subkey maintains descriptions of the system's hardware and all hardware device-to-driver mappings. • HKLM\SAM holds local account and group information, such as user passwords, group definitions, and domain associations. • HKLM\SECURITY stores systemwide security policies and user-rights assignments. • HKLM\SAM is linked into the SECURITY subkey under HKLM\SECURITY\SAM.
HKLM (Cont.) • HKLM\SOFTWARE is where Windows stores systemwide configuration information not needed to boot the system. • HKLM\SYSTEM contains the systemwide configuration information needed to boot the system, such as which device drivers to load and which services to start. • last known good control set
HKEY_CURRENT_CONFIG • HKEY_CURRENT_CONFIG is just a link to the current hardware profile, stored under HKLM\SYSTEM\CurrentControlSet\Hardware Profiles\Current.
HKEY_PERFORMANCE_DATA • You won't find HKEY_PERFORMANCE_DATA by looking in the Registry Editor. • This key is available only programmatically through the Windows registry functions, such as • RegQueryValueEx. • Performance Data Helper API (Pdh.dll).