mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[SYSDM] Do not leave empty line if no CPU frequency detected
CORE-17971
This commit is contained in:
parent
4f542ebd8d
commit
1896383eb0
1 changed files with 8 additions and 5 deletions
|
@ -412,7 +412,7 @@ static VOID MakeFloatValueString(DOUBLE* dFloatValue, LPTSTR szOutput, LPTSTR sz
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID SetProcSpeed(HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID)
|
static BOOL SetProcSpeed(HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID)
|
||||||
{
|
{
|
||||||
TCHAR szBuf[64], szHz[16];
|
TCHAR szBuf[64], szHz[16];
|
||||||
DWORD BufSize = sizeof(DWORD);
|
DWORD BufSize = sizeof(DWORD);
|
||||||
|
@ -432,7 +432,7 @@ static VOID SetProcSpeed(HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID)
|
||||||
{
|
{
|
||||||
if (!LoadString(hApplet, IDS_MEGAHERTZ, szHz, _countof(szHz)))
|
if (!LoadString(hApplet, IDS_MEGAHERTZ, szHz, _countof(szHz)))
|
||||||
{
|
{
|
||||||
return;
|
return FALSE;
|
||||||
}
|
}
|
||||||
StringCchPrintf(szBuf, _countof(szBuf), _T("%lu %s"), ppi.CurrentMhz, szHz);
|
StringCchPrintf(szBuf, _countof(szBuf), _T("%lu %s"), ppi.CurrentMhz, szHz);
|
||||||
}
|
}
|
||||||
|
@ -441,13 +441,16 @@ static VOID SetProcSpeed(HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID)
|
||||||
double flt = ppi.CurrentMhz / 1000.0;
|
double flt = ppi.CurrentMhz / 1000.0;
|
||||||
if (!LoadString(hApplet, IDS_GIGAHERTZ, szHz, _countof(szHz)))
|
if (!LoadString(hApplet, IDS_GIGAHERTZ, szHz, _countof(szHz)))
|
||||||
{
|
{
|
||||||
return;
|
return FALSE;
|
||||||
}
|
}
|
||||||
MakeFloatValueString(&flt, szBuf, szHz);
|
MakeFloatValueString(&flt, szBuf, szHz);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetDlgItemText(hwnd, uID, szBuf);
|
SetDlgItemText(hwnd, uID, szBuf);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID GetSystemInformation(HWND hwnd)
|
static VOID GetSystemInformation(HWND hwnd)
|
||||||
|
@ -511,8 +514,8 @@ static VOID GetSystemInformation(HWND hwnd)
|
||||||
CurMachineLine + 1);
|
CurMachineLine + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetProcSpeed(hwnd, hKey, _T("~MHz"), CurMachineLine);
|
if (SetProcSpeed(hwnd, hKey, _T("~MHz"), CurMachineLine))
|
||||||
CurMachineLine++;
|
CurMachineLine++;
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue