Update WinRT to new version 2.0.250303.1

PiperOrigin-RevId: 781075193
This commit is contained in:
Guogang Li
2025-07-09 08:58:00 -07:00
committed by Copybara-Service
parent 5e558cffc4
commit 8f14bd10fc
1395 changed files with 498490 additions and 61973 deletions
@@ -1,11 +1,11 @@
// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.220531.1
// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.250303.1
#pragma once
#ifndef WINRT_Windows_System_Threading_H
#define WINRT_Windows_System_Threading_H
#include "winrt/base.h"
static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.220531.1"), "Mismatched C++/WinRT headers.");
#define CPPWINRT_VERSION "2.0.220531.1"
static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.250303.1"), "Mismatched C++/WinRT headers.");
#define CPPWINRT_VERSION "2.0.250303.1"
#include "winrt/Windows.System.h"
#include "winrt/impl/Windows.Foundation.2.h"
#include "winrt/impl/Windows.System.Threading.2.h"
@@ -14,59 +14,179 @@ namespace winrt::impl
template <typename D> auto consume_Windows_System_Threading_IThreadPoolStatics<D>::RunAsync(winrt::Windows::System::Threading::WorkItemHandler const& handler) const
{
void* operation{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Threading::IThreadPoolStatics)->RunAsync(*(void**)(&handler), &operation));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Threading::IThreadPoolStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Threading::IThreadPoolStatics, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->RunAsync(*(void**)(&handler), &operation));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolStatics>**)this;
check_hresult(_winrt_abi_type->RunAsync(*(void**)(&handler), &operation));
}
return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi };
}
template <typename D> auto consume_Windows_System_Threading_IThreadPoolStatics<D>::RunAsync(winrt::Windows::System::Threading::WorkItemHandler const& handler, winrt::Windows::System::Threading::WorkItemPriority const& priority) const
{
void* operation{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Threading::IThreadPoolStatics)->RunWithPriorityAsync(*(void**)(&handler), static_cast<int32_t>(priority), &operation));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Threading::IThreadPoolStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Threading::IThreadPoolStatics, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->RunWithPriorityAsync(*(void**)(&handler), static_cast<int32_t>(priority), &operation));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolStatics>**)this;
check_hresult(_winrt_abi_type->RunWithPriorityAsync(*(void**)(&handler), static_cast<int32_t>(priority), &operation));
}
return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi };
}
template <typename D> auto consume_Windows_System_Threading_IThreadPoolStatics<D>::RunAsync(winrt::Windows::System::Threading::WorkItemHandler const& handler, winrt::Windows::System::Threading::WorkItemPriority const& priority, winrt::Windows::System::Threading::WorkItemOptions const& options) const
{
void* operation{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Threading::IThreadPoolStatics)->RunWithPriorityAndOptionsAsync(*(void**)(&handler), static_cast<int32_t>(priority), static_cast<uint32_t>(options), &operation));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Threading::IThreadPoolStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Threading::IThreadPoolStatics, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->RunWithPriorityAndOptionsAsync(*(void**)(&handler), static_cast<int32_t>(priority), static_cast<uint32_t>(options), &operation));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolStatics>**)this;
check_hresult(_winrt_abi_type->RunWithPriorityAndOptionsAsync(*(void**)(&handler), static_cast<int32_t>(priority), static_cast<uint32_t>(options), &operation));
}
return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi };
}
template <typename D> auto consume_Windows_System_Threading_IThreadPoolTimer<D>::Period() const
{
winrt::Windows::Foundation::TimeSpan value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Threading::IThreadPoolTimer)->get_Period(put_abi(value)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Threading::IThreadPoolTimer>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Threading::IThreadPoolTimer, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolTimer>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_Period(put_abi(value)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolTimer>**)this;
check_hresult(_winrt_abi_type->get_Period(put_abi(value)));
}
return value;
}
template <typename D> auto consume_Windows_System_Threading_IThreadPoolTimer<D>::Delay() const
{
winrt::Windows::Foundation::TimeSpan value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Threading::IThreadPoolTimer)->get_Delay(put_abi(value)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Threading::IThreadPoolTimer>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Threading::IThreadPoolTimer, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolTimer>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_Delay(put_abi(value)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolTimer>**)this;
check_hresult(_winrt_abi_type->get_Delay(put_abi(value)));
}
return value;
}
template <typename D> auto consume_Windows_System_Threading_IThreadPoolTimer<D>::Cancel() const
{
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Threading::IThreadPoolTimer)->Cancel());
if constexpr (!std::is_same_v<D, winrt::Windows::System::Threading::IThreadPoolTimer>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Threading::IThreadPoolTimer, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolTimer>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->Cancel());
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolTimer>**)this;
check_hresult(_winrt_abi_type->Cancel());
}
}
template <typename D> auto consume_Windows_System_Threading_IThreadPoolTimerStatics<D>::CreatePeriodicTimer(winrt::Windows::System::Threading::TimerElapsedHandler const& handler, winrt::Windows::Foundation::TimeSpan const& period) const
{
void* timer{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Threading::IThreadPoolTimerStatics)->CreatePeriodicTimer(*(void**)(&handler), impl::bind_in(period), &timer));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Threading::IThreadPoolTimerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Threading::IThreadPoolTimerStatics, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolTimerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->CreatePeriodicTimer(*(void**)(&handler), impl::bind_in(period), &timer));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolTimerStatics>**)this;
check_hresult(_winrt_abi_type->CreatePeriodicTimer(*(void**)(&handler), impl::bind_in(period), &timer));
}
return winrt::Windows::System::Threading::ThreadPoolTimer{ timer, take_ownership_from_abi };
}
template <typename D> auto consume_Windows_System_Threading_IThreadPoolTimerStatics<D>::CreateTimer(winrt::Windows::System::Threading::TimerElapsedHandler const& handler, winrt::Windows::Foundation::TimeSpan const& delay) const
{
void* timer{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Threading::IThreadPoolTimerStatics)->CreateTimer(*(void**)(&handler), impl::bind_in(delay), &timer));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Threading::IThreadPoolTimerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Threading::IThreadPoolTimerStatics, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolTimerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->CreateTimer(*(void**)(&handler), impl::bind_in(delay), &timer));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolTimerStatics>**)this;
check_hresult(_winrt_abi_type->CreateTimer(*(void**)(&handler), impl::bind_in(delay), &timer));
}
return winrt::Windows::System::Threading::ThreadPoolTimer{ timer, take_ownership_from_abi };
}
template <typename D> auto consume_Windows_System_Threading_IThreadPoolTimerStatics<D>::CreatePeriodicTimer(winrt::Windows::System::Threading::TimerElapsedHandler const& handler, winrt::Windows::Foundation::TimeSpan const& period, winrt::Windows::System::Threading::TimerDestroyedHandler const& destroyed) const
{
void* timer{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Threading::IThreadPoolTimerStatics)->CreatePeriodicTimerWithCompletion(*(void**)(&handler), impl::bind_in(period), *(void**)(&destroyed), &timer));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Threading::IThreadPoolTimerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Threading::IThreadPoolTimerStatics, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolTimerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->CreatePeriodicTimerWithCompletion(*(void**)(&handler), impl::bind_in(period), *(void**)(&destroyed), &timer));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolTimerStatics>**)this;
check_hresult(_winrt_abi_type->CreatePeriodicTimerWithCompletion(*(void**)(&handler), impl::bind_in(period), *(void**)(&destroyed), &timer));
}
return winrt::Windows::System::Threading::ThreadPoolTimer{ timer, take_ownership_from_abi };
}
template <typename D> auto consume_Windows_System_Threading_IThreadPoolTimerStatics<D>::CreateTimer(winrt::Windows::System::Threading::TimerElapsedHandler const& handler, winrt::Windows::Foundation::TimeSpan const& delay, winrt::Windows::System::Threading::TimerDestroyedHandler const& destroyed) const
{
void* timer{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Threading::IThreadPoolTimerStatics)->CreateTimerWithCompletion(*(void**)(&handler), impl::bind_in(delay), *(void**)(&destroyed), &timer));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Threading::IThreadPoolTimerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Threading::IThreadPoolTimerStatics, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolTimerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->CreateTimerWithCompletion(*(void**)(&handler), impl::bind_in(delay), *(void**)(&destroyed), &timer));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Threading::IThreadPoolTimerStatics>**)this;
check_hresult(_winrt_abi_type->CreateTimerWithCompletion(*(void**)(&handler), impl::bind_in(delay), *(void**)(&destroyed), &timer));
}
return winrt::Windows::System::Threading::ThreadPoolTimer{ timer, take_ownership_from_abi };
}
template <typename H> struct delegate<winrt::Windows::System::Threading::TimerDestroyedHandler, H> final : implements_delegate<winrt::Windows::System::Threading::TimerDestroyedHandler, H>
@@ -277,8 +397,22 @@ WINRT_EXPORT namespace winrt::Windows::System::Threading
TimerDestroyedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); })
{
}
template <typename O, typename M> TimerDestroyedHandler::TimerDestroyedHandler(weak_ref<O>&& object, M method) :
TimerDestroyedHandler([o = std::move(object), method](auto&&... args) { if (auto s = o.get()) { ((*s).*(method))(args...); } })
template <typename O, typename LM> TimerDestroyedHandler::TimerDestroyedHandler(weak_ref<O>&& object, LM&& lambda_or_method) :
TimerDestroyedHandler([o = std::move(object), lm = std::forward<LM>(lambda_or_method)](auto&&... args) { if (auto s = o.get()) {
if constexpr (std::is_member_function_pointer_v<LM>) ((*s).*(lm))(args...);
else lm(args...);
} })
{
}
template <typename O, typename M> TimerDestroyedHandler::TimerDestroyedHandler(std::shared_ptr<O>&& object, M method) :
TimerDestroyedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); })
{
}
template <typename O, typename LM> TimerDestroyedHandler::TimerDestroyedHandler(std::weak_ptr<O>&& object, LM&& lambda_or_method) :
TimerDestroyedHandler([o = std::move(object), lm = std::forward<LM>(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) {
if constexpr (std::is_member_function_pointer_v<LM>) ((*s).*(lm))(args...);
else lm(args...);
} })
{
}
inline auto TimerDestroyedHandler::operator()(winrt::Windows::System::Threading::ThreadPoolTimer const& timer) const
@@ -301,8 +435,22 @@ WINRT_EXPORT namespace winrt::Windows::System::Threading
TimerElapsedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); })
{
}
template <typename O, typename M> TimerElapsedHandler::TimerElapsedHandler(weak_ref<O>&& object, M method) :
TimerElapsedHandler([o = std::move(object), method](auto&&... args) { if (auto s = o.get()) { ((*s).*(method))(args...); } })
template <typename O, typename LM> TimerElapsedHandler::TimerElapsedHandler(weak_ref<O>&& object, LM&& lambda_or_method) :
TimerElapsedHandler([o = std::move(object), lm = std::forward<LM>(lambda_or_method)](auto&&... args) { if (auto s = o.get()) {
if constexpr (std::is_member_function_pointer_v<LM>) ((*s).*(lm))(args...);
else lm(args...);
} })
{
}
template <typename O, typename M> TimerElapsedHandler::TimerElapsedHandler(std::shared_ptr<O>&& object, M method) :
TimerElapsedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); })
{
}
template <typename O, typename LM> TimerElapsedHandler::TimerElapsedHandler(std::weak_ptr<O>&& object, LM&& lambda_or_method) :
TimerElapsedHandler([o = std::move(object), lm = std::forward<LM>(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) {
if constexpr (std::is_member_function_pointer_v<LM>) ((*s).*(lm))(args...);
else lm(args...);
} })
{
}
inline auto TimerElapsedHandler::operator()(winrt::Windows::System::Threading::ThreadPoolTimer const& timer) const
@@ -325,8 +473,22 @@ WINRT_EXPORT namespace winrt::Windows::System::Threading
WorkItemHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); })
{
}
template <typename O, typename M> WorkItemHandler::WorkItemHandler(weak_ref<O>&& object, M method) :
WorkItemHandler([o = std::move(object), method](auto&&... args) { if (auto s = o.get()) { ((*s).*(method))(args...); } })
template <typename O, typename LM> WorkItemHandler::WorkItemHandler(weak_ref<O>&& object, LM&& lambda_or_method) :
WorkItemHandler([o = std::move(object), lm = std::forward<LM>(lambda_or_method)](auto&&... args) { if (auto s = o.get()) {
if constexpr (std::is_member_function_pointer_v<LM>) ((*s).*(lm))(args...);
else lm(args...);
} })
{
}
template <typename O, typename M> WorkItemHandler::WorkItemHandler(std::shared_ptr<O>&& object, M method) :
WorkItemHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); })
{
}
template <typename O, typename LM> WorkItemHandler::WorkItemHandler(std::weak_ptr<O>&& object, LM&& lambda_or_method) :
WorkItemHandler([o = std::move(object), lm = std::forward<LM>(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) {
if constexpr (std::is_member_function_pointer_v<LM>) ((*s).*(lm))(args...);
else lm(args...);
} })
{
}
inline auto WorkItemHandler::operator()(winrt::Windows::Foundation::IAsyncAction const& operation) const