From 32f715f1d723e2bbb78b44fa9e167da64214e2e6 Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Sat, 24 Jun 2017 23:41:20 +0200 Subject: [PATCH] Fix Windows XP support on Visual Studio 2015+ (#439) When compiling with Visual Studio 2015+, Crypto++ uses CryptoNG by default. CryptoNG is only available on Windows Vista and later and Crypto++ currently ignores if the user explicitly wants to target Windows XP. Unlike with other Windows SDK features, everything compiles, but the application doesn't start on Windows XP because bcrypt.dll is missing. That is an issue when updating Visual Studio because the root cause is hard to find. Making use of CryptoNG when targeting Windows 8+ instead by default, regardless of the Visual Studio version, to fix this. --- config.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.h b/config.h index d21b0d4a..291b1488 100644 --- a/config.h +++ b/config.h @@ -44,10 +44,10 @@ // This macro will be ignored if NO_OS_DEPENDENCE is defined. // #define USE_MS_CNGAPI -// If the user did not make a choice, then select CryptoNG if either -// Visual Studio 2015 is available, or Windows 10 or above is available. +// If the user did not make a choice, then select CryptoNG if +// targeting Windows 8 or above. #if !defined(USE_MS_CRYPTOAPI) && !defined(USE_MS_CNGAPI) -# if (_MSC_VER >= 1900) || ((WINVER >= 0x0A00 /*_WIN32_WINNT_WIN10*/) || (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/)) +# if !defined(_USING_V110_SDK71_) && ((WINVER >= 0x0602 /*_WIN32_WINNT_WIN8*/) || (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/)) # define USE_MS_CNGAPI # else # define USE_MS_CRYPTOAPI