Author: greatlrd
Date: Mon Nov 27 22:04:25 2006
New Revision: 24857
URL:
http://svn.reactos.org/svn/reactos?rev=24857&view=rev
Log:
Patch from hto@mail dot cnt dot ru for sysdm
See issue #1856 for more details.
Modified:
trunk/reactos/dll/cpl/sysdm/general.c
Modified: trunk/reactos/dll/cpl/sysdm/general.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/general.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/general.c (original)
+++ trunk/reactos/dll/cpl/sysdm/general.c Mon Nov 27 22:04:25 2006
@@ -110,6 +110,46 @@
}
}
+static VOID
+SetProcName(HWND hwnd,
+ HKEY hKey,
+ LPTSTR Value,
+ UINT uID)
+{
+ LPTSTR lpBuf = NULL;
+ DWORD BufSize = 0;
+ DWORD Type;
+
+ if (RegQueryValueEx(hKey,
+ Value,
+ NULL,
+ &Type,
+ NULL,
+ &BufSize) == ERROR_SUCCESS)
+ {
+ lpBuf = HeapAlloc(GetProcessHeap(),
+ 0,
+ BufSize);
+ if (!lpBuf) return;
+
+ if (RegQueryValueEx(hKey,
+ Value,
+ NULL,
+ &Type,
+ (PBYTE)lpBuf,
+ &BufSize) == ERROR_SUCCESS)
+ {
+ SetDlgItemText(hwnd,
+ uID,
+ lpBuf + _tcsspn(lpBuf, _T(" ")));
+ }
+
+ HeapFree(GetProcessHeap(),
+ 0,
+ lpBuf);
+ }
+}
+
static VOID
SetProcSpeed(HWND hwnd,
HKEY hKey,
@@ -171,10 +211,10 @@
_T("VendorIdentifier"),
IDC_PROCESSORMANUFACTURER);
- SetRegTextData(hwnd,
- hKey,
- _T("ProcessorNameString"),
- IDC_PROCESSOR);
+ SetProcName(hwnd,
+ hKey,
+ _T("ProcessorNameString"),
+ IDC_PROCESSOR);
SetProcSpeed(hwnd,
hKey,
@@ -322,3 +362,4 @@
return FALSE;
}
+