Windows ships to all customers, including government customers, with an enormous integrated database of special app detection logic to keep weird and broken old programs, such as the 1998 game Barbie Riding Club, still working on newer editions of Windows. https://twitter.com/0xBanana/status/1363244737243869185
In a certain sense, every program on Windows begins by asking itself the perennial question: am I the 1998 Barbie Riding Club game, or can I run the program normally?
(Bizarrely, this arguably one of the most important design features in Windows, because without it Windows would struggle to improve over time without breaking apps that folks like and that are never gonna get updated. Also it's genuine technical wizardry under the hood)
My second favorite obscure fact about Windows is that DirectX has specific kernel improvements designed to make World of Warcraft shaders run faster
OK, why not, here's the story of an appcompat shim I heard ages ago and long ago lost the reference for (and can't find it in 10 minutes of googling), just to show you the insanity of appcompat.
Long ago, back in the mists of time, Microsoft invented a new operating system called Windows Vista. Customers were using Windows XP, and naturally expected most of their apps to work on this new fangled Vista beast.
One of these apps was an ill-fated PDF reader, whose author shall remain nameless, and for legal reasons let's pretend it's not Adobe even though we all know that it definitely is.
The problem with said PDF reader was that it ran fine on XP, but when you ran it on Vista it had a pretty annoying problem. The "paper" background showed up as black. Everything else worked. But this gets pretty annoying when most documents expect black text on *white* background
After a bunch of digging, Microsoft eventually discovers the problem. The PDF reader wasn't clearing the paper background with the "Solid white" brush; they were clearing it with a brush called "window text"
"Window text" is the color of the text in your window title bar. Which on XP happens to be white, because it's white text on a cheerful blue bubbly background.

But Vista does not have blue and bubbly windows. It has windows that are very serious and adult and made of glass.
And, so, here we find our problem. Vista's "window text" color is black, to contrast with the glass, not white to contrast with the blue bubble. And so on XP, clearing the paper to "window text" color gave you white paper. And on Vista, the paper came out black.
So here come Microsoft's appcompat shims to the rescue. Microsoft added an entry relating to this PDF reader to their database, causing Windows to act in a very narrowly different way when running this app compare to every other app on the system.
If any other app asked windows: "hey, what color is the window text"?, Vista would say "uh, black, I guess".

But if *this* app asked, Microsoft would shamelessly and viciously lie to it, knowing that the truth of the true window text color was too much for the PDF app to handle
Instead, for this app, and this app only, Windows would report the window text color as *white*, so that when the PDF reader cleared the page background with it, the page would be visible, and all would be well.
This is a great question, and perhaps not super intuitive why https://twitter.com/YGalanter/status/1363271364925399046
The reason is threefold.
1) Lots of apps, especially old games, would never update. Games make a lot of money in the first few weeks and months after release, and that drops like a stone shortly afterwards, and the developers move on to new games, not maintaining the old ones.
2) Even older apps that *did* update, often updated via major releases, often requiring a new payment for the updated version, rather than being interested in keeping a library of old versions up-to-date for latest-and-greatest operating systems.
But third, and most importantly, when you upgrade your OS and half of your apps don't work on it, most customers think "wow, this OS sucks", not "wow, those app developers sucked". Which makes it a Microsoft problem, no matter how you try to rationalize that it shouldn't be.
Another good question is "why doesn't Apple have to do this" and the answer is "it does, just differently". Appcompat is the curse of owning a popular platform. https://twitter.com/chrisatlatenite/status/1214832204687134720
You can follow @pwnallthethings.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: