// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_Devices_Enumeration_Pnp_H #define WINRT_Windows_Devices_Enumeration_Pnp_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.240405.15"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.240405.15" #include "winrt/Windows.Devices.Enumeration.h" #include "winrt/impl/Windows.Devices.Enumeration.2.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Devices.Enumeration.Pnp.2.h" namespace winrt::impl { template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObject::Type() const { winrt::Windows::Devices::Enumeration::Pnp::PnpObjectType value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObject)->get_Type(reinterpret_cast(&value))); return value; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObject::Id() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObject)->get_Id(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObject::Properties() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObject)->get_Properties(&value)); return winrt::Windows::Foundation::Collections::IMapView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObject::Update(winrt::Windows::Devices::Enumeration::Pnp::PnpObjectUpdate const& updateInfo) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObject)->Update(*(void**)(&updateInfo))); } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectStatics::CreateFromIdAsync(winrt::Windows::Devices::Enumeration::Pnp::PnpObjectType const& type, param::hstring const& id, param::async_iterable const& requestedProperties) const { void* asyncOp{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectStatics)->CreateFromIdAsync(static_cast(type), *(void**)(&id), *(void**)(&requestedProperties), &asyncOp)); return winrt::Windows::Foundation::IAsyncOperation{ asyncOp, take_ownership_from_abi }; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectStatics::FindAllAsync(winrt::Windows::Devices::Enumeration::Pnp::PnpObjectType const& type, param::async_iterable const& requestedProperties) const { void* asyncOp{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectStatics)->FindAllAsync(static_cast(type), *(void**)(&requestedProperties), &asyncOp)); return winrt::Windows::Foundation::IAsyncOperation{ asyncOp, take_ownership_from_abi }; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectStatics::FindAllAsync(winrt::Windows::Devices::Enumeration::Pnp::PnpObjectType const& type, param::async_iterable const& requestedProperties, param::hstring const& aqsFilter) const { void* asyncOp{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectStatics)->FindAllAsyncAqsFilter(static_cast(type), *(void**)(&requestedProperties), *(void**)(&aqsFilter), &asyncOp)); return winrt::Windows::Foundation::IAsyncOperation{ asyncOp, take_ownership_from_abi }; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectStatics::CreateWatcher(winrt::Windows::Devices::Enumeration::Pnp::PnpObjectType const& type, param::iterable const& requestedProperties) const { void* watcher{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectStatics)->CreateWatcher(static_cast(type), *(void**)(&requestedProperties), &watcher)); return winrt::Windows::Devices::Enumeration::Pnp::PnpObjectWatcher{ watcher, take_ownership_from_abi }; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectStatics::CreateWatcher(winrt::Windows::Devices::Enumeration::Pnp::PnpObjectType const& type, param::iterable const& requestedProperties, param::hstring const& aqsFilter) const { void* watcher{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectStatics)->CreateWatcherAqsFilter(static_cast(type), *(void**)(&requestedProperties), *(void**)(&aqsFilter), &watcher)); return winrt::Windows::Devices::Enumeration::Pnp::PnpObjectWatcher{ watcher, take_ownership_from_abi }; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectUpdate::Type() const { winrt::Windows::Devices::Enumeration::Pnp::PnpObjectType value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectUpdate)->get_Type(reinterpret_cast(&value))); return value; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectUpdate::Id() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectUpdate)->get_Id(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectUpdate::Properties() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectUpdate)->get_Properties(&value)); return winrt::Windows::Foundation::Collections::IMapView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Added(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectWatcher)->add_Added(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Added(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, Added(handler)); } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Added(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectWatcher)->remove_Added(impl::bind_in(token)); } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Updated(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectWatcher)->add_Updated(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Updated(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, Updated(handler)); } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Updated(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectWatcher)->remove_Updated(impl::bind_in(token)); } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Removed(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectWatcher)->add_Removed(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Removed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, Removed(handler)); } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Removed(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectWatcher)->remove_Removed(impl::bind_in(token)); } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::EnumerationCompleted(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectWatcher)->add_EnumerationCompleted(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::EnumerationCompleted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, EnumerationCompleted(handler)); } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::EnumerationCompleted(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectWatcher)->remove_EnumerationCompleted(impl::bind_in(token)); } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Stopped(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectWatcher)->add_Stopped(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Stopped(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, Stopped(handler)); } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Stopped(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectWatcher)->remove_Stopped(impl::bind_in(token)); } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Status() const { winrt::Windows::Devices::Enumeration::DeviceWatcherStatus status{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectWatcher)->get_Status(reinterpret_cast(&status))); return status; } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Start() const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectWatcher)->Start()); } template auto consume_Windows_Devices_Enumeration_Pnp_IPnpObjectWatcher::Stop() const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Enumeration::Pnp::IPnpObjectWatcher)->Stop()); } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Type(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Type()); return 0; } catch (...) { return to_hresult(); } 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_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(); } int32_t __stdcall Update(void* updateInfo) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Update(*reinterpret_cast(&updateInfo)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateFromIdAsync(int32_t type, void* id, void* requestedProperties, void** asyncOp) noexcept final try { clear_abi(asyncOp); typename D::abi_guard guard(this->shim()); *asyncOp = detach_from>(this->shim().CreateFromIdAsync(*reinterpret_cast(&type), *reinterpret_cast(&id), *reinterpret_cast const*>(&requestedProperties))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FindAllAsync(int32_t type, void* requestedProperties, void** asyncOp) noexcept final try { clear_abi(asyncOp); typename D::abi_guard guard(this->shim()); *asyncOp = detach_from>(this->shim().FindAllAsync(*reinterpret_cast(&type), *reinterpret_cast const*>(&requestedProperties))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FindAllAsyncAqsFilter(int32_t type, void* requestedProperties, void* aqsFilter, void** asyncOp) noexcept final try { clear_abi(asyncOp); typename D::abi_guard guard(this->shim()); *asyncOp = detach_from>(this->shim().FindAllAsync(*reinterpret_cast(&type), *reinterpret_cast const*>(&requestedProperties), *reinterpret_cast(&aqsFilter))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateWatcher(int32_t type, void* requestedProperties, void** watcher) noexcept final try { clear_abi(watcher); typename D::abi_guard guard(this->shim()); *watcher = detach_from(this->shim().CreateWatcher(*reinterpret_cast(&type), *reinterpret_cast const*>(&requestedProperties))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateWatcherAqsFilter(int32_t type, void* requestedProperties, void* aqsFilter, void** watcher) noexcept final try { clear_abi(watcher); typename D::abi_guard guard(this->shim()); *watcher = detach_from(this->shim().CreateWatcher(*reinterpret_cast(&type), *reinterpret_cast const*>(&requestedProperties), *reinterpret_cast(&aqsFilter))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Type(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Type()); return 0; } catch (...) { return to_hresult(); } 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_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 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_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_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_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 } WINRT_EXPORT namespace winrt::Windows::Devices::Enumeration::Pnp { inline auto PnpObject::CreateFromIdAsync(winrt::Windows::Devices::Enumeration::Pnp::PnpObjectType const& type, param::hstring const& id, param::async_iterable const& requestedProperties) { return impl::call_factory([&](IPnpObjectStatics const& f) { return f.CreateFromIdAsync(type, id, requestedProperties); }); } inline auto PnpObject::FindAllAsync(winrt::Windows::Devices::Enumeration::Pnp::PnpObjectType const& type, param::async_iterable const& requestedProperties) { return impl::call_factory([&](IPnpObjectStatics const& f) { return f.FindAllAsync(type, requestedProperties); }); } inline auto PnpObject::FindAllAsync(winrt::Windows::Devices::Enumeration::Pnp::PnpObjectType const& type, param::async_iterable const& requestedProperties, param::hstring const& aqsFilter) { return impl::call_factory([&](IPnpObjectStatics const& f) { return f.FindAllAsync(type, requestedProperties, aqsFilter); }); } inline auto PnpObject::CreateWatcher(winrt::Windows::Devices::Enumeration::Pnp::PnpObjectType const& type, param::iterable const& requestedProperties) { return impl::call_factory([&](IPnpObjectStatics const& f) { return f.CreateWatcher(type, requestedProperties); }); } inline auto PnpObject::CreateWatcher(winrt::Windows::Devices::Enumeration::Pnp::PnpObjectType const& type, param::iterable const& requestedProperties, param::hstring const& aqsFilter) { return impl::call_factory([&](IPnpObjectStatics const& f) { return f.CreateWatcher(type, requestedProperties, aqsFilter); }); } } 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 {}; #endif #ifdef __cpp_lib_format #endif } #endif