MCPcopy Create free account
hub / github.com/PenguLoader/PenguLoader / winver

Function winver

core/src/utils/window.cc:69–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67#define getfunc(lib, fn) _getfunc<fn>(lib, #fn)
68
69static auto winver()
70{
71 static struct { int major, minor, build; } version = { 0 };
72 if (version.major == 0)
73 {
74 if (auto func = getfunc("ntdll.dll", RtlGetVersion))
75 {
76 OSVERSIONINFOW vi{};
77 func(&vi);
78 version.major = vi.dwMajorVersion;
79 version.minor = vi.dwMinorVersion;
80 version.build = vi.dwBuildNumber;
81 }
82 }
83 return version;
84}
85
86#define IsWin7Plus() (winver().major > 6 || (winver().minor == 6 && winver().minor == 1))
87#define IsWin10_20H1() (winver().build >= 19041 && winver().build < 22000)

Callers 2

get_os_versionFunction · 0.85
get_os_buildFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected