Files
PowerToys/src/common/utils/os-detect.h
Andrey Nekrasov 212ea2de30 common: refactor common library pt2 (#8588)
- remove common lib
- split settings, remove common-md
- move ipc interop/kb_layout to interop
- rename core -> settings, settings -> old_settings
- os-detect header-only; interop -> PowerToysInterop
- split notifications, move single-use headers where they're used
- winstore lib
- rename com utils
- rename Updating and Telemetry projects
- rename core -> settings-ui and remove examples folder
- rename settings-ui folder + consisent common/version include
2020-12-15 15:16:09 +03:00

31 lines
1007 B
C++

#pragma once
#include <winrt/Windows.Foundation.Metadata.h>
// The following three helper functions determine if the user has a build version higher than or equal to 19h1, as that is a requirement for xaml islands
// Source : Microsoft-ui-xaml github
// Link: https://github.com/microsoft/microsoft-ui-xaml/blob/c045cde57c5c754683d674634a0baccda34d58c4/dev/dll/SharedHelpers.cpp
template<uint16_t APIVersion>
inline bool IsAPIContractVxAvailable()
{
static bool isAPIContractVxAvailable = winrt::Windows::Foundation::Metadata::ApiInformation::IsApiContractPresent(L"Windows.Foundation.UniversalApiContract", APIVersion);
return isAPIContractVxAvailable;
}
inline bool IsAPIContractV8Available()
{
return IsAPIContractVxAvailable<8>();
}
inline bool Is19H1OrHigher()
{
return IsAPIContractV8Available();
}
// This function returns true if the build is 19h1 or higher, so that we deploy the new settings.
// It returns false otherwise.
inline bool UseNewSettings()
{
return Is19H1OrHigher();
}