Partager via


Understanding and Using Compatibility Fixes

Applies To: Windows 7, Windows Vista

Application experience and compatibility on the various Windows® operating systems is one of the fundamental pillars of Windows development, along with performance, reliability, and manageability. To reduce deployment costs and accelerate adoption, Microsoft invests in deep technical solutions that ensure broad compatibility with existing software and drives compatibility into the engineering and release process. One such solution is the Microsoft Windows Application Compatibility Infrastructure (also known as the Compatibility Fix infrastructure). As the operating system evolves from version to version to support new technology, to support new features and functionality, and to incorporate bug fixes, the implementations used by some functions may change, causing problems for the applications that relied upon the original implementation. Due to the nature of software, modifying the function again to resolve this compatibility issue could break additional applications.

How the Compatibility Fix Infrastructure Works

You can circumvent the compatibility problem by using the Compatibility Fix infrastructure to target a specific application fix, for a particular application (and typically for particular versions of that application). The Compatibility Fix infrastructure implements a form of application programming interface (API) hooking, which uses the inherent linking ability of the APIs to redirect from Windows code directly to alternative code that constitutes the compatibility fix. The Windows Portable Executable File Format includes a number of headers that contain the data directories that are used to provide a layer of indirection between the application and the linked file. API calls to the external binary files take place through the Import Address Table (IAT), which then calls into the Windows operating system, as shown in the following figure.

Specifically, the process follows these steps:

  1. The fix modifies the address of the affected Windows function.

  2. The address is resolved in the IAT table.

  3. The information is replaced with a pointer to a function in our alternate compatibility fix code, shown in the following figure.

Note

The code redirection occurs as the application loads for statically linked DLLs. You can also fix dynamically linked DLLs by hooking into the GetProcAddress API.

Design Implications of the Compatibility Fix Infrastructure

There are consequences due to the design of the Compatibility Fix infrastructure, which you might find relevant when determining your application fix strategy.

  • The compatibility fix remains outside of the Windows operating system (as shown in the previous figure). Therefore, Windows holds the compatibility-fix code to the same security restrictions as the application code, which means that you cannot use compatibility fixes to bypass any of the security mechanisms that are present in the operating system. As such, the use of compatibility fixes in your corporation does not expose you to more security vulnerability and can, in fact, provide you with a method to avoid the need to loosen security descriptors or to make your security policy less stringent.

  • The Compatibility Fix infrastructure injects additional code into the application before it calls to the operating system. This means that any remedy that can be accomplished by a compatibility fix can also be addressed by fixing the application code.

  • The compatibility fixes run as user-mode code inside of a user-mode application process. This means that you cannot use a compatibility fix to fix kernel-mode code issues. For example, you cannot use a compatibility fix to resolve device-driver issues.

Note

Some antivirus, firewall, and anti-spyware code runs in kernel mode.

Determining When to Use a Compatibility Fix

The decision to use compatibility fixes to remedy your compatibility issues is more than just a technical question. The following scenarios reflect the common reasons when and why a corporation uses a compatibility fix.

Scenario 1

The compatibility issue exists on an application from a vendor who no longer exists.

As in many companies, you may run applications for which the vendor has gone out of business or for which they have ended support. In these situations, you cannot have the vendor make the fix, nor can you access the source code to modify the issue yourself. However, it is possible that the use of a compatibility fix might resolve the compatibility issue.

Scenario 2

The compatibility issue is on an internally created application.

While you would prefer to fix the application code to resolve the issue, this is not always possible. Your internal team might not be able to fix all of the issues prior to the deployment of the new operating system. Instead, they might choose to employ a compatibility fix anywhere that it is possible. Then they fix the code only for issues that cannot be resolved in this manner. Through this method, your team can modify the application as time permits, without delaying the deployment of the new operating system into your environment.

Scenario 3

The compatibility issue exists on an application for which a compatible version is to be released in the near future, or an application that is non-critical to the organization, regardless of its version.

In the situation where an application is either unimportant to your organization, or for which a newer, compatible version is to be released shortly, you can use the compatibility fixes as a temporary solution. This means that you can continue to use the application without delaying the deployment of a new operating system, with the intention of updating your configuration as soon as the new version is released.

Determining Which Version of an Application to Fix

You can apply a compatibility fix to particular versions of an application, either by using the "up to or including" clause or by selecting that specific version. This means that the next version of the application will not have the compatibility fix automatically applied. This is important, because it allows you to continue to use your application, but it also encourages the vendor to fix the application.

Support for Compatibility Fixes

Compatibility fixes are shipped as part of the Windows operating system and are updated by using Windows Update. Therefore, they are supported in the same manner as the rest of Windows. You can apply the compatibility fixes to any of your applications. However, Microsoft does not provide the tools to use the Compatibility Fix infrastructure to create your own custom fixes.

See Also

Concepts

Managing Application-Compatibility Fixes and Custom Fix Databases
Known Compatibility Fixes, Compatibility Modes, and AppHelp Messages

Other Resources

Testing and Mitigating Issues by Using the Development Tools