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
pull/1236/head
myfreeer 2018-07-08 19:49:07 +08:00 committed by GitHub
parent 475e6c5997
commit 76db5248cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 3 deletions

View File

@ -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;