diff --git a/src/lib/synergy/ArgParser.cpp b/src/lib/synergy/ArgParser.cpp index 7220c583..ad779127 100644 --- a/src/lib/synergy/ArgParser.cpp +++ b/src/lib/synergy/ArgParser.cpp @@ -27,6 +27,8 @@ #include "base/Log.h" #include "base/String.h" +#include + ArgsBase* ArgParser::m_argsBase = NULL; ArgParser::ArgParser(App* app) : @@ -309,12 +311,7 @@ ArgParser::parseGenericArgs(int argc, const char* const* argv, int& i) #ifdef WINAPI_MSWINDOWS - OSVERSIONINFO osvi; - ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&osvi); - - if (osvi.dwMajorVersion < 6) { + if (!IsWindowsVistaOrGreater()) { useDragDrop = false; LOG((CLOG_INFO "ignoring --enable-drag-drop, not supported below vista.")); } diff --git a/src/lib/synwinhk/synwinhk.cpp b/src/lib/synwinhk/synwinhk.cpp index 7412755e..56458548 100644 --- a/src/lib/synwinhk/synwinhk.cpp +++ b/src/lib/synwinhk/synwinhk.cpp @@ -728,19 +728,19 @@ static EWheelSupport getWheelSupport() { - // get operating system - OSVERSIONINFO info; - info.dwOSVersionInfoSize = sizeof(info); - if (!GetVersionEx(&info)) { - return kWheelNone; - } - // see if modern wheel is present if (GetSystemMetrics(SM_MOUSEWHEELPRESENT)) { - // note if running on win2k - if (info.dwPlatformId == VER_PLATFORM_WIN32_NT && - info.dwMajorVersion == 5 && - info.dwMinorVersion == 0) { + OSVERSIONINFOEX osvi; + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + osvi.dwPlatformId = VER_PLATFORM_WIN32_NT; + osvi.dwMajorVersion = 5; + osvi.dwMinorVersion = 0; + ULONGLONG condMask = 0; + VER_SET_CONDITION (condMask, VER_MAJORVERSION, VER_EQUAL); + VER_SET_CONDITION (condMask, VER_MINORVERSION, VER_EQUAL); + VER_SET_CONDITION (condMask, VER_PLATFORMID, VER_EQUAL); + if (VerifyVersionInfo(&osvi, VER_MAJORVERSION | VER_MINORVERSION | + VER_PLATFORMID, condMask)) { return kWheelWin2000; } return kWheelModern;