Merge pull request #5935 from BOINC/vko_arm64_fix_platform_name

[Windows] Set correct platform name when running BOINC client on Windows on ARM.
This commit is contained in:
Vitalii Koshura 2024-12-05 22:11:27 +01:00 committed by GitHub
commit 51803c6bf4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 29 additions and 3 deletions

View File

@ -24,6 +24,9 @@
#include "boinc_win.h"
typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
LPFN_ISWOW64PROCESS fnIsWow64Process;
#ifndef SIM
#include "hostinfo.h"
#endif
#else
#include "config.h"
#include <cstdio>
@ -172,7 +175,24 @@ int launch_child_process_to_detect_emulated_cpu() {
void CLIENT_STATE::detect_platforms() {
#if defined(_WIN32) && !defined(__CYGWIN32__)
#if defined(_WIN64) && defined(_M_X64)
#if defined(_ARM64_)
add_platform("windows_arm64");
#ifndef SIM
// according to
// https://learn.microsoft.com/en-us/windows/arm/apps-on-arm-x86-emulation
// Windows 10 on ARM can run x86 applications,
// and Windows 11 on ARM can run x86_64 applications
// so we will add these platfroms as well
OSVERSIONINFOEX osvi;
BOOL bOsVersionInfoEx = get_OSVERSIONINFO(osvi);
if (osvi.dwMajorVersion >= 10) {
add_platform("windows_intelx86");
if (osvi.dwBuildNumber >= 22000) {
add_platform("windows_x86_64");
}
}
#endif
#elif defined(_WIN64) && defined(_M_X64)
add_platform("windows_x86_64");
add_platform("windows_intelx86");
#else

View File

@ -386,8 +386,8 @@ int get_os_information(
}
} else {
if (osvi.dwBuildNumber >= 26100) {
strlcat(os_name, "Windows Server 2025", os_name_size);
} else if (osvi.dwBuildNumber >= 25398) {
strlcat(os_name, "Windows Server 2025", os_name_size);
} else if (osvi.dwBuildNumber >= 25398) {
strlcat(os_name, "Windows Server 23H2", os_name_size);
} else if (osvi.dwBuildNumber >= 20348) {
strlcat(os_name, "Windows Server 2022", os_name_size);

View File

@ -172,6 +172,12 @@ public:
extern void make_secure_random_string(char*);
#ifdef _WIN32
#ifndef SIM
extern BOOL get_OSVERSIONINFO(OSVERSIONINFOEX& osvi);
#endif
#endif
#ifdef _WIN64
extern int get_wsl_information(WSL_DISTROS &distros);
extern int get_processor_group(HANDLE);