From be0d95b573647a046b70d42d18c03ab757a486df Mon Sep 17 00:00:00 2001
From: Yuhang Zhao <zhaoyuhang@rankyee.com>
Date: 周一, 09 12月 2024 11:52:03 +0800
Subject: [PATCH] fix calculation

---
 src/core/qwindowkit_windows.cpp |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/core/qwindowkit_windows.cpp b/src/core/qwindowkit_windows.cpp
index 517ab73..c022e26 100644
--- a/src/core/qwindowkit_windows.cpp
+++ b/src/core/qwindowkit_windows.cpp
@@ -1,4 +1,5 @@
-// Copyright (C) 2023-2024 Stdware Collections
+// Copyright (C) 2023-2024 Stdware Collections (https://www.github.com/stdware)
+// Copyright (C) 2021-2023 wangwenx190 (Yuhang Zhao)
 // SPDX-License-Identifier: Apache-2.0
 
 #include "qwindowkit_windows.h"
@@ -7,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);
@@ -84,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