// C++/WinRT v2.0.250303.1 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Networking_Proximity_H #define WINRT_Windows_Networking_Proximity_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.Networking.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Networking.2.h" #include "winrt/impl/Windows.Networking.Sockets.2.h" #include "winrt/impl/Windows.Storage.Streams.2.h" #include "winrt/impl/Windows.Networking.Proximity.2.h" namespace winrt::impl { template auto consume_Windows_Networking_Proximity_IConnectionRequestedEventArgs::PeerInformation() 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_PeerInformation(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_PeerInformation(&value)); } return winrt::Windows::Networking::Proximity::PeerInformation{ value, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::AllowBluetooth() 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->get_AllowBluetooth(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AllowBluetooth(&value)); } return value; } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::AllowBluetooth(bool value) 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->put_AllowBluetooth(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_AllowBluetooth(value)); } } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::AllowInfrastructure() 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->get_AllowInfrastructure(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AllowInfrastructure(&value)); } return value; } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::AllowInfrastructure(bool value) 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->put_AllowInfrastructure(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_AllowInfrastructure(value)); } } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::AllowWiFiDirect() 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->get_AllowWiFiDirect(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AllowWiFiDirect(&value)); } return value; } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::AllowWiFiDirect(bool value) 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->put_AllowWiFiDirect(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_AllowWiFiDirect(value)); } } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::DisplayName() 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_DisplayName(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DisplayName(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::DisplayName(param::hstring const& value) 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->put_DisplayName(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_DisplayName(*(void**)(&value))); } } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::SupportedDiscoveryTypes() const { winrt::Windows::Networking::Proximity::PeerDiscoveryTypes 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_SupportedDiscoveryTypes(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_SupportedDiscoveryTypes(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::AlternateIdentities() 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_AlternateIdentities(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AlternateIdentities(&value)); } return winrt::Windows::Foundation::Collections::IMap{ value, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::Start() 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->Start()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Start()); } } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::Start(param::hstring const& peerMessage) 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->StartWithMessage(*(void**)(&peerMessage))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->StartWithMessage(*(void**)(&peerMessage))); } } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::Stop() 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->Stop()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Stop()); } } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::TriggeredConnectionStateChanged(winrt::Windows::Foundation::TypedEventHandler 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_TriggeredConnectionStateChanged(*(void**)(&handler), put_abi(cookie))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_TriggeredConnectionStateChanged(*(void**)(&handler), put_abi(cookie))); } return cookie; } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::TriggeredConnectionStateChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, TriggeredConnectionStateChanged(handler)); } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::TriggeredConnectionStateChanged(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_TriggeredConnectionStateChanged(impl::bind_in(cookie)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_TriggeredConnectionStateChanged(impl::bind_in(cookie)); } } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::ConnectionRequested(winrt::Windows::Foundation::TypedEventHandler 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_ConnectionRequested(*(void**)(&handler), put_abi(cookie))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_ConnectionRequested(*(void**)(&handler), put_abi(cookie))); } return cookie; } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::ConnectionRequested(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, ConnectionRequested(handler)); } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::ConnectionRequested(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_ConnectionRequested(impl::bind_in(cookie)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_ConnectionRequested(impl::bind_in(cookie)); } } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::FindAllPeersAsync() const { void* asyncOp{}; 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->FindAllPeersAsync(&asyncOp)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->FindAllPeersAsync(&asyncOp)); } return winrt::Windows::Foundation::IAsyncOperation>{ asyncOp, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics::ConnectAsync(winrt::Windows::Networking::Proximity::PeerInformation const& peerInformation) const { void* asyncOp{}; 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->ConnectAsync(*(void**)(&peerInformation), &asyncOp)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ConnectAsync(*(void**)(&peerInformation), &asyncOp)); } return winrt::Windows::Foundation::IAsyncOperation{ asyncOp, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics2::Role() const { winrt::Windows::Networking::Proximity::PeerRole 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_Role(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Role(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics2::Role(winrt::Windows::Networking::Proximity::PeerRole const& value) 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->put_Role(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Role(static_cast(value))); } } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics2::DiscoveryData() 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_DiscoveryData(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DiscoveryData(&value)); } return winrt::Windows::Storage::Streams::IBuffer{ value, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics2::DiscoveryData(winrt::Windows::Storage::Streams::IBuffer const& value) 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->put_DiscoveryData(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_DiscoveryData(*(void**)(&value))); } } template auto consume_Windows_Networking_Proximity_IPeerFinderStatics2::CreateWatcher() const { void* watcher{}; 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->CreateWatcher(&watcher)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateWatcher(&watcher)); } return winrt::Windows::Networking::Proximity::PeerWatcher{ watcher, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IPeerInformation::DisplayName() 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_DisplayName(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DisplayName(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IPeerInformation3::Id() 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_Id(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Id(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IPeerInformation3::DiscoveryData() 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_DiscoveryData(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DiscoveryData(&value)); } return winrt::Windows::Storage::Streams::IBuffer{ value, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IPeerInformationWithHostAndService::HostName() 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_HostName(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_HostName(&value)); } return winrt::Windows::Networking::HostName{ value, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IPeerInformationWithHostAndService::ServiceName() 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_ServiceName(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ServiceName(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Added(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_Added(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_Added(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Added(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, Added(handler)); } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Added(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_Added(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_Added(impl::bind_in(token)); } } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Removed(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_Removed(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_Removed(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Removed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, Removed(handler)); } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Removed(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_Removed(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_Removed(impl::bind_in(token)); } } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Updated(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_Updated(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_Updated(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Updated(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, Updated(handler)); } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Updated(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_Updated(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_Updated(impl::bind_in(token)); } } template auto consume_Windows_Networking_Proximity_IPeerWatcher::EnumerationCompleted(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_EnumerationCompleted(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_EnumerationCompleted(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Networking_Proximity_IPeerWatcher::EnumerationCompleted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, EnumerationCompleted(handler)); } template auto consume_Windows_Networking_Proximity_IPeerWatcher::EnumerationCompleted(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_EnumerationCompleted(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_EnumerationCompleted(impl::bind_in(token)); } } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Stopped(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_Stopped(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_Stopped(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Stopped(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, Stopped(handler)); } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Stopped(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_Stopped(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_Stopped(impl::bind_in(token)); } } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Status() const { winrt::Windows::Networking::Proximity::PeerWatcherStatus status{}; 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_Status(reinterpret_cast(&status))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Status(reinterpret_cast(&status))); } return status; } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Start() 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->Start()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Start()); } } template auto consume_Windows_Networking_Proximity_IPeerWatcher::Stop() 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->Stop()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Stop()); } } template auto consume_Windows_Networking_Proximity_IProximityDevice::SubscribeForMessage(param::hstring const& messageType, winrt::Windows::Networking::Proximity::MessageReceivedHandler const& messageReceivedHandler) const { int64_t subscriptionId{}; 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->SubscribeForMessage(*(void**)(&messageType), *(void**)(&messageReceivedHandler), &subscriptionId)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SubscribeForMessage(*(void**)(&messageType), *(void**)(&messageReceivedHandler), &subscriptionId)); } return subscriptionId; } template auto consume_Windows_Networking_Proximity_IProximityDevice::PublishMessage(param::hstring const& messageType, param::hstring const& message) const { int64_t messageId{}; 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->PublishMessage(*(void**)(&messageType), *(void**)(&message), &messageId)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->PublishMessage(*(void**)(&messageType), *(void**)(&message), &messageId)); } return messageId; } template auto consume_Windows_Networking_Proximity_IProximityDevice::PublishMessage(param::hstring const& messageType, param::hstring const& message, winrt::Windows::Networking::Proximity::MessageTransmittedHandler const& messageTransmittedHandler) const { int64_t messageId{}; 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->PublishMessageWithCallback(*(void**)(&messageType), *(void**)(&message), *(void**)(&messageTransmittedHandler), &messageId)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->PublishMessageWithCallback(*(void**)(&messageType), *(void**)(&message), *(void**)(&messageTransmittedHandler), &messageId)); } return messageId; } template auto consume_Windows_Networking_Proximity_IProximityDevice::PublishBinaryMessage(param::hstring const& messageType, winrt::Windows::Storage::Streams::IBuffer const& message) const { int64_t messageId{}; 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->PublishBinaryMessage(*(void**)(&messageType), *(void**)(&message), &messageId)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->PublishBinaryMessage(*(void**)(&messageType), *(void**)(&message), &messageId)); } return messageId; } template auto consume_Windows_Networking_Proximity_IProximityDevice::PublishBinaryMessage(param::hstring const& messageType, winrt::Windows::Storage::Streams::IBuffer const& message, winrt::Windows::Networking::Proximity::MessageTransmittedHandler const& messageTransmittedHandler) const { int64_t messageId{}; 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->PublishBinaryMessageWithCallback(*(void**)(&messageType), *(void**)(&message), *(void**)(&messageTransmittedHandler), &messageId)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->PublishBinaryMessageWithCallback(*(void**)(&messageType), *(void**)(&message), *(void**)(&messageTransmittedHandler), &messageId)); } return messageId; } template auto consume_Windows_Networking_Proximity_IProximityDevice::PublishUriMessage(winrt::Windows::Foundation::Uri const& message) const { int64_t messageId{}; 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->PublishUriMessage(*(void**)(&message), &messageId)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->PublishUriMessage(*(void**)(&message), &messageId)); } return messageId; } template auto consume_Windows_Networking_Proximity_IProximityDevice::PublishUriMessage(winrt::Windows::Foundation::Uri const& message, winrt::Windows::Networking::Proximity::MessageTransmittedHandler const& messageTransmittedHandler) const { int64_t messageId{}; 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->PublishUriMessageWithCallback(*(void**)(&message), *(void**)(&messageTransmittedHandler), &messageId)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->PublishUriMessageWithCallback(*(void**)(&message), *(void**)(&messageTransmittedHandler), &messageId)); } return messageId; } template auto consume_Windows_Networking_Proximity_IProximityDevice::StopSubscribingForMessage(int64_t subscriptionId) 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->StopSubscribingForMessage(subscriptionId)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->StopSubscribingForMessage(subscriptionId)); } } template auto consume_Windows_Networking_Proximity_IProximityDevice::StopPublishingMessage(int64_t messageId) 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->StopPublishingMessage(messageId)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->StopPublishingMessage(messageId)); } } template auto consume_Windows_Networking_Proximity_IProximityDevice::DeviceArrived(winrt::Windows::Networking::Proximity::DeviceArrivedEventHandler const& arrivedHandler) 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_DeviceArrived(*(void**)(&arrivedHandler), put_abi(cookie))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_DeviceArrived(*(void**)(&arrivedHandler), put_abi(cookie))); } return cookie; } template auto consume_Windows_Networking_Proximity_IProximityDevice::DeviceArrived(auto_revoke_t, winrt::Windows::Networking::Proximity::DeviceArrivedEventHandler const& arrivedHandler) const { return impl::make_event_revoker(this, DeviceArrived(arrivedHandler)); } template auto consume_Windows_Networking_Proximity_IProximityDevice::DeviceArrived(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_DeviceArrived(impl::bind_in(cookie)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_DeviceArrived(impl::bind_in(cookie)); } } template auto consume_Windows_Networking_Proximity_IProximityDevice::DeviceDeparted(winrt::Windows::Networking::Proximity::DeviceDepartedEventHandler const& departedHandler) 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_DeviceDeparted(*(void**)(&departedHandler), put_abi(cookie))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_DeviceDeparted(*(void**)(&departedHandler), put_abi(cookie))); } return cookie; } template auto consume_Windows_Networking_Proximity_IProximityDevice::DeviceDeparted(auto_revoke_t, winrt::Windows::Networking::Proximity::DeviceDepartedEventHandler const& departedHandler) const { return impl::make_event_revoker(this, DeviceDeparted(departedHandler)); } template auto consume_Windows_Networking_Proximity_IProximityDevice::DeviceDeparted(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_DeviceDeparted(impl::bind_in(cookie)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_DeviceDeparted(impl::bind_in(cookie)); } } template auto consume_Windows_Networking_Proximity_IProximityDevice::MaxMessageBytes() const { uint32_t 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_MaxMessageBytes(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MaxMessageBytes(&value)); } return value; } template auto consume_Windows_Networking_Proximity_IProximityDevice::BitsPerSecond() const { uint64_t 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_BitsPerSecond(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_BitsPerSecond(&value)); } return value; } template auto consume_Windows_Networking_Proximity_IProximityDevice::DeviceId() 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_DeviceId(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DeviceId(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IProximityDeviceStatics::GetDeviceSelector() const { void* selector{}; 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->GetDeviceSelector(&selector)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetDeviceSelector(&selector)); } return hstring{ selector, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IProximityDeviceStatics::GetDefault() const { void* proximityDevice{}; 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->GetDefault(&proximityDevice)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetDefault(&proximityDevice)); } return winrt::Windows::Networking::Proximity::ProximityDevice{ proximityDevice, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IProximityDeviceStatics::FromId(param::hstring const& deviceId) const { void* proximityDevice{}; 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->FromId(*(void**)(&deviceId), &proximityDevice)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->FromId(*(void**)(&deviceId), &proximityDevice)); } return winrt::Windows::Networking::Proximity::ProximityDevice{ proximityDevice, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IProximityMessage::MessageType() 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_MessageType(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MessageType(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IProximityMessage::SubscriptionId() const { int64_t 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_SubscriptionId(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_SubscriptionId(&value)); } return value; } template auto consume_Windows_Networking_Proximity_IProximityMessage::Data() 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_Data(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Data(&value)); } return winrt::Windows::Storage::Streams::IBuffer{ value, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_IProximityMessage::DataAsString() 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_DataAsString(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DataAsString(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Networking_Proximity_ITriggeredConnectionStateChangedEventArgs::State() const { winrt::Windows::Networking::Proximity::TriggeredConnectState 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_State(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_State(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Networking_Proximity_ITriggeredConnectionStateChangedEventArgs::Id() const { uint32_t 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_Id(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Id(&value)); } return value; } template auto consume_Windows_Networking_Proximity_ITriggeredConnectionStateChangedEventArgs::Socket() 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_Socket(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Socket(&value)); } return winrt::Windows::Networking::Sockets::StreamSocket{ 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) 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) 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* message) noexcept final try { (*this)(*reinterpret_cast(&sender), *reinterpret_cast(&message)); 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, int64_t messageId) noexcept final try { (*this)(*reinterpret_cast(&sender), messageId); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_PeerInformation(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().PeerInformation()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_AllowBluetooth(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AllowBluetooth()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_AllowBluetooth(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AllowBluetooth(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AllowInfrastructure(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AllowInfrastructure()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_AllowInfrastructure(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AllowInfrastructure(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AllowWiFiDirect(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AllowWiFiDirect()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_AllowWiFiDirect(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AllowWiFiDirect(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DisplayName(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DisplayName()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_DisplayName(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().DisplayName(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SupportedDiscoveryTypes(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SupportedDiscoveryTypes()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AlternateIdentities(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().AlternateIdentities()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Start() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Start(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall StartWithMessage(void* peerMessage) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Start(*reinterpret_cast(&peerMessage)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Stop() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Stop(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_TriggeredConnectionStateChanged(void* handler, winrt::event_token* cookie) noexcept final try { zero_abi(cookie); typename D::abi_guard guard(this->shim()); *cookie = detach_from(this->shim().TriggeredConnectionStateChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_TriggeredConnectionStateChanged(winrt::event_token cookie) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().TriggeredConnectionStateChanged(*reinterpret_cast(&cookie)); return 0; } int32_t __stdcall add_ConnectionRequested(void* handler, winrt::event_token* cookie) noexcept final try { zero_abi(cookie); typename D::abi_guard guard(this->shim()); *cookie = detach_from(this->shim().ConnectionRequested(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ConnectionRequested(winrt::event_token cookie) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ConnectionRequested(*reinterpret_cast(&cookie)); return 0; } int32_t __stdcall FindAllPeersAsync(void** asyncOp) noexcept final try { clear_abi(asyncOp); typename D::abi_guard guard(this->shim()); *asyncOp = detach_from>>(this->shim().FindAllPeersAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ConnectAsync(void* peerInformation, void** asyncOp) noexcept final try { clear_abi(asyncOp); typename D::abi_guard guard(this->shim()); *asyncOp = detach_from>(this->shim().ConnectAsync(*reinterpret_cast(&peerInformation))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Role(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Role()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Role(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Role(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DiscoveryData(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DiscoveryData()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_DiscoveryData(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().DiscoveryData(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateWatcher(void** watcher) noexcept final try { clear_abi(watcher); typename D::abi_guard guard(this->shim()); *watcher = detach_from(this->shim().CreateWatcher()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_DisplayName(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DisplayName()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Id(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Id()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DiscoveryData(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DiscoveryData()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_HostName(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().HostName()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ServiceName(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ServiceName()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall add_Added(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().Added(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_Added(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().Added(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_Removed(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().Removed(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_Removed(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().Removed(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_Updated(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().Updated(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_Updated(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().Updated(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_EnumerationCompleted(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().EnumerationCompleted(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_EnumerationCompleted(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().EnumerationCompleted(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_Stopped(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().Stopped(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_Stopped(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().Stopped(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_Status(int32_t* status) noexcept final try { typename D::abi_guard guard(this->shim()); *status = detach_from(this->shim().Status()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Start() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Start(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Stop() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Stop(); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall SubscribeForMessage(void* messageType, void* messageReceivedHandler, int64_t* subscriptionId) noexcept final try { typename D::abi_guard guard(this->shim()); *subscriptionId = detach_from(this->shim().SubscribeForMessage(*reinterpret_cast(&messageType), *reinterpret_cast(&messageReceivedHandler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall PublishMessage(void* messageType, void* message, int64_t* messageId) noexcept final try { typename D::abi_guard guard(this->shim()); *messageId = detach_from(this->shim().PublishMessage(*reinterpret_cast(&messageType), *reinterpret_cast(&message))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall PublishMessageWithCallback(void* messageType, void* message, void* messageTransmittedHandler, int64_t* messageId) noexcept final try { typename D::abi_guard guard(this->shim()); *messageId = detach_from(this->shim().PublishMessage(*reinterpret_cast(&messageType), *reinterpret_cast(&message), *reinterpret_cast(&messageTransmittedHandler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall PublishBinaryMessage(void* messageType, void* message, int64_t* messageId) noexcept final try { typename D::abi_guard guard(this->shim()); *messageId = detach_from(this->shim().PublishBinaryMessage(*reinterpret_cast(&messageType), *reinterpret_cast(&message))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall PublishBinaryMessageWithCallback(void* messageType, void* message, void* messageTransmittedHandler, int64_t* messageId) noexcept final try { typename D::abi_guard guard(this->shim()); *messageId = detach_from(this->shim().PublishBinaryMessage(*reinterpret_cast(&messageType), *reinterpret_cast(&message), *reinterpret_cast(&messageTransmittedHandler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall PublishUriMessage(void* message, int64_t* messageId) noexcept final try { typename D::abi_guard guard(this->shim()); *messageId = detach_from(this->shim().PublishUriMessage(*reinterpret_cast(&message))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall PublishUriMessageWithCallback(void* message, void* messageTransmittedHandler, int64_t* messageId) noexcept final try { typename D::abi_guard guard(this->shim()); *messageId = detach_from(this->shim().PublishUriMessage(*reinterpret_cast(&message), *reinterpret_cast(&messageTransmittedHandler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall StopSubscribingForMessage(int64_t subscriptionId) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().StopSubscribingForMessage(subscriptionId); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall StopPublishingMessage(int64_t messageId) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().StopPublishingMessage(messageId); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_DeviceArrived(void* arrivedHandler, winrt::event_token* cookie) noexcept final try { zero_abi(cookie); typename D::abi_guard guard(this->shim()); *cookie = detach_from(this->shim().DeviceArrived(*reinterpret_cast(&arrivedHandler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_DeviceArrived(winrt::event_token cookie) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().DeviceArrived(*reinterpret_cast(&cookie)); return 0; } int32_t __stdcall add_DeviceDeparted(void* departedHandler, winrt::event_token* cookie) noexcept final try { zero_abi(cookie); typename D::abi_guard guard(this->shim()); *cookie = detach_from(this->shim().DeviceDeparted(*reinterpret_cast(&departedHandler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_DeviceDeparted(winrt::event_token cookie) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().DeviceDeparted(*reinterpret_cast(&cookie)); return 0; } int32_t __stdcall get_MaxMessageBytes(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaxMessageBytes()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BitsPerSecond(uint64_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BitsPerSecond()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDeviceSelector(void** selector) noexcept final try { clear_abi(selector); typename D::abi_guard guard(this->shim()); *selector = detach_from(this->shim().GetDeviceSelector()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDefault(void** proximityDevice) noexcept final try { clear_abi(proximityDevice); typename D::abi_guard guard(this->shim()); *proximityDevice = detach_from(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromId(void* deviceId, void** proximityDevice) noexcept final try { clear_abi(proximityDevice); typename D::abi_guard guard(this->shim()); *proximityDevice = detach_from(this->shim().FromId(*reinterpret_cast(&deviceId))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_MessageType(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MessageType()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SubscriptionId(int64_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SubscriptionId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Data(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Data()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DataAsString(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DataAsString()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_State(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().State()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Id(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Id()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Socket(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Socket()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Networking::Proximity { constexpr auto operator|(PeerDiscoveryTypes const left, PeerDiscoveryTypes const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(PeerDiscoveryTypes& left, PeerDiscoveryTypes const right) noexcept { left = left | right; return left; } constexpr auto operator&(PeerDiscoveryTypes const left, PeerDiscoveryTypes const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(PeerDiscoveryTypes& left, PeerDiscoveryTypes const right) noexcept { left = left & right; return left; } constexpr auto operator~(PeerDiscoveryTypes const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(PeerDiscoveryTypes const left, PeerDiscoveryTypes const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(PeerDiscoveryTypes& left, PeerDiscoveryTypes const right) noexcept { left = left ^ right; return left; } inline auto PeerFinder::AllowBluetooth() { return impl::call_factory_cast([](IPeerFinderStatics const& f) { return f.AllowBluetooth(); }); } inline auto PeerFinder::AllowBluetooth(bool value) { impl::call_factory([&](IPeerFinderStatics const& f) { return f.AllowBluetooth(value); }); } inline auto PeerFinder::AllowInfrastructure() { return impl::call_factory_cast([](IPeerFinderStatics const& f) { return f.AllowInfrastructure(); }); } inline auto PeerFinder::AllowInfrastructure(bool value) { impl::call_factory([&](IPeerFinderStatics const& f) { return f.AllowInfrastructure(value); }); } inline auto PeerFinder::AllowWiFiDirect() { return impl::call_factory_cast([](IPeerFinderStatics const& f) { return f.AllowWiFiDirect(); }); } inline auto PeerFinder::AllowWiFiDirect(bool value) { impl::call_factory([&](IPeerFinderStatics const& f) { return f.AllowWiFiDirect(value); }); } inline auto PeerFinder::DisplayName() { return impl::call_factory_cast([](IPeerFinderStatics const& f) { return f.DisplayName(); }); } inline auto PeerFinder::DisplayName(param::hstring const& value) { impl::call_factory([&](IPeerFinderStatics const& f) { return f.DisplayName(value); }); } inline auto PeerFinder::SupportedDiscoveryTypes() { return impl::call_factory_cast([](IPeerFinderStatics const& f) { return f.SupportedDiscoveryTypes(); }); } inline auto PeerFinder::AlternateIdentities() { return impl::call_factory_cast(*)(IPeerFinderStatics const&), PeerFinder, IPeerFinderStatics>([](IPeerFinderStatics const& f) { return f.AlternateIdentities(); }); } inline auto PeerFinder::Start() { impl::call_factory_cast([](IPeerFinderStatics const& f) { return f.Start(); }); } inline auto PeerFinder::Start(param::hstring const& peerMessage) { impl::call_factory([&](IPeerFinderStatics const& f) { return f.Start(peerMessage); }); } inline auto PeerFinder::Stop() { impl::call_factory_cast([](IPeerFinderStatics const& f) { return f.Stop(); }); } inline auto PeerFinder::TriggeredConnectionStateChanged(winrt::Windows::Foundation::TypedEventHandler const& handler) { return impl::call_factory([&](IPeerFinderStatics const& f) { return f.TriggeredConnectionStateChanged(handler); }); } inline auto PeerFinder::TriggeredConnectionStateChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) { auto f = get_activation_factory(); return PeerFinder::TriggeredConnectionStateChanged_revoker{ f, f.TriggeredConnectionStateChanged(handler) }; } inline auto PeerFinder::TriggeredConnectionStateChanged(winrt::event_token const& cookie) { impl::call_factory([&](IPeerFinderStatics const& f) { return f.TriggeredConnectionStateChanged(cookie); }); } inline auto PeerFinder::ConnectionRequested(winrt::Windows::Foundation::TypedEventHandler const& handler) { return impl::call_factory([&](IPeerFinderStatics const& f) { return f.ConnectionRequested(handler); }); } inline auto PeerFinder::ConnectionRequested(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) { auto f = get_activation_factory(); return PeerFinder::ConnectionRequested_revoker{ f, f.ConnectionRequested(handler) }; } inline auto PeerFinder::ConnectionRequested(winrt::event_token const& cookie) { impl::call_factory([&](IPeerFinderStatics const& f) { return f.ConnectionRequested(cookie); }); } inline auto PeerFinder::FindAllPeersAsync() { return impl::call_factory_cast>(*)(IPeerFinderStatics const&), PeerFinder, IPeerFinderStatics>([](IPeerFinderStatics const& f) { return f.FindAllPeersAsync(); }); } inline auto PeerFinder::ConnectAsync(winrt::Windows::Networking::Proximity::PeerInformation const& peerInformation) { return impl::call_factory([&](IPeerFinderStatics const& f) { return f.ConnectAsync(peerInformation); }); } inline auto PeerFinder::Role() { return impl::call_factory_cast([](IPeerFinderStatics2 const& f) { return f.Role(); }); } inline auto PeerFinder::Role(winrt::Windows::Networking::Proximity::PeerRole const& value) { impl::call_factory([&](IPeerFinderStatics2 const& f) { return f.Role(value); }); } inline auto PeerFinder::DiscoveryData() { return impl::call_factory_cast([](IPeerFinderStatics2 const& f) { return f.DiscoveryData(); }); } inline auto PeerFinder::DiscoveryData(winrt::Windows::Storage::Streams::IBuffer const& value) { impl::call_factory([&](IPeerFinderStatics2 const& f) { return f.DiscoveryData(value); }); } inline auto PeerFinder::CreateWatcher() { return impl::call_factory_cast([](IPeerFinderStatics2 const& f) { return f.CreateWatcher(); }); } inline auto ProximityDevice::GetDeviceSelector() { return impl::call_factory_cast([](IProximityDeviceStatics const& f) { return f.GetDeviceSelector(); }); } inline auto ProximityDevice::GetDefault() { return impl::call_factory_cast([](IProximityDeviceStatics const& f) { return f.GetDefault(); }); } inline auto ProximityDevice::FromId(param::hstring const& deviceId) { return impl::call_factory([&](IProximityDeviceStatics const& f) { return f.FromId(deviceId); }); } template DeviceArrivedEventHandler::DeviceArrivedEventHandler(L handler) : DeviceArrivedEventHandler(impl::make_delegate(std::forward(handler))) { } template DeviceArrivedEventHandler::DeviceArrivedEventHandler(F* handler) : DeviceArrivedEventHandler([=](auto&&... args) { return handler(args...); }) { } template DeviceArrivedEventHandler::DeviceArrivedEventHandler(O* object, M method) : DeviceArrivedEventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) { } template DeviceArrivedEventHandler::DeviceArrivedEventHandler(com_ptr&& object, M method) : DeviceArrivedEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template DeviceArrivedEventHandler::DeviceArrivedEventHandler(weak_ref&& object, LM&& lambda_or_method) : DeviceArrivedEventHandler([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 DeviceArrivedEventHandler::DeviceArrivedEventHandler(std::shared_ptr&& object, M method) : DeviceArrivedEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template DeviceArrivedEventHandler::DeviceArrivedEventHandler(std::weak_ptr&& object, LM&& lambda_or_method) : DeviceArrivedEventHandler([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 DeviceArrivedEventHandler::operator()(winrt::Windows::Networking::Proximity::ProximityDevice const& sender) const { check_hresult((*(impl::abi_t**)this)->Invoke(*(void**)(&sender))); } template DeviceDepartedEventHandler::DeviceDepartedEventHandler(L handler) : DeviceDepartedEventHandler(impl::make_delegate(std::forward(handler))) { } template DeviceDepartedEventHandler::DeviceDepartedEventHandler(F* handler) : DeviceDepartedEventHandler([=](auto&&... args) { return handler(args...); }) { } template DeviceDepartedEventHandler::DeviceDepartedEventHandler(O* object, M method) : DeviceDepartedEventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) { } template DeviceDepartedEventHandler::DeviceDepartedEventHandler(com_ptr&& object, M method) : DeviceDepartedEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template DeviceDepartedEventHandler::DeviceDepartedEventHandler(weak_ref&& object, LM&& lambda_or_method) : DeviceDepartedEventHandler([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 DeviceDepartedEventHandler::DeviceDepartedEventHandler(std::shared_ptr&& object, M method) : DeviceDepartedEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template DeviceDepartedEventHandler::DeviceDepartedEventHandler(std::weak_ptr&& object, LM&& lambda_or_method) : DeviceDepartedEventHandler([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 DeviceDepartedEventHandler::operator()(winrt::Windows::Networking::Proximity::ProximityDevice const& sender) const { check_hresult((*(impl::abi_t**)this)->Invoke(*(void**)(&sender))); } template MessageReceivedHandler::MessageReceivedHandler(L handler) : MessageReceivedHandler(impl::make_delegate(std::forward(handler))) { } template MessageReceivedHandler::MessageReceivedHandler(F* handler) : MessageReceivedHandler([=](auto&&... args) { return handler(args...); }) { } template MessageReceivedHandler::MessageReceivedHandler(O* object, M method) : MessageReceivedHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) { } template MessageReceivedHandler::MessageReceivedHandler(com_ptr&& object, M method) : MessageReceivedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template MessageReceivedHandler::MessageReceivedHandler(weak_ref&& object, LM&& lambda_or_method) : MessageReceivedHandler([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 MessageReceivedHandler::MessageReceivedHandler(std::shared_ptr&& object, M method) : MessageReceivedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template MessageReceivedHandler::MessageReceivedHandler(std::weak_ptr&& object, LM&& lambda_or_method) : MessageReceivedHandler([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 MessageReceivedHandler::operator()(winrt::Windows::Networking::Proximity::ProximityDevice const& sender, winrt::Windows::Networking::Proximity::ProximityMessage const& message) const { check_hresult((*(impl::abi_t**)this)->Invoke(*(void**)(&sender), *(void**)(&message))); } template MessageTransmittedHandler::MessageTransmittedHandler(L handler) : MessageTransmittedHandler(impl::make_delegate(std::forward(handler))) { } template MessageTransmittedHandler::MessageTransmittedHandler(F* handler) : MessageTransmittedHandler([=](auto&&... args) { return handler(args...); }) { } template MessageTransmittedHandler::MessageTransmittedHandler(O* object, M method) : MessageTransmittedHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) { } template MessageTransmittedHandler::MessageTransmittedHandler(com_ptr&& object, M method) : MessageTransmittedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template MessageTransmittedHandler::MessageTransmittedHandler(weak_ref&& object, LM&& lambda_or_method) : MessageTransmittedHandler([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 MessageTransmittedHandler::MessageTransmittedHandler(std::shared_ptr&& object, M method) : MessageTransmittedHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template MessageTransmittedHandler::MessageTransmittedHandler(std::weak_ptr&& object, LM&& lambda_or_method) : MessageTransmittedHandler([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 MessageTransmittedHandler::operator()(winrt::Windows::Networking::Proximity::ProximityDevice const& sender, int64_t messageId) const { check_hresult((*(impl::abi_t**)this)->Invoke(*(void**)(&sender), messageId)); } } 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 {}; #endif #ifdef __cpp_lib_format #endif } #endif