win: Reuse existing WinSalInstance::getWindowsBuildNumber
Change-Id: I59b4da71a25a3532e044451b7e89637a53d53a0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178136 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
parent
5f00b748cb
commit
0bf5756b6a
1 changed files with 1 additions and 24 deletions
|
@ -311,30 +311,7 @@ SalData::~SalData()
|
|||
|
||||
bool OSSupportsDarkMode()
|
||||
{
|
||||
bool bRet = false;
|
||||
if (HMODULE h_ntdll = GetModuleHandleW(L"ntdll.dll"))
|
||||
{
|
||||
typedef LONG(WINAPI* RtlGetVersion_t)(PRTL_OSVERSIONINFOW);
|
||||
if (auto RtlGetVersion
|
||||
= reinterpret_cast<RtlGetVersion_t>(GetProcAddress(h_ntdll, "RtlGetVersion")))
|
||||
{
|
||||
RTL_OSVERSIONINFOW vi2{};
|
||||
vi2.dwOSVersionInfoSize = sizeof(vi2);
|
||||
if (RtlGetVersion(&vi2) == 0)
|
||||
{
|
||||
if (vi2.dwMajorVersion > 10)
|
||||
bRet = true;
|
||||
else if (vi2.dwMajorVersion == 10)
|
||||
{
|
||||
if (vi2.dwMinorVersion > 0)
|
||||
bRet = true;
|
||||
else if (vi2.dwBuildNumber >= 18362)
|
||||
bRet = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return bRet;
|
||||
return WinSalInstance::getWindowsBuildNumber() >= 18362;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
|
Loading…
Reference in a new issue