VSS must be compiled and targeted specifically for each platform and OS, including Windows XP, Windows Server 2003, and Vista/Windows Server 2008.
The first Microsoft SDK to fully support VSS requesters is v6.1, and it only supports requesters running on Vista. If you want to run on Windows Server 2003 or XP:
- Download VSS SDK 7.2.
- Set your include and library paths to search the appropriate directory in the VSS SDK.
The following is what AlphaVSS does in its Config.h, but the VShadow sample in the VSS SDK does not: it only sets the include and library paths. I would suggest that following VShadow is more likely to succeed. But for completeness:
If targeting Windows XP:
#define NTDDI_VERSION NTDDI_WINXPSP2
#define _WIN32_WINNT _WIN32_WINNT_WINXP
#define WINVER _WIN32_WINNT
If targeting Windows Server 2003:
#define NTDDI_VERSION NTDDI_WS03SP1
#define _WIN32_WINNT _WIN32_WINNT_WS03
#define WINVER 0x501
If targeting Vista, don't reference the VSS SDK. Instead reference the Windows 6.1 SDK and:
#define NTDDI_VERSION NTDDI_WS08
#define _WIN32_WINNT _WIN32_WINNT_WS08
#define WINVER _WIN32_WINNT
I can't take all the credit for this, I figured this out by reading the source code of a project called AlphaVSS (see announcement), which exposes VSS to .NET code. MSDN did not seem to be very helpful. However, the VShadow tool and sample provided an example of how to compile a VSS requester.
Also note that you must recompile again for x64 or ia64 vs x86. That means in order to support all platforms, you'll need 9 compiled versions of your executable.