Switch back to GetVersionEx() to avoid depending on the win8 SDK just for VersionHelpers.h

This commit is contained in:
Thomas Goyne 2016-04-02 11:24:07 -07:00
parent 2720d8c0dc
commit 43f5af556d
1 changed files with 8 additions and 2 deletions

View File

@ -30,13 +30,19 @@ namespace bfs = boost::filesystem;
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <versionhelpers.h>
#undef CreateDirectory
namespace {
FINDEX_INFO_LEVELS find_info_level() {
return IsWindows7OrGreater() ? FindExInfoBasic : FindExInfoStandard;
OSVERSIONINFO osvi = {};
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
if (osvi.dwMajorVersion > 6 || (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion >= 1))
return FindExInfoBasic;
else
return FindExInfoStandard;
}
}