提交 76e07c76 编写于 作者: X xlu

6719981: Update Hotspot Windows os_win32 for windows XP 64 bit and windows 2008

Reviewed-by: dholmes, kamg
上级 02f9bb4c
......@@ -1447,6 +1447,10 @@ void os::print_dll_info(outputStream *st) {
enumerate_modules(pid, _print_module, (void *)st);
}
// function pointer to Windows API "GetNativeSystemInfo".
typedef void (WINAPI *GetNativeSystemInfo_func_type)(LPSYSTEM_INFO);
static GetNativeSystemInfo_func_type _GetNativeSystemInfo;
void os::print_os_info(outputStream* st) {
st->print("OS:");
......@@ -1460,15 +1464,46 @@ void os::print_os_info(outputStream* st) {
}
int os_vers = osvi.dwMajorVersion * 1000 + osvi.dwMinorVersion;
if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) {
switch (os_vers) {
case 3051: st->print(" Windows NT 3.51"); break;
case 4000: st->print(" Windows NT 4.0"); break;
case 5000: st->print(" Windows 2000"); break;
case 5001: st->print(" Windows XP"); break;
case 5002: st->print(" Windows Server 2003 family"); break;
case 6000: st->print(" Windows Vista"); break;
case 5002:
case 6000: {
// Retrieve SYSTEM_INFO from GetNativeSystemInfo call so that we could
// find out whether we are running on 64 bit processor or not.
SYSTEM_INFO si;
ZeroMemory(&si, sizeof(SYSTEM_INFO));
// Check to see if _GetNativeSystemInfo has been initialized.
if (_GetNativeSystemInfo == NULL) {
HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
_GetNativeSystemInfo =
CAST_TO_FN_PTR(GetNativeSystemInfo_func_type,
GetProcAddress(hKernel32,
"GetNativeSystemInfo"));
if (_GetNativeSystemInfo == NULL)
GetSystemInfo(&si);
} else {
_GetNativeSystemInfo(&si);
}
if (os_vers == 5002) {
if (osvi.wProductType == VER_NT_WORKSTATION &&
si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
st->print(" Windows XP x64 Edition");
else
st->print(" Windows Server 2003 family");
} else { // os_vers == 6000
if (osvi.wProductType == VER_NT_WORKSTATION)
st->print(" Windows Vista");
else
st->print(" Windows Server 2008");
if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
st->print(" , 64 bit");
}
break;
}
default: // future windows, print out its major and minor versions
st->print(" Windows NT %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
}
......@@ -1481,7 +1516,6 @@ void os::print_os_info(outputStream* st) {
st->print(" Windows %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
}
}
st->print(" Build %d", osvi.dwBuildNumber);
st->print(" %s", osvi.szCSDVersion); // service pack
st->cr();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册