From 9286c8b9c23a613f96636b8e2d1391d89cedd199 Mon Sep 17 00:00:00 2001
From: Zhao Yuhang <2546789017@qq.com>
Date: 周六, 07 12月 2024 21:11:05 +0800
Subject: [PATCH] Win32 code cleanup & improve

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

diff --git a/src/core/qwindowkit_windows.cpp b/src/core/qwindowkit_windows.cpp
index 51a6f33..c022e26 100644
--- a/src/core/qwindowkit_windows.cpp
+++ b/src/core/qwindowkit_windows.cpp
@@ -8,9 +8,11 @@
 
     static RTL_OSVERSIONINFOW GetRealOSVersionImpl() {
         HMODULE hMod = ::GetModuleHandleW(L"ntdll.dll");
+        Q_ASSERT(hMod);
         using RtlGetVersionPtr = NTSTATUS(WINAPI *)(PRTL_OSVERSIONINFOW);
         auto pRtlGetVersion =
             reinterpret_cast<RtlGetVersionPtr>(::GetProcAddress(hMod, "RtlGetVersion"));
+        Q_ASSERT(pRtlGetVersion);
         RTL_OSVERSIONINFOW rovi{};
         rovi.dwOSVersionInfoSize = sizeof(rovi);
         pRtlGetVersion(&rovi);
@@ -85,6 +87,10 @@
                                reinterpret_cast<unsigned char *>(&value), &size) == ERROR_SUCCESS;
         return qMakePair(value, ok);
     }
+#elif QT_VERSION < QT_VERSION_CHECK(6, 8, 1)
+    WindowsRegistryKey::WindowsRegistryKey(HKEY parentHandle, QStringView subKey, REGSAM permissions, REGSAM access)
+        : QWinRegistryKey(parentHandle, subKey, permissions, access)
+    {
+    }
 #endif
-
 }
\ No newline at end of file

--
Gitblit v1.9.1