From e9f9f83c0ae75c8fb6d04c4331d578742fb889a5 Mon Sep 17 00:00:00 2001 From: Stanislav Motylkov Date: Wed, 30 Dec 2020 03:04:38 +0300 Subject: [PATCH] [SYSDM] If ProcessorNameString not found, fall back to Identifier Also add a comment about CIM_Processor. CORE-17413 --- dll/cpl/sysdm/general.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dll/cpl/sysdm/general.c b/dll/cpl/sysdm/general.c index 85bc450cc2f..938cb820e8c 100644 --- a/dll/cpl/sysdm/general.c +++ b/dll/cpl/sysdm/general.c @@ -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);