Platform SDK: Registry

Merged View of HKEY_CLASSES_ROOT

Starting with Windows 2000, class registration and file extension information is stored under both the HKEY_LOCAL_MACHINE key and the HKEY_CURRENT_USER key. The HKEY_LOCAL_MACHINE\Software\Classes key contains default settings that can apply to all users on the local computer. The HKEY_CURRENT_USER\Software\Classes key contains settings that apply only to the interactive user. The HKEY_CLASSES_ROOT key provides a view of the registry that merges the information from these two sources.

The RegOpenUserClassesRoot function provides a similar merged view for processes, such as Win32 services, that are dealing with clients other than the interactive user. In this case, the view merges the HKEY_LOCAL_MACHINE\Software\Classes information with the information from the Software\Classes key of the user's registry hive.

The system uses the following rules to merge information from the two sources:

The following example shows a set of subkeys under the HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER keys and the resulting merged view of HKEY_CLASSES_ROOT.

HKEY_LOCAL_MACHINE\Software\Classes

    \CLSID

        \2

        \4

            \localserver32

            \inprocserver32

        \7

HKEY_CURRENT_USER\Software\Classes

    \CLSID

        \1

        \4

            \localserver

        \6

        \10

            \localserver

HKEY_CLASSES_ROOT

    \CLSID

        \1

        \2

        \4

            \localserver

        \6

        \7

        \10

            \localserver

The following subkeys are found in both HKEY_LOCAL_MACHINE\Software\Classes and HKEY_CURRENT_USER\Software\Classes. From the HKEY_LOCAL_MACHINE tree, the immediate subkeys of these keys are included in the merged view only if they are not duplicates of immediate subkeys from the HKEY_CURRENT_USER tree. The merged view does not include the HKEY_LOCAL_MACHINE contents of duplicate subkeys.

    \*
    \*\shellex
    \*\shellex\ContextMenuHandlers
    \*\shellex\PropertyShellHandlers
    \AppID
    \ClsID
    \Component Categories
    \Drive
    \Drive\shellex
    \Drive\shellex\ContextMenuHandlers
    \Drive\shellex\PropertyShellHandlers
    \FileType
    \Folder
    \Folder\shellex
    \Folder\shellex\ColumnHandler
    \Folder\shellex\ContextMenuHandlers
    \Folder\shellex\ExtShellFolderViews
    \Folder\shellex\PropertySheetHandlers
    \Installer\Components
    \Installer\Features
    \Installer\Products
    \Interface
    \Mime
    \Mime\Database
    \Mime\Database\Charset
    \Mime\Database\Codepage
    \Mime\Database\Content Type
    \Typelib)