#4978 Removed deprecated GetVersionEx call when checking Windows version

This commit is contained in:
Andrew Nelless 2016-06-24 13:30:44 +01:00 committed by Jerry (Xinyu Hou)
parent 74c48c6516
commit bc24568a6f
1 changed files with 4 additions and 8 deletions

View File

@ -35,6 +35,7 @@
#include <sstream>
#include <iostream>
#include <conio.h>
#include <VersionHelpers.h>
AppUtilWindows::AppUtilWindows(IEventQueue* events) :
m_events(events),
@ -133,13 +134,8 @@ 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