changeset 1378:b22f9e823be7

6843003: Windows Server 2008 R2 system recognition Reviewed-by: ohair, sherman
author alanb
date Tue, 30 Jun 2009 11:11:10 +0100
parents 424420bf5917
children d57c10cf07c5
files src/windows/native/java/lang/java_props_md.c
diffstat 1 files changed, 10 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/java/lang/java_props_md.c	Mon Jun 29 15:08:52 2009 +0100
+++ b/src/windows/native/java/lang/java_props_md.c	Tue Jun 30 11:11:10 2009 +0100
@@ -714,10 +714,10 @@
          * Windows XP 64 bit            5               2
          *       where ((&ver.wServicePackMinor) + 2) = 1
          *       and  si.wProcessorArchitecture = 9
-         * Windows Vista family         6               0
-         * Windows 2008                 6               0
-         *       where ((&ver.wServicePackMinor) + 2) = 1
-         * Windows 7                    6               1
+         * Windows Vista family         6               0  (VER_NT_WORKSTATION)
+         * Windows Server 2008          6               0  (!VER_NT_WORKSTATION)
+         * Windows 7                    6               1  (VER_NT_WORKSTATION)
+         * Windows Server 2008 R2       6               1  (!VER_NT_WORKSTATION)
          *
          * This mapping will presumably be augmented as new Windows
          * versions are released.
@@ -768,14 +768,7 @@
                 }
             } else if (ver.dwMajorVersion == 6) {
                 /*
-                 * From MSDN OSVERSIONINFOEX documentation:
-                 *
-                 * "Because the version numbers for Windows Server 2008
-                 * and Windows Vista are identical, you must also test
-                 * whether the wProductType member is VER_NT_WORKSTATION.
-                 * If wProductType is VER_NT_WORKSTATION, the operating
-                 * system is Windows Vista or 7; otherwise, it is Windows
-                 * Server 2008."
+                 * See table in MSDN OSVERSIONINFOEX documentation.
                  */
                 if (ver.wProductType == VER_NT_WORKSTATION) {
                     switch (ver.dwMinorVersion) {
@@ -784,7 +777,11 @@
                     default: sprops.os_name = "Windows NT (unknown)";
                     }
                 } else {
-                    sprops.os_name = "Windows Server 2008";
+                    switch (ver.dwMinorVersion) {
+                    case  0: sprops.os_name = "Windows Server 2008";    break;
+                    case  1: sprops.os_name = "Windows Server 2008 R2"; break;
+                    default: sprops.os_name = "Windows NT (unknown)";
+                    }
                 }
             } else {
                 sprops.os_name = "Windows NT (unknown)";