From: LoRd_MuldeR Date: Sun, 25 Jan 2015 19:50:21 +0000 (+0100) Subject: Fixed Windows 10 detection. It appears that after a series of brain-dead version... X-Git-Tag: v1.02~15 X-Git-Url: http://git.osdn.net/view?p=mutilities%2FMUtilities.git;a=commitdiff_plain;h=e33d869f5927ccf16f8576d6173ec434aa2426cc Fixed Windows 10 detection. It appears that after a series of brain-dead version numbers in Windows 7 (v6.1), Windows 8 (v6.2) and Windows 8.1 (v6.3), we are back to sanity now. --- diff --git a/src/OSSupport_Win32.cpp b/src/OSSupport_Win32.cpp index 4f91dff..4a2872b 100644 --- a/src/OSSupport_Win32.cpp +++ b/src/OSSupport_Win32.cpp @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // MuldeR's Utilities for Qt -// Copyright (C) 2004-2014 LoRd_MuldeR +// Copyright (C) 2004-2015 LoRd_MuldeR // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -193,14 +193,14 @@ namespace MUtils bool os_version_t::operator<= (const os_version_t &rhs) const { return (type == rhs.type) && ((versionMajor < rhs.versionMajor) || ((versionMajor == rhs.versionMajor) && (versionMinor <= rhs.versionMinor))); } //Known Windows NT versions - const os_version_t WINDOWS_WIN2K = { OS_WINDOWS, 5, 0 }; // 2000 - const os_version_t WINDOWS_WINXP = { OS_WINDOWS, 5, 1 }; // XP - const os_version_t WINDOWS_XPX64 = { OS_WINDOWS, 5, 2 }; // XP_x64 - const os_version_t WINDOWS_VISTA = { OS_WINDOWS, 6, 0 }; // Vista - const os_version_t WINDOWS_WIN70 = { OS_WINDOWS, 6, 1 }; // 7 - const os_version_t WINDOWS_WIN80 = { OS_WINDOWS, 6, 2 }; // 8 - const os_version_t WINDOWS_WIN81 = { OS_WINDOWS, 6, 3 }; // 8.1 - const os_version_t WINDOWS_WN100 = { OS_WINDOWS, 6, 4 }; // 10 + const os_version_t WINDOWS_WIN2K = { OS_WINDOWS, 5, 0 }; // 2000 + const os_version_t WINDOWS_WINXP = { OS_WINDOWS, 5, 1 }; // XP + const os_version_t WINDOWS_XPX64 = { OS_WINDOWS, 5, 2 }; // XP_x64 + const os_version_t WINDOWS_VISTA = { OS_WINDOWS, 6, 0 }; // Vista + const os_version_t WINDOWS_WIN70 = { OS_WINDOWS, 6, 1 }; // 7 + const os_version_t WINDOWS_WIN80 = { OS_WINDOWS, 6, 2 }; // 8 + const os_version_t WINDOWS_WIN81 = { OS_WINDOWS, 6, 3 }; // 8.1 + const os_version_t WINDOWS_WN100 = { OS_WINDOWS, 10, 0 }; // 10 //Unknown OS const os_version_t UNKNOWN_OPSYS = { OS_UNKNOWN, 0, 0 }; // N/A @@ -223,7 +223,7 @@ static bool verify_os_version(const DWORD major, const DWORD minor) //Initialize the condition mask VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL); VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_GREATER_EQUAL); - VER_SET_CONDITION(dwlConditionMask, VER_PLATFORMID, VER_EQUAL); + VER_SET_CONDITION(dwlConditionMask, VER_PLATFORMID, VER_EQUAL); // Perform the test const BOOL ret = VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_PLATFORMID, dwlConditionMask); diff --git a/src/Startup.cpp b/src/Startup.cpp index d1bea27..b656582 100644 --- a/src/Startup.cpp +++ b/src/Startup.cpp @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // MuldeR's Utilities for Qt -// Copyright (C) 2004-2014 LoRd_MuldeR +// Copyright (C) 2004-2015 LoRd_MuldeR // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -252,7 +252,7 @@ QApplication *MUtils::Startup::create_qt(int &argc, char **argv, const QString & { const QString message = QString().sprintf("Running on an unknown WindowsNT-based system (v%u.%u).", osVersion.versionMajor, osVersion.versionMinor); qWarning("%s\n", MUTILS_UTF8(message)); - MUtils::OS::system_message_wrn(MUTILS_WCHR(message), L"LameXP"); + MUtils::OS::system_message_wrn(L"LameXP", MUTILS_WCHR(message)); } //Check for compat mode