One of the features that we pried away from Windows for Windows 7 is Windows Mail. You can, of course, install Windows Live Mail to get the evolution of the same product, another mail reader of your choosing, or just use web based mail – it’s not as if we’re ending mail as we know it.
However, we’re an app platform company, and removing anything has its impact. And yes, there were public APIs to drive Windows Mail.
This is a good way to illustrate exactly how hard you have to try to get an application to break on Windows 7. (Well, there’s always the sure-fire easy formula to get an app that breaks: reverse engineer Windows, write code around what you find, and then hope we never change it. But here I’m talking about apps that were technically following the rules.)
Let’s take one API: CoStartOutlookExpress. Seems straightforward enough, and it doesn’t work on Windows 7. But let’s really dig into it, because I’m guessing you probably don’t use this API too often in your code. If you follow the trail of execution far enough, you find yourself in msoert2.dll, in a little function that’s determining if you’re going to work or not. Let’s unassemble that function:
msoert2.dll Section .text (0x43D01000)
CALL DWORD PTR [KERNEL32.DLL!GetModuleFileNameW]
CALL DWORD PTR [SHLWAPI.DLL!PathFindFileNameW]
CALL DWORD PTR [MSVCRT.DLL!_wcsicmp]
You don’t have to be a master of assembly language, just read the functions. Here’s what we’re doing:
- Get the name of the file that’s calling the API
- Determine if that file is winmail.exe
Yep – that’s right, if you wanted to use this API, you had to name your executable winmail.exe or it wouldn’t work. So, yeah – if you did that, then we’re going to break you.
And the fact that I’m here telling you about this is because people have done exactly that. Man, app compat sure is hard…