forked from microsoft/PowerToys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathos-detect.cpp
More file actions
32 lines (26 loc) · 1016 Bytes
/
os-detect.cpp
File metadata and controls
32 lines (26 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "pch.h"
#include "os-detect.h"
#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>
bool IsAPIContractVxAvailable()
{
static bool isAPIContractVxAvailable = winrt::Windows::Foundation::Metadata::ApiInformation::IsApiContractPresent(L"Windows.Foundation.UniversalApiContract", APIVersion);
return isAPIContractVxAvailable;
}
bool IsAPIContractV8Available()
{
return IsAPIContractVxAvailable<8>();
}
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.
bool UseNewSettings()
{
return Is19H1OrHigher();
}