--- a/src/windows/native/java/lang/java_props_md.c Thu Apr 09 17:22:34 2009 -0700
+++ b/src/windows/native/java/lang/java_props_md.c Thu Apr 09 17:36:50 2009 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -693,7 +693,8 @@ GetJavaProperties(JNIEnv* env)
"GetNativeSystemInfo");
if(NULL != pGNSI)
pGNSI(&si);
- else GetSystemInfo(&si);
+ else
+ GetSystemInfo(&si);
/*
* From msdn page on OSVERSIONINFOEX, current as of this
@@ -716,6 +717,7 @@ GetJavaProperties(JNIEnv* env)
* Windows Vista family 6 0
* Windows 2008 6 0
* where ((&ver.wServicePackMinor) + 2) = 1
+ * Windows 7 6 1
*
* This mapping will presumably be augmented as new Windows
* versions are released.
@@ -772,13 +774,18 @@ GetJavaProperties(JNIEnv* env)
* 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; otherwise, it is Windows
+ * system is Windows Vista or 7; otherwise, it is Windows
* Server 2008."
*/
- if (ver.wProductType == VER_NT_WORKSTATION)
- sprops.os_name = "Windows Vista";
- else
+ if (ver.wProductType == VER_NT_WORKSTATION) {
+ switch (ver.dwMinorVersion) {
+ case 0: sprops.os_name = "Windows Vista"; break;
+ case 1: sprops.os_name = "Windows 7"; break;
+ default: sprops.os_name = "Windows NT (unknown)";
+ }
+ } else {
sprops.os_name = "Windows Server 2008";
+ }
} else {
sprops.os_name = "Windows NT (unknown)";
}