Thursday, April 22, 2010

Visual C++ 2010 Apps Don't Support Windows 2000

One of the rather important things missing in the list of Breaking Changes for Visual C++ in Visual Studio 2010 is that applications generated by VS2010 no longer support Windows 2000. Usage of W2K has fallen under 0.5%, but that's still a very large number of users. This was pointed out by Martin Richter in the Community Content. However, the actual story is a little more complex.

I built a C++ application to see what functions are actually being called. When examined in DEPENDS under Windows 2000, these are the functions that are undefined:

DecodePointer

EncodePointer

ReleaseActCtx

CreateActCtxW

ActivateActCtx

DeactivateActCtx

The interesting thing is the DecodePointer and EncodePointer are documented as only being available in Windows XP Service Pack 2 or later. This means that the minimum system requirements for an application generated by Visual C++ 2010 is WinXP SP2, or Windows Server 2003 SP1 for server versions of Windows.

In addition, DUMPBIN shows that the required version of Windows has been bumped from 5.00 to 5.01, which is Windows XP.

What's really annoying is that none of these calls are required under Windows 2000. These calls appear to be an artificial limitation purely for the purposes of preventing end-of-life versions of Windows from working properly.

8 comments:

If you're feeling adventurous, you may want to get the KnownDlls wrapper for Windows 2000 from http://www7.atwiki.jp/win2000/pages/17.html

The wrapper for kernel32.dll that it can install implements all of the functions you listed.

The OS and subsystem version numbers showing in DUMPBIN are a quick fix in a hex editor, so at least that part is easier to deal with than having to install a kernel wrapper on every PC that will run your applications.

I approved the comment from Anonymous about EncodePointerLib because someone might find it helpful, but it's important to note that it's GPL and therefore, if you have a commercial application, don't even waste your time looking at it.

At three lines of assembly code, this may be the smallest GPL project, ever. What a waste. The project would be much more useful if it were MIT License or Public Domain.

Sorry, I don't think I made my point clearly. I think the library is very valuable, otherwise I wouldn't have mentioned it on my blog. It may only be three lines, but the research to build it was non-trivial.

The waste is that the license prevents it from being used by the commercial market, which is where the vast majority of Windows 2000 boxes are located. Enthusiast/open source users are almost certainly not running Windows 2000. Therefore, the author has developed a very handy library, only to use a license that prohibits the people who need it most.

About Me

My technical passion is for building consumer software applications. I'm best known for my work in Windows and C++, but lately I've been working on cross platform Android/iPhone mobile solutions in Flutter and Dart.

My book Multithreading Applications Win32 was one of the top 3 best-selling books on Amazon on Windows development for over five years. I've been the architect of software projects for Google, Intel, Brother, Northrop Grumman, and numerous smaller companies.

Click "Email" in my profile to contact me.

I have been writing commercial software for Microsoft operating systems since MS-DOS 1.0. I am published in magazines such as Dr. Dobbs Journal, C++ Users Journal, and Visual C++ Developers Journal. I am in the Giant List of Classic Game Programmers.