Sine Striker
2023-12-20 a5372ac566469efb59e6cfb29a695021c7c3528d
src/core/qwindowkit_windows.cpp
@@ -1 +1,18 @@
#include "qwindowkit_windows.h"
namespace QWK {
    RTL_OSVERSIONINFOW GetRealOSVersion() {
        static const auto result = []() -> RTL_OSVERSIONINFOW {
            HMODULE hMod = ::GetModuleHandleW(L"ntdll.dll");
            using RtlGetVersionPtr = NTSTATUS(WINAPI *)(PRTL_OSVERSIONINFOW);
            auto pRtlGetVersion = reinterpret_cast<RtlGetVersionPtr>(::GetProcAddress(hMod, "RtlGetVersion"));
            RTL_OSVERSIONINFOW rovi{};
            rovi.dwOSVersionInfoSize = sizeof(rovi);
            pRtlGetVersion(&rovi);
            return rovi;
        }();
        return result;
    }
}