Logo: try printing logo on Windows Server

Completely untested
This commit is contained in:
李通洲
2022-10-15 23:46:00 +08:00
parent 76684e49ca
commit a090bed6c0
2 changed files with 16 additions and 4 deletions
+13 -1
View File
@@ -51,6 +51,18 @@ void ffDetectOSImpl(FFOSResult* os, const FFinstance* instance)
uint32_t index = ffStrbufFirstIndexC(&os->variant, ' ');
ffStrbufAppendNS(&os->version, index, os->variant.chars);
ffStrbufSubstrAfter(&os->variant, index);
// Windows Server 20xx Rx
if(ffStrbufEndsWithC(&os->prettyName, 'r'))
{
if(os->variant.chars[0] == 'R' &&
isdigit(os->variant.chars[1]) &&
(os->variant.chars[2] == '\0' || os->variant.chars[2] == ' '))
{
ffStrbufAppendF(&os->version, " R%c", os->variant.chars[1]);
ffStrbufSubstrAfter(&os->variant, strlen("Rx ") - 1);
}
}
}
else
{
@@ -59,7 +71,7 @@ void ffDetectOSImpl(FFOSResult* os, const FFinstance* instance)
ffStrbufClear(&os->variant);
}
ffStrbufAppendF(&os->id, "Windows %*s", os->version.length, os->version.chars);
ffStrbufAppendF(&os->id, "%*s %*s", os->prettyName.length, os->prettyName.chars, os->version.length, os->version.chars);
ffGetWmiObjString(pclsObj, L"BuildNumber", &os->buildID);
ffGetWmiObjString(pclsObj, L"OSArchitecture", &os->architecture);
+3 -3
View File
@@ -1280,7 +1280,7 @@ static const FFlogo* getLogoMsys2()
static const FFlogo* getLogoWindows11()
{
FF_LOGO_INIT
FF_LOGO_NAMES("Windows 11")
FF_LOGO_NAMES("Windows 11", "Windows Server 2022")
FF_LOGO_LINES(
"$1\n"
"################ ################\n"
@@ -1310,7 +1310,7 @@ static const FFlogo* getLogoWindows11()
static const FFlogo* getLogoWindows8()
{
FF_LOGO_INIT
FF_LOGO_NAMES("Windows 8", "Windows 8.1", "Windows 10")
FF_LOGO_NAMES("Windows 8", "Windows 8.1", "Windows 10", "Windows Server 2012", "Windows Server 2012 R2", "Windows Server 2016", "Windows Server 2019")
FF_LOGO_LINES(
"$1 ..,\n"
" ....,,:;+ccllll\n"
@@ -1343,7 +1343,7 @@ static const FFlogo* getLogoWindows8()
static const FFlogo* getLogoWindows()
{
FF_LOGO_INIT
FF_LOGO_NAMES("Windows")
FF_LOGO_NAMES("Windows", "Windows 7", "Windows Server 2008", "Windows Server 2008 R2")
FF_LOGO_LINES(
"$1 ,.=:!!t3Z3z.,\n"
" :tt:::tt333EE3\n"