Skip to content

Commit

Permalink
syssccpu show virtualization
Browse files Browse the repository at this point in the history
  • Loading branch information
jxy-s committed Jan 11, 2025
1 parent 08ddc38 commit 5e60f09
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
8 changes: 5 additions & 3 deletions SystemInformer/SystemInformer.rc
Original file line number Diff line number Diff line change
Expand Up @@ -1031,15 +1031,17 @@ BEGIN
LTEXT "Graph layout",IDC_GRAPH_LAYOUT,0,22,315,82,NOT WS_VISIBLE
END

IDD_SYSINFO_CPUPANEL DIALOGEX 0, 0, 413, 86
IDD_SYSINFO_CPUPANEL DIALOGEX 0, 0, 506, 86
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "Utilization:",IDC_STATIC,0,3,34,8
LTEXT "Utilization:",IDC_STATIC,6,3,34,8
LTEXT "Speed:",IDC_STATIC,108,3,24,8
LTEXT "Static",IDC_UTILIZATION,40,0,62,15
LTEXT "Virtualization:",IDC_STATIC,247,3,60,8
LTEXT "Static",IDC_UTILIZATION,46,0,60,15
LTEXT "Static",IDC_SPEED,137,0,100,15
LTEXT "Static",IDC_VIRTUALIZATION,296,0,500,15
GROUPBOX "System",IDC_STATIC,0,17,97,55
LTEXT "Processes",IDC_STATIC,7,28,33,8
LTEXT "Threads",IDC_STATIC,7,38,27,8
Expand Down
24 changes: 24 additions & 0 deletions SystemInformer/syssccpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ static PH_UINT64_DELTA DpcsDelta;
static PH_UINT32_DELTA SystemCallsDelta;
static HWND CpuPanelUtilizationLabel;
static HWND CpuPanelSpeedLabel;
static HWND CpuVirtualizationLabel;
static HWND CpuPanelProcessesLabel;
static HWND CpuPanelThreadsLabel;
static HWND CpuPanelHandlesLabel;
Expand Down Expand Up @@ -563,6 +564,7 @@ INT_PTR CALLBACK PhSipCpuPanelDialogProc(
{
CpuPanelUtilizationLabel = GetDlgItem(hwndDlg, IDC_UTILIZATION);
CpuPanelSpeedLabel = GetDlgItem(hwndDlg, IDC_SPEED);
CpuVirtualizationLabel = GetDlgItem(hwndDlg, IDC_VIRTUALIZATION);
CpuPanelProcessesLabel = GetDlgItem(hwndDlg, IDC_ZPROCESSES_V);
CpuPanelThreadsLabel = GetDlgItem(hwndDlg, IDC_ZTHREADS_V);
CpuPanelHandlesLabel = GetDlgItem(hwndDlg, IDC_ZHANDLES_V);
Expand All @@ -578,6 +580,7 @@ INT_PTR CALLBACK PhSipCpuPanelDialogProc(

SetWindowFont(CpuPanelUtilizationLabel, CpuSection->Parameters->MediumFont, FALSE);
SetWindowFont(CpuPanelSpeedLabel, CpuSection->Parameters->MediumFont, FALSE);
SetWindowFont(CpuVirtualizationLabel, CpuSection->Parameters->MediumFont, FALSE);
}
break;
case WM_COMMAND:
Expand Down Expand Up @@ -1141,6 +1144,27 @@ VOID PhSipUpdateCpuPanel(
PhSetDialogItemText(CpuPanel, IDC_ZL1CACHE_V, PhaFormatSize(CpuL1CacheSize, ULONG_MAX)->Buffer);
PhSetDialogItemText(CpuPanel, IDC_ZL2CACHE_V, PhaFormatSize(CpuL2CacheSize, ULONG_MAX)->Buffer);
PhSetDialogItemText(CpuPanel, IDC_ZL3CACHE_V, PhaFormatSize(CpuL3CacheSize, ULONG_MAX)->Buffer);

switch (PhGetVirtualStatus())
{
case PhVirtualStatusVirtualMachine:
PhSetDialogItemText(CpuPanel, IDC_VIRTUALIZATION, L"Virtual machine");
break;
case PhVirtualStatusEnabledHyperV:
case PhVirtualStatusEnabledFirmware:
PhSetDialogItemText(CpuPanel, IDC_VIRTUALIZATION, L"Enabled");
break;
case PhVirtualStatusDiabledWithHyperVSupport:
PhSetDialogItemText(CpuPanel, IDC_VIRTUALIZATION, L"Disabled (Hyper-V support: Yes)");
break;
case PhVirtualStatusDiabledWithoutHyperVSupport:
PhSetDialogItemText(CpuPanel, IDC_VIRTUALIZATION, L"Disabled (Hyper-V support: No)");
break;
case PhVirtualStatusNotCapable:
default:
PhSetDialogItemText(CpuPanel, IDC_VIRTUALIZATION, L"Not capable");
break;
}
}

if (CurrentPerformanceDistribution && PreviousPerformanceDistribution)
Expand Down

0 comments on commit 5e60f09

Please sign in to comment.