|
1 | 1 | #include "FFPlatform_private.h" |
2 | 2 | #include "common/io/io.h" |
| 3 | +#include "common/library.h" |
3 | 4 | #include "util/stringUtils.h" |
4 | 5 | #include "util/windows/unicode.h" |
5 | 6 | #include "util/windows/registry.h" |
@@ -159,6 +160,16 @@ static void getUserShell(FFPlatform* platform) |
159 | 160 | ffStrbufReplaceAllC(&platform->userShell, '\\', '/'); |
160 | 161 | } |
161 | 162 |
|
| 163 | +static void detectWine(FFstrbuf* buf) |
| 164 | +{ |
| 165 | + static const char *(__cdecl *pwine_get_version)(void); |
| 166 | + HMODULE hntdll = GetModuleHandleW(L"ntdll.dll"); |
| 167 | + if (!hntdll) return; |
| 168 | + pwine_get_version = (void *)GetProcAddress(hntdll, "wine_get_version"); |
| 169 | + if (!pwine_get_version) return; |
| 170 | + ffStrbufAppendF(buf, " - wine %s", pwine_get_version()); |
| 171 | +} |
| 172 | + |
162 | 173 | static void getSystemReleaseAndVersion(FFPlatformSysinfo* info) |
163 | 174 | { |
164 | 175 | RTL_OSVERSIONINFOW osVersion = { .dwOSVersionInfoSize = sizeof(osVersion) }; |
@@ -187,6 +198,7 @@ static void getSystemReleaseAndVersion(FFPlatformSysinfo* info) |
187 | 198 | else |
188 | 199 | ffRegReadStrbuf(hKey, L"ReleaseId", &info->displayVersion, NULL); // For old Windows 10 |
189 | 200 | } |
| 201 | + detectWine(&info->displayVersion); |
190 | 202 |
|
191 | 203 | ffRegReadStrbuf(hKey, L"BuildLabEx", &info->version, NULL); |
192 | 204 |
|
|
0 commit comments