From bc24568a6f4efb851398dc415caf903b7eabd6d5 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 24 Jun 2016 13:30:44 +0100 Subject: [PATCH] #4978 Removed deprecated GetVersionEx call when checking Windows version --- src/lib/synergy/win32/AppUtilWindows.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lib/synergy/win32/AppUtilWindows.cpp b/src/lib/synergy/win32/AppUtilWindows.cpp index 0a8ae000..5e336088 100644 --- a/src/lib/synergy/win32/AppUtilWindows.cpp +++ b/src/lib/synergy/win32/AppUtilWindows.cpp @@ -35,6 +35,7 @@ #include #include #include +#include AppUtilWindows::AppUtilWindows(IEventQueue* events) : m_events(events), @@ -133,14 +134,9 @@ AppUtilWindows::beforeAppExit() int AppUtilWindows::run(int argc, char** argv) { - OSVERSIONINFO osvi; - ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&osvi); - - if (osvi.dwMajorVersion < 5 || (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion < 1)) { - throw std::runtime_error("synergy only supports windows xp and above."); - } + if (!IsWindowsXPSP3OrGreater()) { + throw std::runtime_error("Synergy only supports Windows XP SP3 and above."); + } // record window instance for tray icon, etc ArchMiscWindows::setInstanceWin32(GetModuleHandle(NULL));