From a800a8eb45f1b35e5c83449e71c5ca9c1ebd7400 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 8 Sep 2023 17:20:15 -0700 Subject: [PATCH 1/2] Add Windows Server 2022 detection to hsSystemInfo --- Sources/Plasma/CoreLib/hsSystemInfo.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/Plasma/CoreLib/hsSystemInfo.cpp b/Sources/Plasma/CoreLib/hsSystemInfo.cpp index 183c4fa8f0..d23c55e01d 100644 --- a/Sources/Plasma/CoreLib/hsSystemInfo.cpp +++ b/Sources/Plasma/CoreLib/hsSystemInfo.cpp @@ -269,6 +269,8 @@ static inline bool IGetWindowsVersion(const RTL_OSVERSIONINFOEXW& info, ST::stri ss << "Server 2016 "; else if (info.dwMajorVersion == 10 && info.dwBuildNumber == 17763 && server.value()) ss << "Server 2019 "; + else if (info.dwMajorVersion == 10 && info.dwBuildNumber == 20348 && server.value()) + ss << "Server 2022 "; else if (info.dwMajorVersion == 10 && info.dwBuildNumber >= 22000 && !server.value()) ss << "11 "; else if (info.dwPlatformId & VER_PLATFORM_WIN32_NT) From 5ea30eb243bbebff51380e6542bb885b21b82534 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 8 Sep 2023 17:20:33 -0700 Subject: [PATCH 2/2] Resolve clang warning in hsSystemInfo The address of the string will never be falsey, so we only need to check if the first character of the string is not \0. --- Sources/Plasma/CoreLib/hsSystemInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/CoreLib/hsSystemInfo.cpp b/Sources/Plasma/CoreLib/hsSystemInfo.cpp index d23c55e01d..541aad1461 100644 --- a/Sources/Plasma/CoreLib/hsSystemInfo.cpp +++ b/Sources/Plasma/CoreLib/hsSystemInfo.cpp @@ -294,7 +294,7 @@ static inline bool IGetWindowsVersion(const RTL_OSVERSIONINFOEXW& info, ST::stri if (info.wProductType == VER_NT_WORKSTATION) ss << "Professional "; - if (info.szCSDVersion && *info.szCSDVersion) + if (info.szCSDVersion[0]) ss << info.szCSDVersion << ' '; ss << "(Build " << info.dwBuildNumber << ')';