[SYSDM] If ProcessorNameString not found, fall back to Identifier

Also add a comment about CIM_Processor. CORE-17413
This commit is contained in:
Stanislav Motylkov 2020-12-30 03:04:38 +03:00
parent b96e88894a
commit e9f9f83c0a
No known key found for this signature in database
GPG key ID: AFE513258CBA9E92

View file

@ -479,15 +479,30 @@ static VOID GetSystemInformation(HWND hwnd)
*/
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, ProcKey, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
{
INT PrevMachineLine;
SetRegTextData(hwnd, hKey, _T("VendorIdentifier"), CurMachineLine);
CurMachineLine++;
PrevMachineLine = CurMachineLine;
CurMachineLine += SetProcNameString(hwnd,
hKey,
_T("ProcessorNameString"),
CurMachineLine,
CurMachineLine + 1);
if (CurMachineLine == PrevMachineLine)
{
/* TODO: Try obtaining CPU name from WMI (i.e. CIM_Processor) */
/* Brand String is not available, use Identifier instead */
CurMachineLine += SetProcNameString(hwnd,
hKey,
_T("Identifier"),
CurMachineLine,
CurMachineLine + 1);
}
SetProcSpeed(hwnd, hKey, _T("~MHz"), CurMachineLine);
CurMachineLine++;
RegCloseKey(hKey);