提交 d6334386 编写于 作者: A alanb

6843003: Windows Server 2008 R2 system recognition

Reviewed-by: ohair, sherman
上级 00a46fcf
...@@ -714,10 +714,10 @@ GetJavaProperties(JNIEnv* env) ...@@ -714,10 +714,10 @@ GetJavaProperties(JNIEnv* env)
* Windows XP 64 bit 5 2 * Windows XP 64 bit 5 2
* where ((&ver.wServicePackMinor) + 2) = 1 * where ((&ver.wServicePackMinor) + 2) = 1
* and si.wProcessorArchitecture = 9 * and si.wProcessorArchitecture = 9
* Windows Vista family 6 0 * Windows Vista family 6 0 (VER_NT_WORKSTATION)
* Windows 2008 6 0 * Windows Server 2008 6 0 (!VER_NT_WORKSTATION)
* where ((&ver.wServicePackMinor) + 2) = 1 * Windows 7 6 1 (VER_NT_WORKSTATION)
* Windows 7 6 1 * Windows Server 2008 R2 6 1 (!VER_NT_WORKSTATION)
* *
* This mapping will presumably be augmented as new Windows * This mapping will presumably be augmented as new Windows
* versions are released. * versions are released.
...@@ -768,14 +768,7 @@ GetJavaProperties(JNIEnv* env) ...@@ -768,14 +768,7 @@ GetJavaProperties(JNIEnv* env)
} }
} else if (ver.dwMajorVersion == 6) { } else if (ver.dwMajorVersion == 6) {
/* /*
* From MSDN OSVERSIONINFOEX documentation: * See table in 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."
*/ */
if (ver.wProductType == VER_NT_WORKSTATION) { if (ver.wProductType == VER_NT_WORKSTATION) {
switch (ver.dwMinorVersion) { switch (ver.dwMinorVersion) {
...@@ -784,7 +777,11 @@ GetJavaProperties(JNIEnv* env) ...@@ -784,7 +777,11 @@ GetJavaProperties(JNIEnv* env)
default: sprops.os_name = "Windows NT (unknown)"; default: sprops.os_name = "Windows NT (unknown)";
} }
} else { } 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 { } else {
sprops.os_name = "Windows NT (unknown)"; sprops.os_name = "Windows NT (unknown)";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册