#4978 Removed deprecated usage of GetVersionEx

This commit is contained in:
Andrew Nelless 2016-06-24 15:37:34 +01:00 committed by Jerry (Xinyu Hou)
parent 3ead310161
commit 04184b51ea
2 changed files with 14 additions and 17 deletions

View File

@ -27,6 +27,8 @@
#include "base/Log.h" #include "base/Log.h"
#include "base/String.h" #include "base/String.h"
#include <VersionHelpers.h>
ArgsBase* ArgParser::m_argsBase = NULL; ArgsBase* ArgParser::m_argsBase = NULL;
ArgParser::ArgParser(App* app) : ArgParser::ArgParser(App* app) :
@ -309,12 +311,7 @@ ArgParser::parseGenericArgs(int argc, const char* const* argv, int& i)
#ifdef WINAPI_MSWINDOWS #ifdef WINAPI_MSWINDOWS
OSVERSIONINFO osvi; if (!IsWindowsVistaOrGreater()) {
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
if (osvi.dwMajorVersion < 6) {
useDragDrop = false; useDragDrop = false;
LOG((CLOG_INFO "ignoring --enable-drag-drop, not supported below vista.")); LOG((CLOG_INFO "ignoring --enable-drag-drop, not supported below vista."));
} }

View File

@ -728,19 +728,19 @@ static
EWheelSupport EWheelSupport
getWheelSupport() getWheelSupport()
{ {
// get operating system
OSVERSIONINFO info;
info.dwOSVersionInfoSize = sizeof(info);
if (!GetVersionEx(&info)) {
return kWheelNone;
}
// see if modern wheel is present // see if modern wheel is present
if (GetSystemMetrics(SM_MOUSEWHEELPRESENT)) { if (GetSystemMetrics(SM_MOUSEWHEELPRESENT)) {
// note if running on win2k OSVERSIONINFOEX osvi;
if (info.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
info.dwMajorVersion == 5 && osvi.dwPlatformId = VER_PLATFORM_WIN32_NT;
info.dwMinorVersion == 0) { 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 kWheelWin2000;
} }
return kWheelModern; return kWheelModern;