What does Windows do for an application when it starts in compatibility mode?
Inserts several compatible gaskets that mimic old behavior or errors. Sometimes it is necessary, the behavior of some programs depends on old errors that have been fixed; or they used undocumented features.
Joel's blog entry, How Microsoft Lost the API , gives a good example:
I first heard about this from one of the developers of the hit game SimCity, who told me that there was a critical error in his application: she used memory right after it was released, a big no, what happened to work fine on DOS, but it wonβt run on Windows, where freed memory is likely to be captured by another running application right away. The testers in the Windows team went through various popular applications, testing them to make sure they were working fine, but SimCity continued to crash. They reported this to the Windows developers who parsed SimCity, went through it in the debugger, found an error and added special code that checked if SimCity was working, and if so, launched the memory allocator in a special mode in which you can still use memory after its release.
What are intended for compatibility. Paste obsolete behavior. Should it report another version of Windows; make specific API behavior in a different way; or disable some other Windows features that may cause problems like Aero.
Technical details of gaskets are here .
The Shim framework implements an API connection method. In particular, it uses the nature of binding to redirect API calls from Windows itself to an alternative code - the configuration itself. The Windows Portable Executable (PE) and Common Object File Format (COFF) specifications include several headers, and the data directories in this header provide an indirect layer between the application and the associated file. External binary calls are made through the import address table (IAT).
Is there a way to define compatibility mode settings in .NET?
Question Is the program working in compatibility mode gives an appropriate answer.
source share