Merged View of HKEY_CLASSES_ROOT
The RegOpenUserClassesRoot function provides a merged view for processes, such as services, that are dealing with clients other than the interactive user. In this case, the HKEY_CLASSES_ROOT key provides a view of the registry that merges the information from HKEY_LOCAL_MACHINE\Software\Classes with the information from HKEY_CURRENT_USER\Software\Classes.
The system uses the following rules to merge information from the two sources:
- The merged view includes all subkeys of the HKEY_CURRENT_USER\Software\Classes key.
- The merged view includes all immediate subkeys of the HKEY_LOCAL_MACHINE\Software\Classes key that do not duplicate the subkeys of HKEY_CURRENT_USER\Software\Classes.
- At the end of this topic is a list of subkeys that are found in both HKEY_LOCAL_MACHINE\Software\Classes and HKEY_CURRENT_USER\Software\Classes. The immediate subkeys of these keys from the HKEY_LOCAL_MACHINE tree 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.
If an application is run with administrator rights and User Account Control is disabled, the COM runtime ignores per-user COM configuration and accesses only per-machine COM configuration. Applications that require administrator rights should register dependent COM objects during installation to the per-machine COM configuration store (HKEY_LOCAL_MACHINE\Software\Classes). For more information, see AC: UAC: COM Per-User Configuration.
Windows Server 2003 and Windows XP/2000: Applications can register dependent COM objects to either the per-machine or per-user COM configuration store (HKEY_LOCAL_MACHINE\Software\Classes or HKEY_CURRENT_USER\Software\Classes).
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 inprocserver32 localserver32 7
HKEY_CURRENT_USER\Software\Classes CLSID 1 4 localserver 6 10 localserver
HKEY_CLASSES_ROOT CLSID 1 2 4 inprocserver32 localserver localserver32 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.