mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-12-31 00:10:26 -06:00
25 lines
527 B
C++
25 lines
527 B
C++
#include <kernel/platform.h>
|
|
|
|
#if _WIN32
|
|
LIB_FUNCTION(LONG, "ntdll.dll", RtlGetVersion, PRTL_OSVERSIONINFOW);
|
|
#endif
|
|
|
|
PlatformVersion GetPlatformVersion()
|
|
{
|
|
auto result = PlatformVersion{};
|
|
|
|
#if _WIN32
|
|
OSVERSIONINFOEXW osvi = { 0 };
|
|
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW);
|
|
|
|
if (RtlGetVersion((PRTL_OSVERSIONINFOW)&osvi) != 0)
|
|
return result;
|
|
|
|
result.Major = osvi.dwMajorVersion;
|
|
result.Minor = osvi.dwMinorVersion;
|
|
result.Build = osvi.dwBuildNumber;
|
|
#endif
|
|
|
|
return result;
|
|
}
|