1445 int pid = os::current_process_id(); |
1445 int pid = os::current_process_id(); |
1446 st->print_cr("Dynamic libraries:"); |
1446 st->print_cr("Dynamic libraries:"); |
1447 enumerate_modules(pid, _print_module, (void *)st); |
1447 enumerate_modules(pid, _print_module, (void *)st); |
1448 } |
1448 } |
1449 |
1449 |
|
1450 // function pointer to Windows API "GetNativeSystemInfo". |
|
1451 typedef void (WINAPI *GetNativeSystemInfo_func_type)(LPSYSTEM_INFO); |
|
1452 static GetNativeSystemInfo_func_type _GetNativeSystemInfo; |
|
1453 |
1450 void os::print_os_info(outputStream* st) { |
1454 void os::print_os_info(outputStream* st) { |
1451 st->print("OS:"); |
1455 st->print("OS:"); |
1452 |
1456 |
1453 OSVERSIONINFOEX osvi; |
1457 OSVERSIONINFOEX osvi; |
1454 ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); |
1458 ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); |
1455 osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); |
1459 osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); |
1456 |
1460 |
1457 if (!GetVersionEx((OSVERSIONINFO *)&osvi)) { |
1461 if (!GetVersionEx((OSVERSIONINFO *)&osvi)) { |
1458 st->print_cr("N/A"); |
1462 st->print_cr("N/A"); |
1459 return; |
1463 return; |
1460 } |
1464 } |
1461 |
1465 |
1462 int os_vers = osvi.dwMajorVersion * 1000 + osvi.dwMinorVersion; |
1466 int os_vers = osvi.dwMajorVersion * 1000 + osvi.dwMinorVersion; |
1463 |
1467 if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { |
1464 if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { |
1468 switch (os_vers) { |
1465 switch (os_vers) { |
1469 case 3051: st->print(" Windows NT 3.51"); break; |
1466 case 3051: st->print(" Windows NT 3.51"); break; |
1470 case 4000: st->print(" Windows NT 4.0"); break; |
1467 case 4000: st->print(" Windows NT 4.0"); break; |
1471 case 5000: st->print(" Windows 2000"); break; |
1468 case 5000: st->print(" Windows 2000"); break; |
1472 case 5001: st->print(" Windows XP"); break; |
1469 case 5001: st->print(" Windows XP"); break; |
1473 case 5002: |
1470 case 5002: st->print(" Windows Server 2003 family"); break; |
1474 case 6000: { |
1471 case 6000: st->print(" Windows Vista"); break; |
1475 // Retrieve SYSTEM_INFO from GetNativeSystemInfo call so that we could |
1472 default: // future windows, print out its major and minor versions |
1476 // find out whether we are running on 64 bit processor or not. |
1473 st->print(" Windows NT %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion); |
1477 SYSTEM_INFO si; |
1474 } |
1478 ZeroMemory(&si, sizeof(SYSTEM_INFO)); |
1475 } else { |
1479 // Check to see if _GetNativeSystemInfo has been initialized. |
1476 switch (os_vers) { |
1480 if (_GetNativeSystemInfo == NULL) { |
1477 case 4000: st->print(" Windows 95"); break; |
1481 HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll")); |
1478 case 4010: st->print(" Windows 98"); break; |
1482 _GetNativeSystemInfo = |
1479 case 4090: st->print(" Windows Me"); break; |
1483 CAST_TO_FN_PTR(GetNativeSystemInfo_func_type, |
1480 default: // future windows, print out its major and minor versions |
1484 GetProcAddress(hKernel32, |
1481 st->print(" Windows %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion); |
1485 "GetNativeSystemInfo")); |
1482 } |
1486 if (_GetNativeSystemInfo == NULL) |
1483 } |
1487 GetSystemInfo(&si); |
1484 |
1488 } else { |
1485 st->print(" Build %d", osvi.dwBuildNumber); |
1489 _GetNativeSystemInfo(&si); |
1486 st->print(" %s", osvi.szCSDVersion); // service pack |
1490 } |
1487 st->cr(); |
1491 if (os_vers == 5002) { |
|
1492 if (osvi.wProductType == VER_NT_WORKSTATION && |
|
1493 si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) |
|
1494 st->print(" Windows XP x64 Edition"); |
|
1495 else |
|
1496 st->print(" Windows Server 2003 family"); |
|
1497 } else { // os_vers == 6000 |
|
1498 if (osvi.wProductType == VER_NT_WORKSTATION) |
|
1499 st->print(" Windows Vista"); |
|
1500 else |
|
1501 st->print(" Windows Server 2008"); |
|
1502 if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) |
|
1503 st->print(" , 64 bit"); |
|
1504 } |
|
1505 break; |
|
1506 } |
|
1507 default: // future windows, print out its major and minor versions |
|
1508 st->print(" Windows NT %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion); |
|
1509 } |
|
1510 } else { |
|
1511 switch (os_vers) { |
|
1512 case 4000: st->print(" Windows 95"); break; |
|
1513 case 4010: st->print(" Windows 98"); break; |
|
1514 case 4090: st->print(" Windows Me"); break; |
|
1515 default: // future windows, print out its major and minor versions |
|
1516 st->print(" Windows %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion); |
|
1517 } |
|
1518 } |
|
1519 st->print(" Build %d", osvi.dwBuildNumber); |
|
1520 st->print(" %s", osvi.szCSDVersion); // service pack |
|
1521 st->cr(); |
1488 } |
1522 } |
1489 |
1523 |
1490 void os::print_memory_info(outputStream* st) { |
1524 void os::print_memory_info(outputStream* st) { |
1491 st->print("Memory:"); |
1525 st->print("Memory:"); |
1492 st->print(" %dk page", os::vm_page_size()>>10); |
1526 st->print(" %dk page", os::vm_page_size()>>10); |