Using the EmulateSorting Fix

Applies To: Windows 7, Windows Vista

This section includes information about using the EmulateSorting compatibility fix, including the issue details, the intercepted APIs, and the recommended fix for a permanent solution.

EmulateSorting

EmulateSorting fixes an issue whereby an application returns the incorrect values from the CompareString and LCMapString API calls, due to sorting table changes made for the Windows Vista operating system.

An application that builds data structures, which are based on the specific values returned by an operating system, cannot be effectively searched on another operating system due to changes in the sorting tables. An example usage of these data structures is within search trees. This issue appears most commonly in East Asian languages. For this specific fix, EmulateSorting passes a flag to the CompareString and LCMapString API calls and requests that they use the older sorting tables.

Investigating the Issue

The EmulateSorting compatibility fix should be considered as a possible resolution when your searches begin to fail.

Intercepted APIs

The following APIs are intercepted by the EmulateSorting compatibility fix.

  • CompareStringW

  • CompareStringA

  • LCMapStringW

  • LCMapStringA

Fixing Your Code

Applications should be modified so that they do not depend on stored return values from the CompareString* and LCMapString* API calls in order to build search trees. Instead, your search trees should be constructed directly on the targeted operating system to resolve this issue.

See Also

Concepts

Windows Vista and Windows 7 Operating Systems