From 8c9833920e75cb0ff1f224624dd84447c1e16b7a Mon Sep 17 00:00:00 2001 From: Sebastien Barre <sebastien.barre@kitware.com> Date: Thu, 16 Oct 2008 19:30:49 -0400 Subject: [PATCH] ENH: fix for Vista --- SystemInformation.cxx | 23 +++++++++++++++-------- SystemTools.cxx | 2 +- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/SystemInformation.cxx b/SystemInformation.cxx index daf7ba3..27b4af7 100644 --- a/SystemInformation.cxx +++ b/SystemInformation.cxx @@ -2980,15 +2980,22 @@ bool SystemInformationImplementation::QueryOSInformation() { if (osvi.wProductType == VER_NT_WORKSTATION) { -// VER_SUITE_PERSONAL may not be defined -#ifdef VER_SUITE_PERSONAL - if (osvi.wSuiteMask & VER_SUITE_PERSONAL) + if (osvi.dwMajorVersion == 6) { - this->OSRelease += " Personal"; + this->OSRelease = "Vista"; } - else +// VER_SUITE_PERSONAL may not be defined +#ifdef VER_SUITE_PERSONAL + else { - this->OSRelease += " Professional"; + if (osvi.wSuiteMask & VER_SUITE_PERSONAL) + { + this->OSRelease += " Personal"; + } + else + { + this->OSRelease += " Professional"; + } } #endif } @@ -3015,7 +3022,7 @@ bool SystemInformationImplementation::QueryOSInformation() } } - sprintf (operatingSystem, "%s(Build %ld)", osvi.szCSDVersion, osvi.dwBuildNumber & 0xFFFF); + sprintf (operatingSystem, "%s (Build %ld)", osvi.szCSDVersion, osvi.dwBuildNumber & 0xFFFF); this->OSVersion = operatingSystem; } else @@ -3095,7 +3102,7 @@ bool SystemInformationImplementation::QueryOSInformation() else { // Windows 2000 and everything else. - sprintf (operatingSystem,"%s(Build %ld)", osvi.szCSDVersion, osvi.dwBuildNumber & 0xFFFF); + sprintf (operatingSystem,"%s (Build %ld)", osvi.szCSDVersion, osvi.dwBuildNumber & 0xFFFF); this->OSVersion = operatingSystem; } break; diff --git a/SystemTools.cxx b/SystemTools.cxx index 9de3189..e443d26 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -4182,7 +4182,7 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion() res += "Microsoft Windows Server 2008 family"; } #else - res += "Microsoft Windows Vista or Windows Server 2003"; + res += "Microsoft Windows Vista or Windows Server 2008"; #endif } -- GitLab