https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e9f9f83c0ae75c8fb6d04c4331d578742fb889a5

commit e9f9f83c0ae75c8fb6d04c4331d578742fb889a5
Author:     Stanislav Motylkov <[email protected]>
AuthorDate: Wed Dec 30 03:04:38 2020 +0300
Commit:     Stanislav Motylkov <[email protected]>
CommitDate: Wed Dec 30 19:38:14 2020 +0300

    [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);

Reply via email to