#4978 Removed deprecated GetVersionEx call when checking Windows version
This commit is contained in:
parent
74c48c6516
commit
bc24568a6f
|
@ -35,6 +35,7 @@
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
|
#include <VersionHelpers.h>
|
||||||
|
|
||||||
AppUtilWindows::AppUtilWindows(IEventQueue* events) :
|
AppUtilWindows::AppUtilWindows(IEventQueue* events) :
|
||||||
m_events(events),
|
m_events(events),
|
||||||
|
@ -133,13 +134,8 @@ AppUtilWindows::beforeAppExit()
|
||||||
int
|
int
|
||||||
AppUtilWindows::run(int argc, char** argv)
|
AppUtilWindows::run(int argc, char** argv)
|
||||||
{
|
{
|
||||||
OSVERSIONINFO osvi;
|
if (!IsWindowsXPSP3OrGreater()) {
|
||||||
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
|
throw std::runtime_error("Synergy only supports Windows XP SP3 and above.");
|
||||||
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.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// record window instance for tray icon, etc
|
// record window instance for tray icon, etc
|
||||||
|
|
Loading…
Reference in New Issue