mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-01-03 10:10:06 -06:00
Add missing files.
This commit is contained in:
24
UnleashedRecomp/kernel/platform.cpp
Normal file
24
UnleashedRecomp/kernel/platform.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user