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.
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
ReplyDeleteThe 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.
Create a .LIB that implements the missing functionality and link it ahead of KERNEL32.LIB.
ReplyDeleteYou will need to use the linker option /NODEFAULTLIB:kernel32.lib so that you can put your w2kcompat.lib ahead of kernel32.lib.
The system requirements listed for the Visual C++ redistributable package are: Windows 7; Windows Server 2003 R2 (32-Bit x86); Windows Server 2003 Service Pack 2; Windows Server 2008 R2; Windows Server 2008 Service Pack 2; Windows Vista Service Pack 2; Windows XP Service Pack 3
ReplyDeletehere's my attempt (statically linked MFC 2010 app on Windows 2000 SP4 + update rollup 1): http://tedwvc.wordpress.com/2010/11/07/how-to-get-visual-c-2010-mfc-applications-to-run-on-windows-2000/
ReplyDelete