From acece00ae291d143c3b712a98814a64b9dd43f14 Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周一, 11 12月 2023 17:12:41 +0800
Subject: [PATCH] Remove VersionHelper

---
 src/core/qwindowkit_windows.cpp |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/core/qwindowkit_windows.cpp b/src/core/qwindowkit_windows.cpp
index c8f8c2d..826c454 100644
--- a/src/core/qwindowkit_windows.cpp
+++ b/src/core/qwindowkit_windows.cpp
@@ -1 +1,23 @@
 #include "qwindowkit_windows.h"
+
+namespace QWK {
+
+    typedef NTSTATUS(WINAPI *RtlGetVersionPtr)(PRTL_OSVERSIONINFOW);
+
+    RTL_OSVERSIONINFOW GetRealOSVersion() {
+        HMODULE hMod = GetModuleHandleW(L"ntdll.dll");
+        if (hMod) {
+            auto fxPtr = reinterpret_cast<RtlGetVersionPtr>(GetProcAddress(hMod, "RtlGetVersion"));
+            if (fxPtr != nullptr) {
+                RTL_OSVERSIONINFOW rovi = {0};
+                rovi.dwOSVersionInfoSize = sizeof(rovi);
+                if (0 == fxPtr(&rovi)) {
+                    return rovi;
+                }
+            }
+        }
+        RTL_OSVERSIONINFOW rovi = {0};
+        return rovi;
+    }
+
+}
\ No newline at end of file

--
Gitblit v1.9.1