Bagikan melalui


Using the VirtualizeRegisterTypeLib Fix

Applies To: Windows 7, Windows Vista

This section includes information about using the VirtualizeRegisterTypeLib compatibility fix, including the usage and API-related information.

VirtualizeRegisterTypeLib

The VirtualizeRegisterTypeLib compatibility fix enables an application to register a COM component’s type library at runtime, instead of at install time, by redirecting the type library registration from HKEY_CLASSES_ROOT to HKEY_CURRENT_USER, which enables the application correctly function as a Standard User.

Note

Issues that occur due to the registration of the COM component itself must be resolved by using the VirtualizeHKCRLite compatibility fix.

Investigating the Issue

You can verify whether the VirtualizeRegisterTypeLib compatibility fix will resolve your registration issues by using a registry monitoring tool, such as the Sysinternals' Process Monitor to record your issue. After recording the issue, you can review the ACCESS DENIED results for the HKEY_CLASSES_ROOT and Typelib functions. You can also review the stack for the Access Denied call for the RegisterTypeLib API.

Note

We recommend that you try applying the VirtualizeHKCRLite compatibility fix before attempting the registry monitoring process, as the VirtualizeHKCRLite fix is known to correct many of the common registry issues.

Intercepted APIs

The RegisterTypeLib API is intercepted and replaced with a call to the RegisterTypeLibForUser API.

Fixing Your Code

As a general rule, applications should register COM components and type libraries at installation, when the installer is given elevated privileges. For applications that must install components at runtime, the installation should be done on a per-user basis, instead of a per-computer basis. For example, the call to the RegisterTypeLib function should be replaced with a call to the RegistryTypeLibForUser function.

See Also

Concepts

Windows Vista and Windows 7 Operating Systems