What does a manifest's supportedOS setting actually do behind the scenes? What does a manifest's supportedOS setting actually do behind the scenes? windows windows

What does a manifest's supportedOS setting actually do behind the scenes?


Pseudo code for how Windows reads the supportedOS values might look something like this:

double compatVer = 4.0; // Win95if (hasW10guid && _WIN_VER >= 0xa00)  compatVer = 10.0;else if (hasW81guid && _WIN_VER >= 0x603)  compatVer = 6.3;else if (hasW8guid && _WIN_VER >= 0x602)  compatVer = 6.2;else if (hasW7guid && _WIN_VER >= 0x601)  compatVer = 6.1;else if (hasWVistaguid && _WIN_VER >= 0x601)  compatVer = 6.0; // Application wants Vista compatibility on Win7+else if (hasRequestedExecutionLevel)  compatVer = 6.0; // UAC compatible

compatVer is stored somewhere internally in the process, probably in the PEB.

compatVer is compared to the real Windows version inside certain functions to either enable new features or change its behavior so it is compatible with the Windows version the application was designed for. Some of the behavior changes are documented in the compatibility cookbook on MSDN.

Because the supportedOS values are GUIDs they are impossible to guess so developers cannot claim support for Windows versions that have not been released yet. Therefore the Windows 8 GUID will have no effect when the application runs on Windows 7.

There is a risk that your application has a bug that is hidden by compatibility behavior and it might be exposed by adding supportedOS values...