mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Kernel (Windows): detect wine
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "FFPlatform_private.h"
|
||||
#include "common/io/io.h"
|
||||
#include "common/library.h"
|
||||
#include "util/stringUtils.h"
|
||||
#include "util/windows/unicode.h"
|
||||
#include "util/windows/registry.h"
|
||||
@@ -159,6 +160,16 @@ static void getUserShell(FFPlatform* platform)
|
||||
ffStrbufReplaceAllC(&platform->userShell, '\\', '/');
|
||||
}
|
||||
|
||||
static void detectWine(FFstrbuf* buf)
|
||||
{
|
||||
static const char *(__cdecl *pwine_get_version)(void);
|
||||
HMODULE hntdll = GetModuleHandleW(L"ntdll.dll");
|
||||
if (!hntdll) return;
|
||||
pwine_get_version = (void *)GetProcAddress(hntdll, "wine_get_version");
|
||||
if (!pwine_get_version) return;
|
||||
ffStrbufAppendF(buf, " - wine %s", pwine_get_version());
|
||||
}
|
||||
|
||||
static void getSystemReleaseAndVersion(FFPlatformSysinfo* info)
|
||||
{
|
||||
RTL_OSVERSIONINFOW osVersion = { .dwOSVersionInfoSize = sizeof(osVersion) };
|
||||
@@ -187,6 +198,7 @@ static void getSystemReleaseAndVersion(FFPlatformSysinfo* info)
|
||||
else
|
||||
ffRegReadStrbuf(hKey, L"ReleaseId", &info->displayVersion, NULL); // For old Windows 10
|
||||
}
|
||||
detectWine(&info->displayVersion);
|
||||
|
||||
ffRegReadStrbuf(hKey, L"BuildLabEx", &info->version, NULL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user