Windows XP Application Compatibility Technologies
By Dave Morehouse, Todd Phillips
This paper describes in detail the application compatibility technologies of the Microsoft Windows XP operating system and then outlines how they can be used and extended to treat a wide range of application compatibility problems.
Mark Carroll, Lead Program Manager, Microsoft Corporation
Bryan Chee, Product Manager, Microsoft Corporation
Mark Derbecker, Software Design Engineer, Microsoft Corporation
Ryan Marshall, Program Manager, Microsoft Corporation
Brandon McMillon, Program Manager, Microsoft Corporation
On This Page
Application Compatibility Technologies
Application Database Files
Migration Compatibility Technologies
Using & Extending the Application Compatibility Technologies
In general, applications are highly optimized for a specific operating system or operating system version. Application compatibility problems can arise when users try to run their favorite programs on a newer version of the Microsoft Windows® operating system, for example, than the one for which the application was originally written. This may be especially true when migrating many older applications to Windows XP, because it is built upon the foundation of Windows NT® and Windows 2000, and not the consumer-oriented line of operating systems (Windows 95, Windows 98, and Windows Millennium Edition).
Because Windows NT and Windows 2000 are business operating systems, many application developers with the home user in mind have chosen to write their programs solely for Windows 95 and its successors. Accordingly, migrating these applications to Windows XP must take into account the differences in the respective operating system application programming interfaces (APIs). Some of these differences are due to the new features of Windows XP, but some are due to the more stringent programming requirements of the Windows NT code base.
Applications that worked on earlier versions of Windows may fail to function properly on Windows XP for a variety of reasons—an application may expect older formats of Windows data, or it may expect user information, such as that in personal and temporary folders, to be in specific locations or formats. Problems such as these mostly apply to applications written for Windows 95, Windows 98, or Windows Me, but some applications written for Windows NT or Windows 2000 may also be affected.
To solve this problem and so enable a better user experience with legacy applications, Microsoft has integrated application compatibility technologies into Windows XP that come into play whenever an application is installed on the operating system, whether in the course of a system upgrade or during regular operations. This article first describes these technologies in detail and then outlines how they can be used and extended, in particular with the supplemental tools available in the Application Compatibility Toolkit.
Application Compatibility Technologies
The application compatibility technologies of Windows XP fall into two distinct groups: the migration compatibility technologies that help migrate applications when upgrading from previous versions of Windows; and the compatibility fixes, compatibility modes, and Application Help that together support the installation and operation of applications on the Windows XP operating system. These technologies work by virtue of "matching information"—that is, the application-specific information that enables the operating system to identify applications and act appropriately, whether in administering compatibility fixes or delivering essential Help information to the user should there be a compatibility problem. Matching information for a given application may include the file name, its size, a checksum of the files contents, the file version, and similar kinds of data.
Why Application Compatibility Technologies Are Necessary
The introduction to this article has already listed a few of the reasons why application compatibility technologies are necessary: a change in data formats from one version to another of the operating system, or different locations or formats for user information. There are still other reasons. The application may refuse to run, for example, when Windows reports new, later version numbers. Often in cases like these, the application will work well on the new version of Windows if the user can get past this block in the application. Or, the application may call older versions of Microsoft Win32® API functions that return unexpected values on computers with large amounts of resources, such as free disk space.
Further, those who upgrade their computers specifically from Windows 95, Windows 98, or Windows Me may encounter compatibility problems, because applications written exclusively for that platform may use programmatic methods of hardware access that are not permitted on Windows XP. Direct hardware access can greatly reduce operating system stability, and because of its Windows NT heritage, Windows XP requires that hardware access be handled through the correct channels.
Applications originally written for Windows NT or Windows 2000, however, are unlikely to generate serious compatibility problems on Windows XP, given the common code base of these operating systems. Regardless, some applications may have been written to run on a single version of Windows NT, and may therefore require a compatibility fix to run properly on Windows XP.
Application Database Files
These technologies depend on—and are largely indistinguishable from—the application database files the operating system uses to interact with applications during their installation or operation. Aside from a quick application check routine in the loader, the application compatibility infrastructure itself lies outside of core operating system components like the kernel. It is invoked only when the loader's initial database query indicates that it is needed. This obviates the need for special compatibility code paths within the APIs themselves that may only be needed for one application. The compatibility fix support is not intrusive and does not significantly affect the performance of the operating system or installed applications.
The application database files are as follows:
MigDB.inf, which is used to support migration from Windows 95–, Windows 98–, and Windows Me–based systems. This file contains matching information and flags applications that are incompatible or require user intervention prior to system upgrade.
NTCompat.inf, which contains the same kinds of information as MigDB, but is used to support upgrades from Windows NT 4.0– and Windows 2000–based systems.
SysMain.sdb, which contains both matching information and compatibility fixes. It can be found in the %Windir%\AppPatch directory.
AppHelp.sdb, which stores only the Help messages that prompt users for patches, provides them with a URL from which to download non-Microsoft patches, or tells them where to find further information. This file is also found in the %Windir%\AppPatch directory.
Thus, MigDB and NTCompat inform the migration compatibility technologies of Windows XP, while both SysMain and AppHelp inform (and effectively contain) the compatibility technologies that come into play when installing and operating applications on Windows XP: compatibility fixes, compatibility modes, and Application Help.
Migration Compatibility Technologies
As outlined above, to help ensure successful migration of applications from Windows 95–, Windows 98–, and Windows Me–based systems on the one hand, or Windows NT- and Windows 2000–based systems on the other, Windows XP uses, respectively, the MigDB.inf and NTCompat.inf database files to identify known application compatibility problems. A compatibility check routine is performed during Windows XP Setup, which serves to warn the user of any serious compatibility problems before the setup routine is complete. Problematic applications are listed along with hardware compatibility information in the upgrade report generated by Setup. Both files were first included as part of Windows 2000 Setup and have been updated for Windows XP.
As noted above, the operating system uses matching information to determine how to interact with applications, specifically what fixes or messages to deliver for a given application. The compatibility fixes (also referred to as "shims" or "shim technology") contained in SysMain.sdb address common application compatibility problems when installing an application originally written for Windows 95, Windows 98, Windows NT 4.0, or Windows 2000. Fixes can provide simple solutions to the most common compatibility problems: For example, a fix might provide an older application with a previous operating system's credentials to enable the application to function properly. They can also be targeted at specific problems known to crop up with certain applications—such fixes might permit the operating system to ignore certain warnings or delay heap and memory release calls.
There will be roughly 200 compatibility fixes included in the SysMain database file at the time of the Windows XP release. These treat most of the compatibility problems that were encountered during the development of Windows XP. While software vendors, IT managers, and developers can use the existing fixes, they are not permitted to create new ones. This limitation is by design and is intended to reduce the risk to system security posed by allowing non-Microsoft parties to inject potentially harmful code into the loading process.
Compatibility modes—also referred to as " layers"—are essentially collections of compatibility fixes that serve to emulate a specific operating system environment for an application. For example, the Windows 95 Compatibility Mode contains approximately 50 of the most common fixes applied to older Windows 95 applications so they can function properly on Windows XP. Some of the fixes include: returning Windows 95 version credentials; precise emulation of the Windows 95/Windows 98/Windows Me heap manager; file path fixes to redirect Windows 95/Windows 98/Windows Me desktop and start menu folders to their Windows XP equivalents in the Documents and Settings folder; and registry virtualization to emulate Windows 95/Windows 98/Windows Me registry data.
There are three different kinds of modes:
End-user modes, which are displayed in the different shell features of Windows XP, such as the Compatibility tab or the Program Compatibility Wizard (discussed further below). Users can access five basic modes through the interface: Windows 95, Windows 98/Windows Me, Windows NT 4.0, Windows 2000, 256 colors, and 640 x 480 screen resolution.
System modes, which include all the end-user modes listed above plus a few other options that independent software vendors (ISVs), system administrators, and other IT professionals can use to control the behavior of their applications. These include the Limited User Account security mode and the Profiles mode. The Limited User Account mode is used when an application must operate under a limited security context for a particular user. The Profiles mode can be used to assist an application in determining how to interact with Windows XP user profiles. They can all be accessed and set using either the QFixApp or CompatAdmin tool, which are described in further detail in the next section of this article.
Custom modes, which a system administrator or other IT professional can create for a particular application or set of applications using the CompatAdmin tool (see the discussion below). Once created, custom modes can apply only to the specific application that the user is installing, and can use any specific fix in that package.
Even if Windows XP has already applied individual compatibility fixes from SysMain, users can still choose to apply one of the compatibility modes. When a compatibility mode is applied, all the contained fixes are concatenated and applied to the application whenever it is run. This can be a helpful option in treating compatibility problems for which fixes are unavailable in the SysMain database or online from Microsoft or from the software vendor.
When matching information determines that the user is about to run an incompatible application, Windows XP can either invoke a compatibility fix or generate a Help message in the user interface.
Application Help, the most severe of the compatibility technologies, is reserved for those situations where a fix may not be a viable (or available) solution for a compatibility problem. Its basic mechanism is simple: The operating system uses matching information in SysMain, which in turn determines what messages to draw from the AppHelp database to block the operation of applications with known compatibility problems and/or inform users about them.
More precisely, Application Help generates a localized message that is presented to the user when a problematic process is about to initiate. A dialog box appears containing a brief message about the problem, with the severity indicated by an icon. If the icon is a yellow triangle with an exclamation mark, then the application is not blocked, which means that the user will still be able to run the program.
Figure 1: Application Help message for a program incompatible with Windows XP.
If the icon is a red stop sign, as in Figure 1 above, then the application is blocked, which means that the user cannot run the program. Clicking the Details button enables the user to get more information. This additional information is displayed in the Windows XP Help and Support Center (see Figure 2 below), with the Help content coming from either Microsoft.com (if the computer is online), or a local HTML Help file (%Windir%\help\apps.chm).
Figure 2: Additional information on blocking problems is provided in the Help and Support Center.
Application Help is most commonly used to block low-level applications—such as antivirus and disk-access utilities—that were not written for or intended for use on Windows XP. By blocking the installation of these applications, this technology serves to avert serious problems that would compromise system integrity. This results in greater system stability and a more satisfying user experience.
Using & Extending the Application Compatibility Technologies
As discussed above, the application compatibility technologies built into Windows XP depend on database files that contain matching information, fixes, and Help content. While approximately 1,000 of the most popular applications are covered with these files, there are many that necessarily are not included, such as custom-built or niche applications. For cases like these, Microsoft provides additional services and tools that can help.
Updating the Core Database Files with Automated Services
Microsoft has provided two automated services for supplementing the compatibility information contained in the application database files of Windows XP:
Dynamic Update, a new feature of Windows XP that helps to ensure that you always have the most current drivers and compatibility files available. It operates as part of the Windows XP setup program, and checks for driver or patch files more current than those included on the Windows XP installation CD. If the computer is able to connect to the Internet when Setup begins, it checks for new drivers, software patches, and other critical updates, and then downloads them for automatic installation in the course of the setup routine.
Dynamic Update packages are posted to the Windows Update Web site as they become available. This is especially beneficial to those who may be installing Windows XP well after it has been released, and for whose applications new fixes and Help content may be available.
Windows Update, an online extension of Windows XP, providing a central location for product enhancements, such as service packs, device drivers, and system security updates. Thus, if your computer is connected to the Internet when you install a new application, Windows XP will not only refer to the local database files (SysMain and AppHelp), but can also search online at Windows Update for applicable compatibility fixes and other crucial data pertaining to the application.
Application Compatibility Tools in the User Interface
Microsoft has included two application compatibility tools within the Windows XP user interface: the Program Compatibility Wizard and the compatibility shell extension. Users can easily access and use these tools to adjust their application compatibility settings. These are designed to assist users with applications that are released after Windows XP, providing recourse in cases where the SysMain database has no information, and Windows Update cannot offer service.
Program Compatibility Wizard
In a large corporate environment, users can often rely on an internal technical support group for help in resolving application compatibility problems. At home or in smaller enterprise environments, users may have to perform their own application support. The Program Compatibility Wizard assists in this task.
The Program Compatibility Wizard is part of the Windows XP Help and Support Center, providing a convenient and simple tool for adjusting application compatibility settings. This wizard uses the compatibility fixes and Compatibility Modes provided by the SysMain database file. You can choose the application to modify by selecting the application from a list of applications with known problems, browsing for the application, or selecting the application in the CD-ROM drive.
Applying a compatibility mode with the Program Compatibility Wizard is as simple as choosing the operating system that runs the application correctly. There are four main options:
Microsoft Windows 95
Microsoft Windows NT 4.0 (Service Pack 5)
Microsoft Windows 98/Windows Me
Microsoft Windows 2000
You also have the option of bypassing the compatibility modes for the application. Figure 3 below shows the compatibility mode options presented in the Program Compatibility Wizard.
Figure 3: The Program Compatibility Wizard enables you to easily apply compatibility modes for an application.
Once you have selected the option you want, the Program Compatibility Wizard allows you to configure display settings to use with the application. Color depth and screen resolution are often the source of blocking problems for older applications. The fixes enabled in the wizard force the application to a screen resolution of 640 x 480 pixels, or force the color depth to 256 colors. In addition, you can also turn off the Windows XP visual themes for applications such as educational titles or games that may encounter problems with them.
In the final portion of the wizard, you can test the compatibility settings you have selected. If the application runs correctly when you test the compatibility settings, you have the option of making the settings permanent so that they will be invoked automatically every time you run the application.
Compatibility Shell Extension
Advanced users of Windows XP may choose to use a more direct method of adjusting the basic application compatibility settings. The same functionality provided by the Program Compatibility Wizard is available on the Compatibility tab of an executable file's Properties dialog box, as shown in Figure 4 below.
Figure 4: The compatibility shell extension creates a Compatibility tab for each executable file.
The exposed compatibility settings are separated into two group boxes: Compatibility mode and Display settings. The Compatibility mode group box enables you to select the operating system on which the executable file will run correctly. This applies the appropriate compatibility mode whenever the executable file is run. The Display settings group box lets you apply changes to the color depth, screen resolution, and Windows XP visual themes.
Tools for Creating a Custom Application Compatibility Database
In addition to the user interface tools for application compatibility, there are two tools that are designed for the use of experienced system administrators and IT support staff: QFixApp and CompatAdmin. These are especially helpful in supporting applications not catalogued in the local or online application compatibility databases. Both can be found in the Application Compatibility Toolkit, available online from Microsoft.
QFixApp is a small application that provides an interface to the database of compatibility fixes included with the operating system. The tool is relatively simple to use: You need only browse for the executable file to be fixed and select the compatibility modes or fixes you want to apply (see Figure 5 below). This is a manual process—not semi-automated like that of the Program Compatibility Wizard—but it enables you to gain precise control over the compatibility fixes applied to your application. Another benefit to QFixApp is that it doesn't require the application to be included in the list of applications with known compatibility problems. QFixApp can be very useful to those who want to determine the correct fixes to apply to their custom applications.
Figure 5: QFixApp allows precise control over the fixes to apply to applications.
The QFixApp.exe tool enables you to select any executable file and apply to it one or more of the fixes available in the SysMain database (of which there will be approximately 200 shipped with the product). You can use QFixApp to identify which combinations of fixes enable your application to work on Windows XP.
To use QFixApp, begin by deciding whether you want to use a compatibility mode or a compatibility fix. The Layers tab allows you to choose compatibility modes, and the Fixes tab allows you to specify individual fixes, alone or severally. It is usually best to begin with a compatibility mode if you know that the application ran successfully on another version of Windows. Once you have made your selections, click the Run button, and QFixApp will then test the combination of fixes. (QFixApp uses the support utility ShimDBC.exe to test the group of selected fixes.)
In a larger network environment there may be more applications that require the help of Windows XP application compatibility technologies. And because of the distributed nature of large networks, getting the correct bundle of compatibility fixes to users may be difficult and time-consuming. Microsoft has provided the Compatibility Administration Tool (CompatAdmin) to help administrators easily assemble and distribute packages of compatibility fixes.
CompatAdmin provides an interface for browsing and editing the Windows XP compatibility fix database (see Figure 6 below). The tool allows you to select any executable file and apply one or more of the numerous fixes available in the operating system. When you've determined all of the fixes needed to run the application, you can use CompatAdmin to create a package to deploy these fixes to other Windows XP–based computers.
Figure 6: The CompatAdmin tool helps create packages of compatibility fixes for deployment to other computers.
CompatAdmin includes a search capability that locates "fixed" applications on your system or network drives, and analyzes them for the group of fixes being used. This helps simplify the process of creating a package of compatibility fixes to deploy. CompatAdmin contains a list of the applications that Microsoft has identified as needing one or more compatibility fixes to operate correctly on Windows XP.
CompatAdmin provides support for creating and maintaining custom compatibility databases. This is one of the most useful aspects of the tool. The current custom database is displayed in the window in the lower left hand corner of the main CompatAdmin view. When you start CompatAdmin the custom database area is opened with a new, empty database. You can use the options in the Database menu to add to or remove from your custom database any specific fixes or custom compatibility modes you might define as shown in Figure 7 below.
Figure 7: CompatAdmin includes a wizard to assist in creating a custom compatibility mode.
The menu options may only be enabled if you have selected the custom database window and/or a valid entry. Once you have added all of the necessary compatibility fixes to your custom database, you can save the database and then distribute it to any Windows XP–based computer that requires the compatibility fixes.
Windows XP supports a broad base of applications. For those applications that may not run correctly on this new operating system, Microsoft has provided a variety of application compatibility technologies and the tools to use and extend these technologies.
The Windows XP application compatibility technologies depend on database files to identify and fix applications that may not otherwise run on Windows XP. The database files that are used in upgrading from Windows 95, Windows 98, and Windows Millennium on the one hand, or Windows NT and Windows 2000 on the other, are MigDB.inf and NTCompat.inf, respectively. The database files used for application compatibility after Windows XP is installed are SysMain.sdb, which contains the matching information and compatibility fixes; and AppHelp.sdb, which contains the Help messages that alert users to application compatibility problems that have no current fix.
Windows XP includes the Program Compatibility Wizard to assist users in applying compatibility fixes to their own applications through the Help and Support Center. Experienced users can modify the properties of an executable file using the Compatibility tab in the application's Properties dialog box to apply compatibility fixes. Network administrators and IT support staff can use the QFixApp and CompatAdmin tools to apply custom compatibility fixes to applications, and then distribute those bundles of compatibility fixes to the users on the network.
For the latest information on Windows XP, check out our Web site at https://www.microsoft.com/windowsxp.