From c97d77799833349b48b8b069d7a870e674ad879e Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Wed, 3 Mar 2010 22:06:03 +0000 Subject: [PATCH] - client: more Windows SKU detection changes (from: [P3D] Crashtest) client/ hostinfo_win.cpp svn path=/trunk/boinc/; revision=20782 --- checkin_notes | 7 +++++++ client/hostinfo_win.cpp | 45 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index c1c0e65bcf..007d4250de 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1584,3 +1584,10 @@ David 3 Mar 2010 sched_array.cpp handle_request.cpp sched_resend.cpp + +Rom 3 Mar 2010 + - client: more Windows SKU detection changes + (from: [P3D] Crashtest) + + client/ + hostinfo_win.cpp diff --git a/client/hostinfo_win.cpp b/client/hostinfo_win.cpp index 2cb7de6960..f1a49e4469 100644 --- a/client/hostinfo_win.cpp +++ b/client/hostinfo_win.cpp @@ -38,7 +38,17 @@ #include "idlemon.h" -// Newer system metrics values +// Newer system metrics values than what is currently defined in +// Visual Studio 2005 +#ifndef SM_TABLETPC +#define SM_TABLETPC 86 +#endif +#ifndef SM_MEDIACENTER +#define SM_MEDIACENTER 87 +#endif +#ifndef SM_STARTER +#define SM_STARTER 88 +#endif #ifndef SM_SERVERR2 #define SM_SERVERR2 89 #endif @@ -384,26 +394,38 @@ int get_os_information( } if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 ) + { strcat(os_name, "Windows XP"); + } if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 ) + { strcat(os_name, "Windows 2000"); + } if ( osvi.dwMajorVersion <= 4 ) + { strcat(os_name, "Windows NT"); + } break; case VER_PLATFORM_WIN32_WINDOWS: if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0) + { strcat(os_name, "Windows 95"); + } if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10) + { strcat( os_name, "Windows 98"); + } if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90) + { strcat( os_name, "Windows Millennium"); + } break; @@ -495,6 +517,12 @@ int get_os_information( } else if( (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) ) { if( osvi.wSuiteMask & VER_SUITE_PERSONAL ) { strcat(szSKU, "Home "); + } else if( GetSystemMetrics(SM_TABLETPC) ) { + strcat(szSKU, "Tablet PC "); + } else if( GetSystemMetrics(SM_MEDIACENTER) ) { + strcat(szSKU, "Media Center "); + } else if( GetSystemMetrics(SM_STARTER) ) { + strcat(szSKU, "Starter "); } else { strcat(szSKU, "Professional "); } @@ -552,6 +580,21 @@ int get_os_information( case PRODUCT_HOME_PREMIUM_SERVER: strcat( szSKU, "Home Premium Server "); break; + case PRODUCT_STORAGE_EXPRESS_SERVER: + strcat( szSKU, "Storage Server Express "); + break; + case PRODUCT_STORAGE_STANDARD_SERVER: + strcat( szSKU, "Storage Server Standard "); + break; + case PRODUCT_STORAGE_WORKGROUP_SERVER: + strcat( szSKU, "Storage Server Workgroup "); + break; + case PRODUCT_STORAGE_ENTERPRISE_SERVER: + strcat( szSKU, "Storage Server Enterprise "); + break; + case PRODUCT_SERVER_FOR_SMALLBUSINESS: + strcat( szSKU, "Server For Small Business "); + break; } } else if( (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) ) {