Bios: print as ${version} (${release})

As biosRelease looks more like a version on my laptop
This commit is contained in:
李通洲
2023-06-22 16:55:11 +08:00
parent 3c414abc8f
commit 291c43dd31
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ const char* ffDetectBios(FFBiosResult* bios)
if(!ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L"HARDWARE\\DESCRIPTION\\System\\BIOS", &hKey, NULL))
return "ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L\"HARDWARE\\DESCRIPTION\\System\\BIOS\", &hKey, NULL) failed";
if(!ffRegReadStrbuf(hKey, L"BIOSVersion", &bios->biosRelease, NULL))
if(!ffRegReadStrbuf(hKey, L"BIOSVersion", &bios->biosVersion, NULL))
return "\"HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSVersion\" doesn't exist";
ffRegReadStrbuf(hKey, L"BIOSVendor", &bios->biosVendor, NULL);
@@ -18,7 +18,7 @@ const char* ffDetectBios(FFBiosResult* bios)
ffRegReadUint(hKey, L"BiosMajorRelease", &major, NULL) &&
ffRegReadUint(hKey, L"BiosMinorRelease", &minor, NULL)
)
ffStrbufAppendF(&bios->biosVersion, "%u.%u", (unsigned)major, (unsigned)minor);
ffStrbufAppendF(&bios->biosRelease, "%u.%u", (unsigned)major, (unsigned)minor);
return NULL;
}
+5 -5
View File
@@ -22,18 +22,18 @@ void ffPrintBios(FFinstance* instance, FFBiosOptions* options)
goto exit;
}
if(bios.biosRelease.length == 0)
if(bios.biosVersion.length == 0)
{
ffPrintError(instance, FF_BIOS_MODULE_NAME, 0, &options->moduleArgs, "bios_release is not set.");
ffPrintError(instance, FF_BIOS_MODULE_NAME, 0, &options->moduleArgs, "bios_version is not set.");
goto exit;
}
if(options->moduleArgs.outputFormat.length == 0)
{
ffPrintLogoAndKey(instance, FF_BIOS_MODULE_NAME, 0, &options->moduleArgs.key, &options->moduleArgs.keyColor);
ffStrbufWriteTo(&bios.biosRelease, stdout);
if (bios.biosVersion.length)
printf(" (%s)", bios.biosVersion.chars);
ffStrbufWriteTo(&bios.biosVersion, stdout);
if (bios.biosRelease.length)
printf(" (%s)", bios.biosRelease.chars);
putchar('\n');
}
else