From d61db440e1c757a656ec2ab91f0c2f39ccd5d5f3 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <zhaoyuhang@rankyee.com> Date: ćšć, 28 12æ 2023 15:19:56 +0800 Subject: [PATCH] minor tweaks --- src/core/qwindowkit_windows.cpp | 29 ++++++++++++++++++----------- 1 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/core/qwindowkit_windows.cpp b/src/core/qwindowkit_windows.cpp index b74167f..8292de5 100644 --- a/src/core/qwindowkit_windows.cpp +++ b/src/core/qwindowkit_windows.cpp @@ -2,17 +2,24 @@ 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; + static RTL_OSVERSIONINFOW GetRealOSVersionImpl() { + 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; + } + + namespace Private { + + RTL_OSVERSIONINFOW GetRealOSVersion() { + static const auto result = GetRealOSVersionImpl(); + return result; + } + } } \ No newline at end of file -- Gitblit v1.9.1