Add vista check to sys_info

This commit is contained in:
Doug MacEachern 2006-09-30 18:36:12 +00:00
parent bd0514ee52
commit 182d078581
1 changed files with 10 additions and 2 deletions

View File

@ -2736,11 +2736,11 @@ int sigar_os_sys_info_get(sigar_t *sigar,
version.dwOSVersionInfoSize = sizeof(version); version.dwOSVersionInfoSize = sizeof(version);
GetVersionEx(&version); GetVersionEx(&version);
if (sigar->winnt) { if (version.dwMajorVersion == 4) {
vendor_name = "Windows NT"; vendor_name = "Windows NT";
vendor_version = "NT"; vendor_version = "NT";
} }
else { else if (version.dwMajorVersion == 5) {
switch (version.dwMinorVersion) { switch (version.dwMinorVersion) {
case 0: case 0:
vendor_name = "Windows 2000"; vendor_name = "Windows 2000";
@ -2761,6 +2761,14 @@ int sigar_os_sys_info_get(sigar_t *sigar,
break; break;
} }
} }
else if (version.dwMajorVersion == 6) {
switch (version.dwMinorVersion) {
default:
vendor_name = "Windows Vista";
vendor_version = "Vista";
break;
}
}
SIGAR_SSTRCPY(sysinfo->name, "Win32"); SIGAR_SSTRCPY(sysinfo->name, "Win32");
SIGAR_SSTRCPY(sysinfo->vendor, "Microsoft"); SIGAR_SSTRCPY(sysinfo->vendor, "Microsoft");