diff --git a/client/cs_platforms.cpp b/client/cs_platforms.cpp index 5c8e7fa063..0cdd294857 100644 --- a/client/cs_platforms.cpp +++ b/client/cs_platforms.cpp @@ -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 @@ -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 diff --git a/client/hostinfo_win.cpp b/client/hostinfo_win.cpp index 7f49b86306..02c3fcfc81 100644 --- a/client/hostinfo_win.cpp +++ b/client/hostinfo_win.cpp @@ -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); diff --git a/lib/hostinfo.h b/lib/hostinfo.h index 22b27c520a..54191b3c9e 100644 --- a/lib/hostinfo.h +++ b/lib/hostinfo.h @@ -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);