// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_Devices_Portable_H #define WINRT_Windows_Devices_Portable_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.h" #include "winrt/impl/Windows.Storage.2.h" #include "winrt/impl/Windows.Devices.Portable.2.h" namespace winrt::impl { template auto consume_Windows_Devices_Portable_IServiceDeviceStatics::GetDeviceSelector(winrt::Windows::Devices::Portable::ServiceDeviceType const& serviceType) const { void* selector{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Portable::IServiceDeviceStatics)->GetDeviceSelector(static_cast(serviceType), &selector)); return hstring{ selector, take_ownership_from_abi }; } template auto consume_Windows_Devices_Portable_IServiceDeviceStatics::GetDeviceSelectorFromServiceId(winrt::guid const& serviceId) const { void* selector{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Portable::IServiceDeviceStatics)->GetDeviceSelectorFromServiceId(impl::bind_in(serviceId), &selector)); return hstring{ selector, take_ownership_from_abi }; } template auto consume_Windows_Devices_Portable_IStorageDeviceStatics::FromId(param::hstring const& deviceId) const { void* deviceRoot{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Portable::IStorageDeviceStatics)->FromId(*(void**)(&deviceId), &deviceRoot)); return winrt::Windows::Storage::StorageFolder{ deviceRoot, take_ownership_from_abi }; } template auto consume_Windows_Devices_Portable_IStorageDeviceStatics::GetDeviceSelector() const { void* selector{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Portable::IStorageDeviceStatics)->GetDeviceSelector(&selector)); return hstring{ selector, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDeviceSelector(int32_t serviceType, void** selector) noexcept final try { clear_abi(selector); typename D::abi_guard guard(this->shim()); *selector = detach_from(this->shim().GetDeviceSelector(*reinterpret_cast(&serviceType))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDeviceSelectorFromServiceId(winrt::guid serviceId, void** selector) noexcept final try { clear_abi(selector); typename D::abi_guard guard(this->shim()); *selector = detach_from(this->shim().GetDeviceSelectorFromServiceId(*reinterpret_cast(&serviceId))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall FromId(void* deviceId, void** deviceRoot) noexcept final try { clear_abi(deviceRoot); typename D::abi_guard guard(this->shim()); *deviceRoot = detach_from(this->shim().FromId(*reinterpret_cast(&deviceId))); return 0; } catch (...) { return to_hresult(); } 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(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Devices::Portable { inline auto ServiceDevice::GetDeviceSelector(winrt::Windows::Devices::Portable::ServiceDeviceType const& serviceType) { return impl::call_factory([&](IServiceDeviceStatics const& f) { return f.GetDeviceSelector(serviceType); }); } inline auto ServiceDevice::GetDeviceSelectorFromServiceId(winrt::guid const& serviceId) { return impl::call_factory([&](IServiceDeviceStatics const& f) { return f.GetDeviceSelectorFromServiceId(serviceId); }); } inline auto StorageDevice::FromId(param::hstring const& deviceId) { return impl::call_factory([&](IStorageDeviceStatics const& f) { return f.FromId(deviceId); }); } inline auto StorageDevice::GetDeviceSelector() { return impl::call_factory_cast([](IStorageDeviceStatics const& f) { return f.GetDeviceSelector(); }); } } 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 {}; #endif #ifdef __cpp_lib_format #endif } #endif