// C++/WinRT v2.0.250303.1 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Devices_Usb_H #define WINRT_Windows_Devices_Usb_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.Devices.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Storage.Streams.2.h" #include "winrt/impl/Windows.Devices.Usb.2.h" namespace winrt::impl { template auto consume_Windows_Devices_Usb_IUsbBulkInEndpointDescriptor::MaxPacketSize() 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_MaxPacketSize(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MaxPacketSize(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbBulkInEndpointDescriptor::EndpointNumber() const { uint8_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_EndpointNumber(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_EndpointNumber(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbBulkInEndpointDescriptor::Pipe() 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_Pipe(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Pipe(&value)); } return winrt::Windows::Devices::Usb::UsbBulkInPipe{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbBulkInPipe::MaxTransferSizeBytes() 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_MaxTransferSizeBytes(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MaxTransferSizeBytes(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbBulkInPipe::EndpointDescriptor() 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_EndpointDescriptor(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_EndpointDescriptor(&value)); } return winrt::Windows::Devices::Usb::UsbBulkInEndpointDescriptor{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbBulkInPipe::ClearStallAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ClearStallAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ClearStallAsync(&operation)); } return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbBulkInPipe::ReadOptions(winrt::Windows::Devices::Usb::UsbReadOptions 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_ReadOptions(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_ReadOptions(static_cast(value))); } } template auto consume_Windows_Devices_Usb_IUsbBulkInPipe::ReadOptions() const { winrt::Windows::Devices::Usb::UsbReadOptions 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_ReadOptions(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ReadOptions(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Devices_Usb_IUsbBulkInPipe::FlushBuffer() 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->FlushBuffer()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->FlushBuffer()); } } template auto consume_Windows_Devices_Usb_IUsbBulkInPipe::InputStream() 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_InputStream(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_InputStream(&value)); } return winrt::Windows::Storage::Streams::IInputStream{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbBulkOutEndpointDescriptor::MaxPacketSize() 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_MaxPacketSize(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MaxPacketSize(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbBulkOutEndpointDescriptor::EndpointNumber() const { uint8_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_EndpointNumber(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_EndpointNumber(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbBulkOutEndpointDescriptor::Pipe() 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_Pipe(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Pipe(&value)); } return winrt::Windows::Devices::Usb::UsbBulkOutPipe{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbBulkOutPipe::EndpointDescriptor() 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_EndpointDescriptor(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_EndpointDescriptor(&value)); } return winrt::Windows::Devices::Usb::UsbBulkOutEndpointDescriptor{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbBulkOutPipe::ClearStallAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ClearStallAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ClearStallAsync(&operation)); } return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbBulkOutPipe::WriteOptions(winrt::Windows::Devices::Usb::UsbWriteOptions 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_WriteOptions(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_WriteOptions(static_cast(value))); } } template auto consume_Windows_Devices_Usb_IUsbBulkOutPipe::WriteOptions() const { winrt::Windows::Devices::Usb::UsbWriteOptions 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_WriteOptions(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_WriteOptions(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Devices_Usb_IUsbBulkOutPipe::OutputStream() 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_OutputStream(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_OutputStream(&value)); } return winrt::Windows::Storage::Streams::IOutputStream{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbConfiguration::UsbInterfaces() 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_UsbInterfaces(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UsbInterfaces(&value)); } return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbConfiguration::ConfigurationDescriptor() 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_ConfigurationDescriptor(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ConfigurationDescriptor(&value)); } return winrt::Windows::Devices::Usb::UsbConfigurationDescriptor{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbConfiguration::Descriptors() 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_Descriptors(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Descriptors(&value)); } return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbConfigurationDescriptor::ConfigurationValue() const { uint8_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_ConfigurationValue(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ConfigurationValue(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbConfigurationDescriptor::MaxPowerMilliamps() 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_MaxPowerMilliamps(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MaxPowerMilliamps(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbConfigurationDescriptor::SelfPowered() 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_SelfPowered(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_SelfPowered(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbConfigurationDescriptor::RemoteWakeup() 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_RemoteWakeup(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_RemoteWakeup(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbConfigurationDescriptorStatics::TryParse(winrt::Windows::Devices::Usb::UsbDescriptor const& descriptor, winrt::Windows::Devices::Usb::UsbConfigurationDescriptor& parsed) const { bool success{}; 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->TryParse(*(void**)(&descriptor), impl::bind_out(parsed), &success)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->TryParse(*(void**)(&descriptor), impl::bind_out(parsed), &success)); } return success; } template auto consume_Windows_Devices_Usb_IUsbConfigurationDescriptorStatics::Parse(winrt::Windows::Devices::Usb::UsbDescriptor const& descriptor) const { void* parsed{}; 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->Parse(*(void**)(&descriptor), &parsed)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Parse(*(void**)(&descriptor), &parsed)); } return winrt::Windows::Devices::Usb::UsbConfigurationDescriptor{ parsed, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbControlRequestType::Direction() const { winrt::Windows::Devices::Usb::UsbTransferDirection 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_Direction(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Direction(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Devices_Usb_IUsbControlRequestType::Direction(winrt::Windows::Devices::Usb::UsbTransferDirection 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_Direction(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Direction(static_cast(value))); } } template auto consume_Windows_Devices_Usb_IUsbControlRequestType::ControlTransferType() const { winrt::Windows::Devices::Usb::UsbControlTransferType 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_ControlTransferType(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ControlTransferType(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Devices_Usb_IUsbControlRequestType::ControlTransferType(winrt::Windows::Devices::Usb::UsbControlTransferType 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_ControlTransferType(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_ControlTransferType(static_cast(value))); } } template auto consume_Windows_Devices_Usb_IUsbControlRequestType::Recipient() const { winrt::Windows::Devices::Usb::UsbControlRecipient 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_Recipient(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Recipient(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Devices_Usb_IUsbControlRequestType::Recipient(winrt::Windows::Devices::Usb::UsbControlRecipient 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_Recipient(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Recipient(static_cast(value))); } } template auto consume_Windows_Devices_Usb_IUsbControlRequestType::AsByte() const { uint8_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_AsByte(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AsByte(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbControlRequestType::AsByte(uint8_t 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_AsByte(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_AsByte(value)); } } template auto consume_Windows_Devices_Usb_IUsbDescriptor::Length() const { uint8_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_Length(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Length(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbDescriptor::DescriptorType() const { uint8_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_DescriptorType(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DescriptorType(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbDescriptor::ReadDescriptorBuffer(winrt::Windows::Storage::Streams::IBuffer const& buffer) 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->ReadDescriptorBuffer(*(void**)(&buffer))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadDescriptorBuffer(*(void**)(&buffer))); } } template auto consume_Windows_Devices_Usb_IUsbDevice::SendControlOutTransferAsync(winrt::Windows::Devices::Usb::UsbSetupPacket const& setupPacket, winrt::Windows::Storage::Streams::IBuffer const& buffer) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->SendControlOutTransferAsync(*(void**)(&setupPacket), *(void**)(&buffer), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SendControlOutTransferAsync(*(void**)(&setupPacket), *(void**)(&buffer), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDevice::SendControlOutTransferAsync(winrt::Windows::Devices::Usb::UsbSetupPacket const& setupPacket) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->SendControlOutTransferAsyncNoBuffer(*(void**)(&setupPacket), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SendControlOutTransferAsyncNoBuffer(*(void**)(&setupPacket), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDevice::SendControlInTransferAsync(winrt::Windows::Devices::Usb::UsbSetupPacket const& setupPacket, winrt::Windows::Storage::Streams::IBuffer const& buffer) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->SendControlInTransferAsync(*(void**)(&setupPacket), *(void**)(&buffer), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SendControlInTransferAsync(*(void**)(&setupPacket), *(void**)(&buffer), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDevice::SendControlInTransferAsync(winrt::Windows::Devices::Usb::UsbSetupPacket const& setupPacket) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->SendControlInTransferAsyncNoBuffer(*(void**)(&setupPacket), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SendControlInTransferAsyncNoBuffer(*(void**)(&setupPacket), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDevice::DefaultInterface() 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_DefaultInterface(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DefaultInterface(&value)); } return winrt::Windows::Devices::Usb::UsbInterface{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDevice::DeviceDescriptor() 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_DeviceDescriptor(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DeviceDescriptor(&value)); } return winrt::Windows::Devices::Usb::UsbDeviceDescriptor{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDevice::Configuration() 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_Configuration(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Configuration(&value)); } return winrt::Windows::Devices::Usb::UsbConfiguration{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceClass::ClassCode() const { uint8_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_ClassCode(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ClassCode(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbDeviceClass::ClassCode(uint8_t 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_ClassCode(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_ClassCode(value)); } } template auto consume_Windows_Devices_Usb_IUsbDeviceClass::SubclassCode() 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_SubclassCode(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_SubclassCode(&value)); } return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceClass::SubclassCode(winrt::Windows::Foundation::IReference 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_SubclassCode(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_SubclassCode(*(void**)(&value))); } } template auto consume_Windows_Devices_Usb_IUsbDeviceClass::ProtocolCode() 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_ProtocolCode(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ProtocolCode(&value)); } return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceClass::ProtocolCode(winrt::Windows::Foundation::IReference 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_ProtocolCode(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_ProtocolCode(*(void**)(&value))); } } template auto consume_Windows_Devices_Usb_IUsbDeviceClassesStatics::CdcControl() 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_CdcControl(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_CdcControl(&value)); } return winrt::Windows::Devices::Usb::UsbDeviceClass{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceClassesStatics::Physical() 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_Physical(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Physical(&value)); } return winrt::Windows::Devices::Usb::UsbDeviceClass{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceClassesStatics::PersonalHealthcare() 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_PersonalHealthcare(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_PersonalHealthcare(&value)); } return winrt::Windows::Devices::Usb::UsbDeviceClass{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceClassesStatics::ActiveSync() 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_ActiveSync(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ActiveSync(&value)); } return winrt::Windows::Devices::Usb::UsbDeviceClass{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceClassesStatics::PalmSync() 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_PalmSync(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_PalmSync(&value)); } return winrt::Windows::Devices::Usb::UsbDeviceClass{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceClassesStatics::DeviceFirmwareUpdate() 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_DeviceFirmwareUpdate(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DeviceFirmwareUpdate(&value)); } return winrt::Windows::Devices::Usb::UsbDeviceClass{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceClassesStatics::Irda() 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_Irda(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Irda(&value)); } return winrt::Windows::Devices::Usb::UsbDeviceClass{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceClassesStatics::Measurement() 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_Measurement(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Measurement(&value)); } return winrt::Windows::Devices::Usb::UsbDeviceClass{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceClassesStatics::VendorSpecific() 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_VendorSpecific(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_VendorSpecific(&value)); } return winrt::Windows::Devices::Usb::UsbDeviceClass{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceDescriptor::BcdUsb() 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_BcdUsb(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_BcdUsb(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbDeviceDescriptor::MaxPacketSize0() const { uint8_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_MaxPacketSize0(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MaxPacketSize0(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbDeviceDescriptor::VendorId() 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_VendorId(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_VendorId(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbDeviceDescriptor::ProductId() 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_ProductId(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ProductId(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbDeviceDescriptor::BcdDeviceRevision() 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_BcdDeviceRevision(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_BcdDeviceRevision(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbDeviceDescriptor::NumberOfConfigurations() const { uint8_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_NumberOfConfigurations(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_NumberOfConfigurations(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbDeviceStatics::GetDeviceSelector(uint32_t vendorId, uint32_t productId, winrt::guid const& winUsbInterfaceClass) 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->GetDeviceSelector(vendorId, productId, impl::bind_in(winUsbInterfaceClass), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetDeviceSelector(vendorId, productId, impl::bind_in(winUsbInterfaceClass), &value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceStatics::GetDeviceSelector(winrt::guid const& winUsbInterfaceClass) 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->GetDeviceSelectorGuidOnly(impl::bind_in(winUsbInterfaceClass), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetDeviceSelectorGuidOnly(impl::bind_in(winUsbInterfaceClass), &value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceStatics::GetDeviceSelector(uint32_t vendorId, uint32_t productId) 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->GetDeviceSelectorVidPidOnly(vendorId, productId, &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetDeviceSelectorVidPidOnly(vendorId, productId, &value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceStatics::GetDeviceClassSelector(winrt::Windows::Devices::Usb::UsbDeviceClass const& usbClass) 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->GetDeviceClassSelector(*(void**)(&usbClass), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetDeviceClassSelector(*(void**)(&usbClass), &value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbDeviceStatics::FromIdAsync(param::hstring const& deviceId) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->FromIdAsync(*(void**)(&deviceId), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->FromIdAsync(*(void**)(&deviceId), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbEndpointDescriptor::EndpointNumber() const { uint8_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_EndpointNumber(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_EndpointNumber(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbEndpointDescriptor::Direction() const { winrt::Windows::Devices::Usb::UsbTransferDirection 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_Direction(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Direction(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Devices_Usb_IUsbEndpointDescriptor::EndpointType() const { winrt::Windows::Devices::Usb::UsbEndpointType 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_EndpointType(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_EndpointType(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Devices_Usb_IUsbEndpointDescriptor::AsBulkInEndpointDescriptor() 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_AsBulkInEndpointDescriptor(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AsBulkInEndpointDescriptor(&value)); } return winrt::Windows::Devices::Usb::UsbBulkInEndpointDescriptor{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbEndpointDescriptor::AsInterruptInEndpointDescriptor() 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_AsInterruptInEndpointDescriptor(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AsInterruptInEndpointDescriptor(&value)); } return winrt::Windows::Devices::Usb::UsbInterruptInEndpointDescriptor{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbEndpointDescriptor::AsBulkOutEndpointDescriptor() 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_AsBulkOutEndpointDescriptor(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AsBulkOutEndpointDescriptor(&value)); } return winrt::Windows::Devices::Usb::UsbBulkOutEndpointDescriptor{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbEndpointDescriptor::AsInterruptOutEndpointDescriptor() 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_AsInterruptOutEndpointDescriptor(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AsInterruptOutEndpointDescriptor(&value)); } return winrt::Windows::Devices::Usb::UsbInterruptOutEndpointDescriptor{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbEndpointDescriptorStatics::TryParse(winrt::Windows::Devices::Usb::UsbDescriptor const& descriptor, winrt::Windows::Devices::Usb::UsbEndpointDescriptor& parsed) const { bool success{}; 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->TryParse(*(void**)(&descriptor), impl::bind_out(parsed), &success)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->TryParse(*(void**)(&descriptor), impl::bind_out(parsed), &success)); } return success; } template auto consume_Windows_Devices_Usb_IUsbEndpointDescriptorStatics::Parse(winrt::Windows::Devices::Usb::UsbDescriptor const& descriptor) const { void* parsed{}; 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->Parse(*(void**)(&descriptor), &parsed)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Parse(*(void**)(&descriptor), &parsed)); } return winrt::Windows::Devices::Usb::UsbEndpointDescriptor{ parsed, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterface::BulkInPipes() 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_BulkInPipes(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_BulkInPipes(&value)); } return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterface::InterruptInPipes() 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_InterruptInPipes(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_InterruptInPipes(&value)); } return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterface::BulkOutPipes() 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_BulkOutPipes(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_BulkOutPipes(&value)); } return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterface::InterruptOutPipes() 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_InterruptOutPipes(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_InterruptOutPipes(&value)); } return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterface::InterfaceSettings() 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_InterfaceSettings(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_InterfaceSettings(&value)); } return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterface::InterfaceNumber() const { uint8_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_InterfaceNumber(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_InterfaceNumber(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbInterface::Descriptors() 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_Descriptors(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Descriptors(&value)); } return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterfaceDescriptor::ClassCode() const { uint8_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_ClassCode(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ClassCode(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbInterfaceDescriptor::SubclassCode() const { uint8_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_SubclassCode(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_SubclassCode(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbInterfaceDescriptor::ProtocolCode() const { uint8_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_ProtocolCode(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ProtocolCode(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbInterfaceDescriptor::AlternateSettingNumber() const { uint8_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_AlternateSettingNumber(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AlternateSettingNumber(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbInterfaceDescriptor::InterfaceNumber() const { uint8_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_InterfaceNumber(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_InterfaceNumber(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbInterfaceDescriptorStatics::TryParse(winrt::Windows::Devices::Usb::UsbDescriptor const& descriptor, winrt::Windows::Devices::Usb::UsbInterfaceDescriptor& parsed) const { bool success{}; 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->TryParse(*(void**)(&descriptor), impl::bind_out(parsed), &success)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->TryParse(*(void**)(&descriptor), impl::bind_out(parsed), &success)); } return success; } template auto consume_Windows_Devices_Usb_IUsbInterfaceDescriptorStatics::Parse(winrt::Windows::Devices::Usb::UsbDescriptor const& descriptor) const { void* parsed{}; 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->Parse(*(void**)(&descriptor), &parsed)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Parse(*(void**)(&descriptor), &parsed)); } return winrt::Windows::Devices::Usb::UsbInterfaceDescriptor{ parsed, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterfaceSetting::BulkInEndpoints() 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_BulkInEndpoints(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_BulkInEndpoints(&value)); } return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterfaceSetting::InterruptInEndpoints() 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_InterruptInEndpoints(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_InterruptInEndpoints(&value)); } return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterfaceSetting::BulkOutEndpoints() 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_BulkOutEndpoints(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_BulkOutEndpoints(&value)); } return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterfaceSetting::InterruptOutEndpoints() 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_InterruptOutEndpoints(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_InterruptOutEndpoints(&value)); } return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterfaceSetting::Selected() 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_Selected(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Selected(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbInterfaceSetting::SelectSettingAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->SelectSettingAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SelectSettingAsync(&operation)); } return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterfaceSetting::InterfaceDescriptor() 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_InterfaceDescriptor(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_InterfaceDescriptor(&value)); } return winrt::Windows::Devices::Usb::UsbInterfaceDescriptor{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterfaceSetting::Descriptors() 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_Descriptors(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Descriptors(&value)); } return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterruptInEndpointDescriptor::MaxPacketSize() 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_MaxPacketSize(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MaxPacketSize(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbInterruptInEndpointDescriptor::EndpointNumber() const { uint8_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_EndpointNumber(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_EndpointNumber(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbInterruptInEndpointDescriptor::Interval() const { winrt::Windows::Foundation::TimeSpan 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_Interval(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Interval(put_abi(value))); } return value; } template auto consume_Windows_Devices_Usb_IUsbInterruptInEndpointDescriptor::Pipe() 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_Pipe(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Pipe(&value)); } return winrt::Windows::Devices::Usb::UsbInterruptInPipe{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterruptInEventArgs::InterruptData() 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_InterruptData(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_InterruptData(&value)); } return winrt::Windows::Storage::Streams::IBuffer{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterruptInPipe::EndpointDescriptor() 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_EndpointDescriptor(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_EndpointDescriptor(&value)); } return winrt::Windows::Devices::Usb::UsbInterruptInEndpointDescriptor{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterruptInPipe::ClearStallAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ClearStallAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ClearStallAsync(&operation)); } return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterruptInPipe::DataReceived(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_DataReceived(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_DataReceived(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Windows_Devices_Usb_IUsbInterruptInPipe::DataReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, DataReceived(handler)); } template auto consume_Windows_Devices_Usb_IUsbInterruptInPipe::DataReceived(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_DataReceived(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_DataReceived(impl::bind_in(token)); } } template auto consume_Windows_Devices_Usb_IUsbInterruptOutEndpointDescriptor::MaxPacketSize() 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_MaxPacketSize(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MaxPacketSize(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbInterruptOutEndpointDescriptor::EndpointNumber() const { uint8_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_EndpointNumber(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_EndpointNumber(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbInterruptOutEndpointDescriptor::Interval() const { winrt::Windows::Foundation::TimeSpan 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_Interval(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Interval(put_abi(value))); } return value; } template auto consume_Windows_Devices_Usb_IUsbInterruptOutEndpointDescriptor::Pipe() 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_Pipe(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Pipe(&value)); } return winrt::Windows::Devices::Usb::UsbInterruptOutPipe{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterruptOutPipe::EndpointDescriptor() 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_EndpointDescriptor(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_EndpointDescriptor(&value)); } return winrt::Windows::Devices::Usb::UsbInterruptOutEndpointDescriptor{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterruptOutPipe::ClearStallAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ClearStallAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ClearStallAsync(&operation)); } return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbInterruptOutPipe::WriteOptions(winrt::Windows::Devices::Usb::UsbWriteOptions 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_WriteOptions(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_WriteOptions(static_cast(value))); } } template auto consume_Windows_Devices_Usb_IUsbInterruptOutPipe::WriteOptions() const { winrt::Windows::Devices::Usb::UsbWriteOptions 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_WriteOptions(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_WriteOptions(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Devices_Usb_IUsbInterruptOutPipe::OutputStream() 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_OutputStream(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_OutputStream(&value)); } return winrt::Windows::Storage::Streams::IOutputStream{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbSetupPacket::RequestType() 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_RequestType(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_RequestType(&value)); } return winrt::Windows::Devices::Usb::UsbControlRequestType{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Usb_IUsbSetupPacket::RequestType(winrt::Windows::Devices::Usb::UsbControlRequestType 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_RequestType(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_RequestType(*(void**)(&value))); } } template auto consume_Windows_Devices_Usb_IUsbSetupPacket::Request() const { uint8_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_Request(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Request(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbSetupPacket::Request(uint8_t 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_Request(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Request(value)); } } template auto consume_Windows_Devices_Usb_IUsbSetupPacket::Value() 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_Value(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Value(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbSetupPacket::Value(uint32_t 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_Value(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Value(value)); } } template auto consume_Windows_Devices_Usb_IUsbSetupPacket::Index() 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_Index(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Index(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbSetupPacket::Index(uint32_t 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_Index(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Index(value)); } } template auto consume_Windows_Devices_Usb_IUsbSetupPacket::Length() 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_Length(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Length(&value)); } return value; } template auto consume_Windows_Devices_Usb_IUsbSetupPacket::Length(uint32_t 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_Length(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Length(value)); } } template auto consume_Windows_Devices_Usb_IUsbSetupPacketFactory::CreateWithEightByteBuffer(winrt::Windows::Storage::Streams::IBuffer const& eightByteBuffer) 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->CreateWithEightByteBuffer(*(void**)(&eightByteBuffer), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateWithEightByteBuffer(*(void**)(&eightByteBuffer), &value)); } return winrt::Windows::Devices::Usb::UsbSetupPacket{ value, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_MaxPacketSize(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaxPacketSize()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_EndpointNumber(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().EndpointNumber()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Pipe(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Pipe()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_MaxTransferSizeBytes(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaxTransferSizeBytes()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_EndpointDescriptor(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().EndpointDescriptor()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ClearStallAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().ClearStallAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ReadOptions(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReadOptions(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReadOptions(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadOptions()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FlushBuffer() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().FlushBuffer(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_InputStream(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().InputStream()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_MaxPacketSize(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaxPacketSize()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_EndpointNumber(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().EndpointNumber()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Pipe(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Pipe()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_EndpointDescriptor(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().EndpointDescriptor()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ClearStallAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().ClearStallAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_WriteOptions(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteOptions(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_WriteOptions(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().WriteOptions()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_OutputStream(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().OutputStream()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_UsbInterfaces(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().UsbInterfaces()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ConfigurationDescriptor(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ConfigurationDescriptor()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Descriptors(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().Descriptors()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_ConfigurationValue(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ConfigurationValue()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxPowerMilliamps(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaxPowerMilliamps()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SelfPowered(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SelfPowered()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_RemoteWakeup(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RemoteWakeup()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall TryParse(void* descriptor, void** parsed, bool* success) noexcept final try { clear_abi(parsed); typename D::abi_guard guard(this->shim()); *success = detach_from(this->shim().TryParse(*reinterpret_cast(&descriptor), *reinterpret_cast(parsed))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Parse(void* descriptor, void** parsed) noexcept final try { clear_abi(parsed); typename D::abi_guard guard(this->shim()); *parsed = detach_from(this->shim().Parse(*reinterpret_cast(&descriptor))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Direction(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Direction()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Direction(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Direction(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ControlTransferType(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ControlTransferType()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ControlTransferType(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ControlTransferType(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Recipient(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Recipient()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Recipient(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Recipient(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AsByte(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AsByte()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_AsByte(uint8_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AsByte(value); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Length(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Length()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DescriptorType(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DescriptorType()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadDescriptorBuffer(void* buffer) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReadDescriptorBuffer(*reinterpret_cast(&buffer)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall SendControlOutTransferAsync(void* setupPacket, void* buffer, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().SendControlOutTransferAsync(*reinterpret_cast(&setupPacket), *reinterpret_cast(&buffer))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SendControlOutTransferAsyncNoBuffer(void* setupPacket, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().SendControlOutTransferAsync(*reinterpret_cast(&setupPacket))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SendControlInTransferAsync(void* setupPacket, void* buffer, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().SendControlInTransferAsync(*reinterpret_cast(&setupPacket), *reinterpret_cast(&buffer))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SendControlInTransferAsyncNoBuffer(void* setupPacket, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().SendControlInTransferAsync(*reinterpret_cast(&setupPacket))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DefaultInterface(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DefaultInterface()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DeviceDescriptor(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DeviceDescriptor()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Configuration(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Configuration()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_ClassCode(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ClassCode()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ClassCode(uint8_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ClassCode(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SubclassCode(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().SubclassCode()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_SubclassCode(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SubclassCode(*reinterpret_cast const*>(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ProtocolCode(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().ProtocolCode()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ProtocolCode(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ProtocolCode(*reinterpret_cast const*>(&value)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_CdcControl(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CdcControl()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Physical(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Physical()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_PersonalHealthcare(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().PersonalHealthcare()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ActiveSync(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ActiveSync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_PalmSync(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().PalmSync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DeviceFirmwareUpdate(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DeviceFirmwareUpdate()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Irda(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Irda()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Measurement(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Measurement()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_VendorSpecific(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().VendorSpecific()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_BcdUsb(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BcdUsb()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxPacketSize0(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaxPacketSize0()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_VendorId(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().VendorId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ProductId(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ProductId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BcdDeviceRevision(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BcdDeviceRevision()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_NumberOfConfigurations(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().NumberOfConfigurations()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDeviceSelector(uint32_t vendorId, uint32_t productId, winrt::guid winUsbInterfaceClass, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetDeviceSelector(vendorId, productId, *reinterpret_cast(&winUsbInterfaceClass))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDeviceSelectorGuidOnly(winrt::guid winUsbInterfaceClass, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetDeviceSelector(*reinterpret_cast(&winUsbInterfaceClass))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDeviceSelectorVidPidOnly(uint32_t vendorId, uint32_t productId, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetDeviceSelector(vendorId, productId)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDeviceClassSelector(void* usbClass, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetDeviceClassSelector(*reinterpret_cast(&usbClass))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* deviceId, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().FromIdAsync(*reinterpret_cast(&deviceId))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_EndpointNumber(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().EndpointNumber()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Direction(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Direction()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_EndpointType(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().EndpointType()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AsBulkInEndpointDescriptor(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AsBulkInEndpointDescriptor()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AsInterruptInEndpointDescriptor(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AsInterruptInEndpointDescriptor()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AsBulkOutEndpointDescriptor(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AsBulkOutEndpointDescriptor()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AsInterruptOutEndpointDescriptor(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AsInterruptOutEndpointDescriptor()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall TryParse(void* descriptor, void** parsed, bool* success) noexcept final try { clear_abi(parsed); typename D::abi_guard guard(this->shim()); *success = detach_from(this->shim().TryParse(*reinterpret_cast(&descriptor), *reinterpret_cast(parsed))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Parse(void* descriptor, void** parsed) noexcept final try { clear_abi(parsed); typename D::abi_guard guard(this->shim()); *parsed = detach_from(this->shim().Parse(*reinterpret_cast(&descriptor))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_BulkInPipes(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().BulkInPipes()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_InterruptInPipes(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().InterruptInPipes()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BulkOutPipes(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().BulkOutPipes()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_InterruptOutPipes(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().InterruptOutPipes()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_InterfaceSettings(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().InterfaceSettings()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_InterfaceNumber(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().InterfaceNumber()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Descriptors(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().Descriptors()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_ClassCode(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ClassCode()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SubclassCode(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SubclassCode()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ProtocolCode(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ProtocolCode()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AlternateSettingNumber(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AlternateSettingNumber()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_InterfaceNumber(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().InterfaceNumber()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall TryParse(void* descriptor, void** parsed, bool* success) noexcept final try { clear_abi(parsed); typename D::abi_guard guard(this->shim()); *success = detach_from(this->shim().TryParse(*reinterpret_cast(&descriptor), *reinterpret_cast(parsed))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Parse(void* descriptor, void** parsed) noexcept final try { clear_abi(parsed); typename D::abi_guard guard(this->shim()); *parsed = detach_from(this->shim().Parse(*reinterpret_cast(&descriptor))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_BulkInEndpoints(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().BulkInEndpoints()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_InterruptInEndpoints(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().InterruptInEndpoints()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BulkOutEndpoints(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().BulkOutEndpoints()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_InterruptOutEndpoints(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().InterruptOutEndpoints()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Selected(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Selected()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SelectSettingAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().SelectSettingAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_InterfaceDescriptor(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().InterfaceDescriptor()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Descriptors(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().Descriptors()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_MaxPacketSize(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaxPacketSize()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_EndpointNumber(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().EndpointNumber()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Interval(int64_t* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Interval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Pipe(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Pipe()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_InterruptData(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().InterruptData()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_EndpointDescriptor(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().EndpointDescriptor()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ClearStallAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().ClearStallAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_DataReceived(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().DataReceived(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_DataReceived(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().DataReceived(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_MaxPacketSize(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaxPacketSize()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_EndpointNumber(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().EndpointNumber()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Interval(int64_t* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Interval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Pipe(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Pipe()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_EndpointDescriptor(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().EndpointDescriptor()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ClearStallAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().ClearStallAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_WriteOptions(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteOptions(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_WriteOptions(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().WriteOptions()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_OutputStream(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().OutputStream()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_RequestType(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RequestType()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_RequestType(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RequestType(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Request(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Request()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Request(uint8_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Request(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Value(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Value()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Value(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Value(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Index(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Index()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Index(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Index(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Length(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Length()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Length(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Length(value); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateWithEightByteBuffer(void* eightByteBuffer, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CreateWithEightByteBuffer(*reinterpret_cast(&eightByteBuffer))); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Devices::Usb { constexpr auto operator|(UsbReadOptions const left, UsbReadOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(UsbReadOptions& left, UsbReadOptions const right) noexcept { left = left | right; return left; } constexpr auto operator&(UsbReadOptions const left, UsbReadOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(UsbReadOptions& left, UsbReadOptions const right) noexcept { left = left & right; return left; } constexpr auto operator~(UsbReadOptions const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(UsbReadOptions const left, UsbReadOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(UsbReadOptions& left, UsbReadOptions const right) noexcept { left = left ^ right; return left; } constexpr auto operator|(UsbWriteOptions const left, UsbWriteOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(UsbWriteOptions& left, UsbWriteOptions const right) noexcept { left = left | right; return left; } constexpr auto operator&(UsbWriteOptions const left, UsbWriteOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(UsbWriteOptions& left, UsbWriteOptions const right) noexcept { left = left & right; return left; } constexpr auto operator~(UsbWriteOptions const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(UsbWriteOptions const left, UsbWriteOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(UsbWriteOptions& left, UsbWriteOptions const right) noexcept { left = left ^ right; return left; } inline auto UsbConfigurationDescriptor::TryParse(winrt::Windows::Devices::Usb::UsbDescriptor const& descriptor, winrt::Windows::Devices::Usb::UsbConfigurationDescriptor& parsed) { return impl::call_factory([&](IUsbConfigurationDescriptorStatics const& f) { return f.TryParse(descriptor, parsed); }); } inline auto UsbConfigurationDescriptor::Parse(winrt::Windows::Devices::Usb::UsbDescriptor const& descriptor) { return impl::call_factory([&](IUsbConfigurationDescriptorStatics const& f) { return f.Parse(descriptor); }); } inline UsbControlRequestType::UsbControlRequestType() : UsbControlRequestType(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline auto UsbDevice::GetDeviceSelector(uint32_t vendorId, uint32_t productId, winrt::guid const& winUsbInterfaceClass) { return impl::call_factory([&](IUsbDeviceStatics const& f) { return f.GetDeviceSelector(vendorId, productId, winUsbInterfaceClass); }); } inline auto UsbDevice::GetDeviceSelector(winrt::guid const& winUsbInterfaceClass) { return impl::call_factory([&](IUsbDeviceStatics const& f) { return f.GetDeviceSelector(winUsbInterfaceClass); }); } inline auto UsbDevice::GetDeviceSelector(uint32_t vendorId, uint32_t productId) { return impl::call_factory([&](IUsbDeviceStatics const& f) { return f.GetDeviceSelector(vendorId, productId); }); } inline auto UsbDevice::GetDeviceClassSelector(winrt::Windows::Devices::Usb::UsbDeviceClass const& usbClass) { return impl::call_factory([&](IUsbDeviceStatics const& f) { return f.GetDeviceClassSelector(usbClass); }); } inline auto UsbDevice::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory([&](IUsbDeviceStatics const& f) { return f.FromIdAsync(deviceId); }); } inline UsbDeviceClass::UsbDeviceClass() : UsbDeviceClass(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline auto UsbDeviceClasses::CdcControl() { return impl::call_factory_cast([](IUsbDeviceClassesStatics const& f) { return f.CdcControl(); }); } inline auto UsbDeviceClasses::Physical() { return impl::call_factory_cast([](IUsbDeviceClassesStatics const& f) { return f.Physical(); }); } inline auto UsbDeviceClasses::PersonalHealthcare() { return impl::call_factory_cast([](IUsbDeviceClassesStatics const& f) { return f.PersonalHealthcare(); }); } inline auto UsbDeviceClasses::ActiveSync() { return impl::call_factory_cast([](IUsbDeviceClassesStatics const& f) { return f.ActiveSync(); }); } inline auto UsbDeviceClasses::PalmSync() { return impl::call_factory_cast([](IUsbDeviceClassesStatics const& f) { return f.PalmSync(); }); } inline auto UsbDeviceClasses::DeviceFirmwareUpdate() { return impl::call_factory_cast([](IUsbDeviceClassesStatics const& f) { return f.DeviceFirmwareUpdate(); }); } inline auto UsbDeviceClasses::Irda() { return impl::call_factory_cast([](IUsbDeviceClassesStatics const& f) { return f.Irda(); }); } inline auto UsbDeviceClasses::Measurement() { return impl::call_factory_cast([](IUsbDeviceClassesStatics const& f) { return f.Measurement(); }); } inline auto UsbDeviceClasses::VendorSpecific() { return impl::call_factory_cast([](IUsbDeviceClassesStatics const& f) { return f.VendorSpecific(); }); } inline auto UsbEndpointDescriptor::TryParse(winrt::Windows::Devices::Usb::UsbDescriptor const& descriptor, winrt::Windows::Devices::Usb::UsbEndpointDescriptor& parsed) { return impl::call_factory([&](IUsbEndpointDescriptorStatics const& f) { return f.TryParse(descriptor, parsed); }); } inline auto UsbEndpointDescriptor::Parse(winrt::Windows::Devices::Usb::UsbDescriptor const& descriptor) { return impl::call_factory([&](IUsbEndpointDescriptorStatics const& f) { return f.Parse(descriptor); }); } inline auto UsbInterfaceDescriptor::TryParse(winrt::Windows::Devices::Usb::UsbDescriptor const& descriptor, winrt::Windows::Devices::Usb::UsbInterfaceDescriptor& parsed) { return impl::call_factory([&](IUsbInterfaceDescriptorStatics const& f) { return f.TryParse(descriptor, parsed); }); } inline auto UsbInterfaceDescriptor::Parse(winrt::Windows::Devices::Usb::UsbDescriptor const& descriptor) { return impl::call_factory([&](IUsbInterfaceDescriptorStatics const& f) { return f.Parse(descriptor); }); } inline UsbSetupPacket::UsbSetupPacket() : UsbSetupPacket(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline UsbSetupPacket::UsbSetupPacket(winrt::Windows::Storage::Streams::IBuffer const& eightByteBuffer) : UsbSetupPacket(impl::call_factory([&](IUsbSetupPacketFactory const& f) { return f.CreateWithEightByteBuffer(eightByteBuffer); })) { } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; 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