54{
55 #if defined(_MSC_VER)
56 #pragma warning(push)
57 #pragma warning(disable : 4191)
58 #else
59 #pragma GCC diagnostic push
60 #pragma GCC diagnostic ignored "-Wcast-function-type"
61 #endif
62 NTSTATUS(WINAPI * getVersion)
63 (PRTL_OSVERSIONINFOW) = (reinterpret_cast<NTSTATUS(WINAPI*)(PRTL_OSVERSIONINFOW)>(GetProcAddress(GetModuleHandle(TEXT("ntdll.dll")), "RtlGetVersion")));
64 #if defined(_MSC_VER)
65 #pragma warning(pop)
66 #else
67 #pragma GCC diagnostic pop
68 #endif
69 if(getVersion != nullptr)
70 {
71 RTL_OSVERSIONINFOW rovi;
72 rovi.dwOSVersionInfoSize = sizeof(rovi);
73 if(getVersion(&rovi) == 0)
74 {
75 if(rovi.dwMajorVersion > major || (rovi.dwMajorVersion == major && (rovi.dwMinorVersion > minor || (rovi.dwMinorVersion == minor && rovi.dwBuildNumber >= patch)))) return true;
76 else
77 return false;
78 }
79 }
80 return false;
81}