// C++/WinRT v2.0.250303.1 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Media_Protection_H #define WINRT_Windows_Media_Protection_H #include "winrt/base.h" 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.Media.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Media.Playback.2.h" #include "winrt/impl/Windows.Media.Protection.2.h" namespace winrt::impl { template auto consume_Windows_Media_Protection_IComponentLoadFailedEventArgs::Information() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Information(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Information(&value)); } return winrt::Windows::Media::Protection::RevocationAndRenewalInformation{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IComponentLoadFailedEventArgs::Completion() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Completion(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Completion(&value)); } return winrt::Windows::Media::Protection::MediaProtectionServiceCompletion{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IComponentRenewalStatics::RenewSystemComponentsAsync(winrt::Windows::Media::Protection::RevocationAndRenewalInformation const& information) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->RenewSystemComponentsAsync(*(void**)(&information), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RenewSystemComponentsAsync(*(void**)(&information), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress{ operation, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IHdcpSession::IsEffectiveProtectionAtLeast(winrt::Windows::Media::Protection::HdcpProtection const& protection) const { bool value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->IsEffectiveProtectionAtLeast(static_cast(protection), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsEffectiveProtectionAtLeast(static_cast(protection), &value)); } return value; } template auto consume_Windows_Media_Protection_IHdcpSession::GetEffectiveProtection() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetEffectiveProtection(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetEffectiveProtection(&value)); } return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IHdcpSession::SetDesiredMinProtectionAsync(winrt::Windows::Media::Protection::HdcpProtection const& protection) const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->SetDesiredMinProtectionAsync(static_cast(protection), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SetDesiredMinProtectionAsync(static_cast(protection), &value)); } return winrt::Windows::Foundation::IAsyncOperation{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IHdcpSession::ProtectionChanged(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_ProtectionChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_ProtectionChanged(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Media_Protection_IHdcpSession::ProtectionChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, ProtectionChanged(handler)); } template auto consume_Windows_Media_Protection_IHdcpSession::ProtectionChanged(winrt::event_token const& token) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_ProtectionChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_ProtectionChanged(impl::bind_in(token)); } } template auto consume_Windows_Media_Protection_IMediaProtectionManager::ServiceRequested(winrt::Windows::Media::Protection::ServiceRequestedEventHandler const& handler) const { winrt::event_token cookie{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_ServiceRequested(*(void**)(&handler), put_abi(cookie))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_ServiceRequested(*(void**)(&handler), put_abi(cookie))); } return cookie; } template auto consume_Windows_Media_Protection_IMediaProtectionManager::ServiceRequested(auto_revoke_t, winrt::Windows::Media::Protection::ServiceRequestedEventHandler const& handler) const { return impl::make_event_revoker(this, ServiceRequested(handler)); } template auto consume_Windows_Media_Protection_IMediaProtectionManager::ServiceRequested(winrt::event_token const& cookie) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_ServiceRequested(impl::bind_in(cookie)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_ServiceRequested(impl::bind_in(cookie)); } } template auto consume_Windows_Media_Protection_IMediaProtectionManager::RebootNeeded(winrt::Windows::Media::Protection::RebootNeededEventHandler const& handler) const { winrt::event_token cookie{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_RebootNeeded(*(void**)(&handler), put_abi(cookie))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_RebootNeeded(*(void**)(&handler), put_abi(cookie))); } return cookie; } template auto consume_Windows_Media_Protection_IMediaProtectionManager::RebootNeeded(auto_revoke_t, winrt::Windows::Media::Protection::RebootNeededEventHandler const& handler) const { return impl::make_event_revoker(this, RebootNeeded(handler)); } template auto consume_Windows_Media_Protection_IMediaProtectionManager::RebootNeeded(winrt::event_token const& cookie) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_RebootNeeded(impl::bind_in(cookie)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_RebootNeeded(impl::bind_in(cookie)); } } template auto consume_Windows_Media_Protection_IMediaProtectionManager::ComponentLoadFailed(winrt::Windows::Media::Protection::ComponentLoadFailedEventHandler const& handler) const { winrt::event_token cookie{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_ComponentLoadFailed(*(void**)(&handler), put_abi(cookie))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_ComponentLoadFailed(*(void**)(&handler), put_abi(cookie))); } return cookie; } template auto consume_Windows_Media_Protection_IMediaProtectionManager::ComponentLoadFailed(auto_revoke_t, winrt::Windows::Media::Protection::ComponentLoadFailedEventHandler const& handler) const { return impl::make_event_revoker(this, ComponentLoadFailed(handler)); } template auto consume_Windows_Media_Protection_IMediaProtectionManager::ComponentLoadFailed(winrt::event_token const& cookie) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_ComponentLoadFailed(impl::bind_in(cookie)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_ComponentLoadFailed(impl::bind_in(cookie)); } } template auto consume_Windows_Media_Protection_IMediaProtectionManager::Properties() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Properties(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Properties(&value)); } return winrt::Windows::Foundation::Collections::IPropertySet{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IMediaProtectionPMPServer::Properties() const { void* ppProperties{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Properties(&ppProperties)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Properties(&ppProperties)); } return winrt::Windows::Foundation::Collections::IPropertySet{ ppProperties, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IMediaProtectionPMPServerFactory::CreatePMPServer(winrt::Windows::Foundation::Collections::IPropertySet const& pProperties) const { void* ppObject{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreatePMPServer(*(void**)(&pProperties), &ppObject)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreatePMPServer(*(void**)(&pProperties), &ppObject)); } return winrt::Windows::Media::Protection::MediaProtectionPMPServer{ ppObject, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IMediaProtectionServiceCompletion::Complete(bool success) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->Complete(success)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Complete(success)); } } template auto consume_Windows_Media_Protection_IMediaProtectionServiceRequest::ProtectionSystem() const { winrt::guid system{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_ProtectionSystem(put_abi(system))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ProtectionSystem(put_abi(system))); } return system; } template auto consume_Windows_Media_Protection_IMediaProtectionServiceRequest::Type() const { winrt::guid type{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Type(put_abi(type))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Type(put_abi(type))); } return type; } template auto consume_Windows_Media_Protection_IProtectionCapabilities::IsTypeSupported(param::hstring const& type, param::hstring const& keySystem) const { winrt::Windows::Media::Protection::ProtectionCapabilityResult value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->IsTypeSupported(*(void**)(&type), *(void**)(&keySystem), reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsTypeSupported(*(void**)(&type), *(void**)(&keySystem), reinterpret_cast(&value))); } return value; } template auto consume_Windows_Media_Protection_IRevocationAndRenewalInformation::Items() const { void* items{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Items(&items)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Items(&items)); } return winrt::Windows::Foundation::Collections::IVector{ items, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IRevocationAndRenewalItem::Reasons() const { winrt::Windows::Media::Protection::RevocationAndRenewalReasons reasons{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Reasons(reinterpret_cast(&reasons))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Reasons(reinterpret_cast(&reasons))); } return reasons; } template auto consume_Windows_Media_Protection_IRevocationAndRenewalItem::HeaderHash() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_HeaderHash(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_HeaderHash(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IRevocationAndRenewalItem::PublicKeyHash() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_PublicKeyHash(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_PublicKeyHash(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IRevocationAndRenewalItem::Name() const { void* name{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Name(&name)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Name(&name)); } return hstring{ name, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IRevocationAndRenewalItem::RenewalId() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_RenewalId(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_RenewalId(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IServiceRequestedEventArgs::Request() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Request(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Request(&value)); } return winrt::Windows::Media::Protection::IMediaProtectionServiceRequest{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IServiceRequestedEventArgs::Completion() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Completion(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Completion(&value)); } return winrt::Windows::Media::Protection::MediaProtectionServiceCompletion{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Protection_IServiceRequestedEventArgs2::MediaPlaybackItem() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_MediaPlaybackItem(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MediaPlaybackItem(&value)); } return winrt::Windows::Media::Playback::MediaPlaybackItem{ value, take_ownership_from_abi }; } template struct delegate final : implements_delegate { delegate(H&& handler) : implements_delegate(std::forward(handler)) {} int32_t __stdcall Invoke(void* sender, void* e) noexcept final try { (*this)(*reinterpret_cast(&sender), *reinterpret_cast(&e)); return 0; } catch (...) { return to_hresult(); } }; template struct delegate final : implements_delegate { delegate(H&& handler) : implements_delegate(std::forward(handler)) {} int32_t __stdcall Invoke(void* sender) noexcept final try { (*this)(*reinterpret_cast(&sender)); return 0; } catch (...) { return to_hresult(); } }; template struct delegate final : implements_delegate { delegate(H&& handler) : implements_delegate(std::forward(handler)) {} int32_t __stdcall Invoke(void* sender, void* e) noexcept final try { (*this)(*reinterpret_cast(&sender), *reinterpret_cast(&e)); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Information(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Information()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Completion(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Completion()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall RenewSystemComponentsAsync(void* information, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().RenewSystemComponentsAsync(*reinterpret_cast(&information))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall IsEffectiveProtectionAtLeast(int32_t protection, bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsEffectiveProtectionAtLeast(*reinterpret_cast(&protection))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetEffectiveProtection(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().GetEffectiveProtection()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetDesiredMinProtectionAsync(int32_t protection, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().SetDesiredMinProtectionAsync(*reinterpret_cast(&protection))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ProtectionChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().ProtectionChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ProtectionChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ProtectionChanged(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall add_ServiceRequested(void* handler, winrt::event_token* cookie) noexcept final try { zero_abi(cookie); typename D::abi_guard guard(this->shim()); *cookie = detach_from(this->shim().ServiceRequested(*reinterpret_cast(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ServiceRequested(winrt::event_token cookie) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ServiceRequested(*reinterpret_cast(&cookie)); return 0; } int32_t __stdcall add_RebootNeeded(void* handler, winrt::event_token* cookie) noexcept final try { zero_abi(cookie); typename D::abi_guard guard(this->shim()); *cookie = detach_from(this->shim().RebootNeeded(*reinterpret_cast(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_RebootNeeded(winrt::event_token cookie) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().RebootNeeded(*reinterpret_cast(&cookie)); return 0; } int32_t __stdcall add_ComponentLoadFailed(void* handler, winrt::event_token* cookie) noexcept final try { zero_abi(cookie); typename D::abi_guard guard(this->shim()); *cookie = detach_from(this->shim().ComponentLoadFailed(*reinterpret_cast(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ComponentLoadFailed(winrt::event_token cookie) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ComponentLoadFailed(*reinterpret_cast(&cookie)); return 0; } int32_t __stdcall get_Properties(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Properties(void** ppProperties) noexcept final try { clear_abi(ppProperties); typename D::abi_guard guard(this->shim()); *ppProperties = detach_from(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreatePMPServer(void* pProperties, void** ppObject) noexcept final try { clear_abi(ppObject); typename D::abi_guard guard(this->shim()); *ppObject = detach_from(this->shim().CreatePMPServer(*reinterpret_cast(&pProperties))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall Complete(bool success) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Complete(success); return 0; } catch (...) { return to_hresult(); } }; #endif template struct produce : produce_base { int32_t __stdcall get_ProtectionSystem(winrt::guid* system) noexcept final try { typename D::abi_guard guard(this->shim()); *system = detach_from(this->shim().ProtectionSystem()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Type(winrt::guid* type) noexcept final try { typename D::abi_guard guard(this->shim()); *type = detach_from(this->shim().Type()); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall IsTypeSupported(void* type, void* keySystem, int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsTypeSupported(*reinterpret_cast(&type), *reinterpret_cast(&keySystem))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Items(void** items) noexcept final try { clear_abi(items); typename D::abi_guard guard(this->shim()); *items = detach_from>(this->shim().Items()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Reasons(uint32_t* reasons) noexcept final try { typename D::abi_guard guard(this->shim()); *reasons = detach_from(this->shim().Reasons()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_HeaderHash(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().HeaderHash()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_PublicKeyHash(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().PublicKeyHash()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Name(void** name) noexcept final try { clear_abi(name); typename D::abi_guard guard(this->shim()); *name = detach_from(this->shim().Name()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_RenewalId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RenewalId()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Request(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Request()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Completion(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Completion()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_MediaPlaybackItem(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MediaPlaybackItem()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Media::Protection { constexpr auto operator|(RevocationAndRenewalReasons const left, RevocationAndRenewalReasons const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(RevocationAndRenewalReasons& left, RevocationAndRenewalReasons const right) noexcept { left = left | right; return left; } constexpr auto operator&(RevocationAndRenewalReasons const left, RevocationAndRenewalReasons const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(RevocationAndRenewalReasons& left, RevocationAndRenewalReasons const right) noexcept { left = left & right; return left; } constexpr auto operator~(RevocationAndRenewalReasons const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(RevocationAndRenewalReasons const left, RevocationAndRenewalReasons const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(RevocationAndRenewalReasons& left, RevocationAndRenewalReasons const right) noexcept { left = left ^ right; return left; } inline auto ComponentRenewal::RenewSystemComponentsAsync(winrt::Windows::Media::Protection::RevocationAndRenewalInformation const& information) { return impl::call_factory([&](IComponentRenewalStatics const& f) { return f.RenewSystemComponentsAsync(information); }); } inline HdcpSession::HdcpSession() : HdcpSession(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline MediaProtectionManager::MediaProtectionManager() : MediaProtectionManager(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline MediaProtectionPMPServer::MediaProtectionPMPServer(winrt::Windows::Foundation::Collections::IPropertySet const& pProperties) : MediaProtectionPMPServer(impl::call_factory([&](IMediaProtectionPMPServerFactory const& f) { return f.CreatePMPServer(pProperties); })) { } inline ProtectionCapabilities::ProtectionCapabilities() : ProtectionCapabilities(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } template ComponentLoadFailedEventHandler::ComponentLoadFailedEventHandler(L handler) : ComponentLoadFailedEventHandler(impl::make_delegate(std::forward(handler))) { } template ComponentLoadFailedEventHandler::ComponentLoadFailedEventHandler(F* handler) : ComponentLoadFailedEventHandler([=](auto&&... args) { return handler(args...); }) { } template ComponentLoadFailedEventHandler::ComponentLoadFailedEventHandler(O* object, M method) : ComponentLoadFailedEventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) { } template ComponentLoadFailedEventHandler::ComponentLoadFailedEventHandler(com_ptr&& object, M method) : ComponentLoadFailedEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template ComponentLoadFailedEventHandler::ComponentLoadFailedEventHandler(weak_ref&& object, LM&& lambda_or_method) : ComponentLoadFailedEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } template ComponentLoadFailedEventHandler::ComponentLoadFailedEventHandler(std::shared_ptr&& object, M method) : ComponentLoadFailedEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template ComponentLoadFailedEventHandler::ComponentLoadFailedEventHandler(std::weak_ptr&& object, LM&& lambda_or_method) : ComponentLoadFailedEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } inline auto ComponentLoadFailedEventHandler::operator()(winrt::Windows::Media::Protection::MediaProtectionManager const& sender, winrt::Windows::Media::Protection::ComponentLoadFailedEventArgs const& e) const { check_hresult((*(impl::abi_t**)this)->Invoke(*(void**)(&sender), *(void**)(&e))); } template RebootNeededEventHandler::RebootNeededEventHandler(L handler) : RebootNeededEventHandler(impl::make_delegate(std::forward(handler))) { } template RebootNeededEventHandler::RebootNeededEventHandler(F* handler) : RebootNeededEventHandler([=](auto&&... args) { return handler(args...); }) { } template RebootNeededEventHandler::RebootNeededEventHandler(O* object, M method) : RebootNeededEventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) { } template RebootNeededEventHandler::RebootNeededEventHandler(com_ptr&& object, M method) : RebootNeededEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template RebootNeededEventHandler::RebootNeededEventHandler(weak_ref&& object, LM&& lambda_or_method) : RebootNeededEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } template RebootNeededEventHandler::RebootNeededEventHandler(std::shared_ptr&& object, M method) : RebootNeededEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template RebootNeededEventHandler::RebootNeededEventHandler(std::weak_ptr&& object, LM&& lambda_or_method) : RebootNeededEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } inline auto RebootNeededEventHandler::operator()(winrt::Windows::Media::Protection::MediaProtectionManager const& sender) const { check_hresult((*(impl::abi_t**)this)->Invoke(*(void**)(&sender))); } template ServiceRequestedEventHandler::ServiceRequestedEventHandler(L handler) : ServiceRequestedEventHandler(impl::make_delegate(std::forward(handler))) { } template ServiceRequestedEventHandler::ServiceRequestedEventHandler(F* handler) : ServiceRequestedEventHandler([=](auto&&... args) { return handler(args...); }) { } template ServiceRequestedEventHandler::ServiceRequestedEventHandler(O* object, M method) : ServiceRequestedEventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) { } template ServiceRequestedEventHandler::ServiceRequestedEventHandler(com_ptr&& object, M method) : ServiceRequestedEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template ServiceRequestedEventHandler::ServiceRequestedEventHandler(weak_ref&& object, LM&& lambda_or_method) : ServiceRequestedEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } template ServiceRequestedEventHandler::ServiceRequestedEventHandler(std::shared_ptr&& object, M method) : ServiceRequestedEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template ServiceRequestedEventHandler::ServiceRequestedEventHandler(std::weak_ptr&& object, LM&& lambda_or_method) : ServiceRequestedEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } inline auto ServiceRequestedEventHandler::operator()(winrt::Windows::Media::Protection::MediaProtectionManager const& sender, winrt::Windows::Media::Protection::ServiceRequestedEventArgs const& e) const { check_hresult((*(impl::abi_t**)this)->Invoke(*(void**)(&sender), *(void**)(&e))); } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } #endif