Commit cfeb27cc authored by Gilles Khouzam's avatar Gilles Khouzam Committed by Brad King
Browse files

SystemTools: Report Windows 7, 8, 8.1 and 10 by name

Change-Id: I552e0840b5c84187b67a781621c09b485d3e6048
parent 27714139
......@@ -4906,10 +4906,56 @@ std::string SystemTools::GetOperatingSystemNameAndVersion()
case VER_PLATFORM_WIN32_NT:
// Test for the specific product family.
if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0)
{
if (osvi.wProductType == VER_NT_WORKSTATION)
{
res += "Microsoft Windows 10";
}
else
{
res += "Microsoft Windows Server 2016 family";
}
}
if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 3)
{
if (osvi.wProductType == VER_NT_WORKSTATION)
{
res += "Microsoft Windows 8.1";
}
else
{
res += "Microsoft Windows Server 2012 R2 family";
}
}
if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 2)
{
if (osvi.wProductType == VER_NT_WORKSTATION)
{
res += "Microsoft Windows 8";
}
else
{
res += "Microsoft Windows Server 2012 family";
}
}
if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1)
{
if (osvi.wProductType == VER_NT_WORKSTATION)
{
res += "Microsoft Windows 7";
}
else
{
res += "Microsoft Windows Server 2008 R2 family";
}
}
if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0)
{
#if (_MSC_VER >= 1300)
if (osvi.wProductType == VER_NT_WORKSTATION)
{
res += "Microsoft Windows Vista";
......@@ -4918,9 +4964,6 @@ std::string SystemTools::GetOperatingSystemNameAndVersion()
{
res += "Microsoft Windows Server 2008 family";
}
#else
res += "Microsoft Windows Vista or Windows Server 2008";
#endif
}
if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2)
......@@ -4949,7 +4992,6 @@ std::string SystemTools::GetOperatingSystemNameAndVersion()
{
// Test for the workstation type.
#if (_MSC_VER >= 1300)
if (osvi.wProductType == VER_NT_WORKSTATION)
{
if (osvi.dwMajorVersion == 4)
......@@ -5021,7 +5063,6 @@ std::string SystemTools::GetOperatingSystemNameAndVersion()
}
}
}
#endif // Visual Studio 7 and up
}
// Test for specific product on Windows NT 4.0 SP5 and earlier
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment