From 76db5248cf59d7d540edbfe26ec402493eba3320 Mon Sep 17 00:00:00 2001 From: myfreeer Date: Sun, 8 Jul 2018 19:49:07 +0800 Subject: [PATCH] FeatureConfig: add os info for newer windows * dwMajorVersion == 10 * Windows 10 * Windows Server 2016 * dwMinorVersion == 2 * Windows 8 * Windows Server 2012 * dwMinorVersion == 3 * Windows 8.1 * Windows Server 2012 R2 --- src/FeatureConfig.cc | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/FeatureConfig.cc b/src/FeatureConfig.cc index 2b43c8b1..6e6dfead 100644 --- a/src/FeatureConfig.cc +++ b/src/FeatureConfig.cc @@ -314,7 +314,15 @@ std::string getOperatingSystemInfo() rv << "Legacy, probably XP"; return rv.str(); } - switch (ovi.dwMinorVersion) { + else if (ovi.dwMajorVersion == 10) { + if (ovi.wProductType == VER_NT_WORKSTATION) { + rv << "10"; + } + else { + rv << "Server 2016"; + } + } + else switch (ovi.dwMinorVersion) { case 0: if (ovi.wProductType == VER_NT_WORKSTATION) { rv << "Vista"; @@ -333,9 +341,25 @@ std::string getOperatingSystemInfo() } break; - default: - // Windows above 6.2 does not actually say so. :p + case 2: + if (ovi.wProductType == VER_NT_WORKSTATION) { + rv << "8"; + } + else { + rv << "Server 2012"; + } + break; + case 3: + if (ovi.wProductType == VER_NT_WORKSTATION) { + rv << "8.1"; + } + else { + rv << "Server 2012 R2"; + } + break; + + default: rv << ovi.dwMajorVersion; if (ovi.dwMinorVersion) { rv << "." << ovi.dwMinorVersion;