summaryrefslogtreecommitdiffstats
path: root/src/misc.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-09-03 08:16:31 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2009-09-03 08:16:31 +0200
commit733a732f03a44bf8a096b61ec659aa0d3f5409c6 (patch)
treef99dea73adeccbf802e3b949cbcc36019bf9cbb8 /src/misc.c
parent093f5e44858b364c98511153d8710a9c390ae1b5 (diff)
Detect Windows server 2008 and Windows server 2008 R2
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/misc.c b/src/misc.c
index 4a04ce9..cea9e5c 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -126,15 +126,23 @@ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/ge
}
else if (Ver.dwMajorVersion == 6 && Ver.dwMinorVersion == 0)
{
- snprintf(buffer, sizeof(buffer) - 1, "Windows Vista (%lu)", Ver.dwBuildNumber);
+ if( Ver.wProductType == VER_NT_WORKSTATION )
+ snprintf(buffer, sizeof(buffer) - 1, "Windows Vista (%lu)", Ver.dwBuildNumber);
+ else
+ snprintf(buffer, sizeof(buffer) - 1, "Windows Server 2008 (%lu)", Ver.dwBuildNumber);
}
- else if (Ver.dwMajorVersion == 6 && Ver.dwMinorVersion > 0)
+ else if (Ver.dwMajorVersion == 6 && Ver.dwMinorVersion == 1)
{
- snprintf(buffer, sizeof(buffer) - 1, "Windows Server 2007 (%lu)", Ver.dwBuildNumber);
+ if( Ver.wProductType == VER_NT_WORKSTATION )
+ snprintf(buffer, sizeof(buffer) - 1, "Windows 7 (%lu)", Ver.dwBuildNumber);
+ else
+ snprintf(buffer, sizeof(buffer) - 1, "Windows Server 2008 R2 (%lu)", Ver.dwBuildNumber);
}
else
{
- snprintf(buffer, sizeof(buffer) - 1, "Windows %i.%i.%i",(int)Ver.dwMajorVersion,(int)Ver.dwMinorVersion,(int)Ver.dwBuildNumber);
+ snprintf(buffer, sizeof(buffer) - 1, "Windows %s %i.%i.%i",
+ (Ver.wProductType == VER_NT_WORKSTATION ? "WorkStation" : Server),
+ (int)Ver.dwMajorVersion, (int)Ver.dwMinorVersion, (int)Ver.dwBuildNumber);
}
if (Extended && Ver.wServicePackMajor != 0) {