[SYSDM] Display system identifier when SMBIOS is not available

Actual for NEC PC-98 and Original Xbox ports.
This commit is contained in:
Stanislav Motylkov 2020-08-26 23:14:26 +03:00
parent ba006b3d49
commit 06198c51ac
No known key found for this signature in database
GPG key ID: AFE513258CBA9E92

View file

@ -156,7 +156,7 @@ LRESULT CALLBACK RosImageProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
if (hDC == NULL)
goto Cleanup;
top = 0;
top = 0;
offset = 0;
hCreditsDC = CreateCompatibleDC(hDC);
hLogoDC = CreateCompatibleDC(hCreditsDC);
@ -445,6 +445,7 @@ static VOID SetProcSpeed(HWND hwnd, HKEY hKey, LPTSTR Value, UINT uID)
static VOID GetSystemInformation(HWND hwnd)
{
HKEY hKey;
TCHAR SysKey[] = _T("HARDWARE\\DESCRIPTION\\System");
TCHAR ProcKey[] = _T("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
MEMORYSTATUSEX MemStat;
TCHAR Buf[32];
@ -460,6 +461,15 @@ static VOID GetSystemInformation(HWND hwnd)
SetDlgItemText(hwnd, CurMachineLine, SMBiosName);
CurMachineLine++;
}
else
{
/* If SMBIOS is not available, use System Identifier */
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, SysKey, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
{
SetRegTextData(hwnd, hKey, _T("Identifier"), CurMachineLine);
CurMachineLine++;
}
}
/*
* Get Processor information
* although undocumented, this information is being pulled