Host (Windows): cleanup useless smbios values

This commit is contained in:
李通洲
2023-07-04 17:53:28 +08:00
parent 107b3dc1e3
commit c6416b5ccb
3 changed files with 14 additions and 0 deletions
+4
View File
@@ -1,5 +1,6 @@
#include "bios.h"
#include "util/windows/registry.h"
#include "util/smbiosHelper.h"
const char* ffDetectBios(FFBiosResult* bios)
{
@@ -10,8 +11,11 @@ const char* ffDetectBios(FFBiosResult* bios)
if(!ffRegReadStrbuf(hKey, L"BIOSVersion", &bios->version, NULL))
return "\"HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSVersion\" doesn't exist";
ffCleanUpSmbiosValue(&bios->version);
ffRegReadStrbuf(hKey, L"BIOSVendor", &bios->vendor, NULL);
ffCleanUpSmbiosValue(&bios->vendor);
ffRegReadStrbuf(hKey, L"BIOSReleaseDate", &bios->date, NULL);
ffCleanUpSmbiosValue(&bios->date);
uint32_t major, minor;
if(
+4
View File
@@ -1,5 +1,6 @@
#include "board.h"
#include "util/windows/registry.h"
#include "util/smbiosHelper.h"
const char* ffDetectBoard(FFBoardResult* board)
{
@@ -11,8 +12,11 @@ const char* ffDetectBoard(FFBoardResult* board)
if(!ffRegReadStrbuf(hKey, L"BaseBoardProduct", &board->name, NULL))
return "ffRegReadStrbuf(hKey, L\"BaseBoardProduct\") failed";
ffCleanUpSmbiosValue(&board->name);
ffRegReadStrbuf(hKey, L"BaseBoardManufacturer", &board->vendor, NULL);
ffCleanUpSmbiosValue(&board->vendor);
ffRegReadStrbuf(hKey, L"BaseBoardVersion", &board->version, NULL);
ffCleanUpSmbiosValue(&board->version);
return NULL;
}
+6
View File
@@ -1,5 +1,6 @@
#include "host.h"
#include "util/windows/registry.h"
#include "util/smbiosHelper.h"
const char* ffDetectHost(FFHostResult* host)
{
@@ -9,10 +10,15 @@ const char* ffDetectHost(FFHostResult* host)
return "ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L\"HARDWARE\\DESCRIPTION\\System\\BIOS\", &hKey, NULL) failed";
ffRegReadStrbuf(hKey, L"SystemProductName", &host->productName, NULL);
ffCleanUpSmbiosValue(&host->productName);
ffRegReadStrbuf(hKey, L"SystemFamily", &host->productFamily, NULL);
ffCleanUpSmbiosValue(&host->productFamily);
ffRegReadStrbuf(hKey, L"SystemVersion", &host->productVersion, NULL);
ffCleanUpSmbiosValue(&host->productVersion);
ffRegReadStrbuf(hKey, L"SystemSKU", &host->productSku, NULL);
ffCleanUpSmbiosValue(&host->productSku);
ffRegReadStrbuf(hKey, L"SystemManufacturer", &host->sysVendor, NULL);
ffCleanUpSmbiosValue(&host->sysVendor);
return NULL;
}