// C++/WinRT v2.0.250303.1 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Gaming_Input_Preview_H #define WINRT_Windows_Gaming_Input_Preview_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.Gaming.Input.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Gaming.Input.2.h" #include "winrt/impl/Windows.Gaming.Input.Custom.2.h" #include "winrt/impl/Windows.System.2.h" #include "winrt/impl/Windows.Gaming.Input.Preview.2.h" namespace winrt::impl { template auto consume_Windows_Gaming_Input_Preview_IGameControllerProviderInfoStatics::GetParentProviderId(winrt::Windows::Gaming::Input::Custom::IGameControllerProvider const& provider) 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->GetParentProviderId(*(void**)(&provider), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetParentProviderId(*(void**)(&provider), &value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Gaming_Input_Preview_IGameControllerProviderInfoStatics::GetProviderId(winrt::Windows::Gaming::Input::Custom::IGameControllerProvider const& provider) 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->GetProviderId(*(void**)(&provider), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetProviderId(*(void**)(&provider), &value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::BatteryChargingState() const { winrt::Windows::Gaming::Input::Preview::GameControllerBatteryChargingState 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_BatteryChargingState(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_BatteryChargingState(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::BatteryKind() const { winrt::Windows::Gaming::Input::Preview::GameControllerBatteryKind 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_BatteryKind(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_BatteryKind(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::BatteryLevel() const { winrt::Windows::Gaming::Input::Preview::GameControllerBatteryLevel 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_BatteryLevel(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_BatteryLevel(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::GetDeviceFirmwareCorruptionState() const { winrt::Windows::Gaming::Input::Preview::GameControllerFirmwareCorruptReason 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->GetDeviceFirmwareCorruptionState(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetDeviceFirmwareCorruptionState(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::IsFirmwareCorrupted() 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_IsFirmwareCorrupted(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IsFirmwareCorrupted(&value)); } return value; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::IsInterfaceSupported(winrt::guid const& interfaceId) 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->IsInterfaceSupported(impl::bind_in(interfaceId), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsInterfaceSupported(impl::bind_in(interfaceId), &value)); } return value; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::IsSyntheticDevice() 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_IsSyntheticDevice(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IsSyntheticDevice(&value)); } return value; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::PreferredTypes() 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_PreferredTypes(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_PreferredTypes(&value)); } return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::ExecuteCommand(winrt::Windows::Gaming::Input::Preview::DeviceCommand const& command) 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->ExecuteCommand(static_cast(command))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ExecuteCommand(static_cast(command))); } } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::SetHomeLedIntensity(uint8_t intensity) 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->SetHomeLedIntensity(intensity)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SetHomeLedIntensity(intensity)); } } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::GetExtendedDeviceInfo() const { uint32_t buffer_impl_size{}; uint8_t* buffer{}; 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->GetExtendedDeviceInfo(&buffer_impl_size, &buffer)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetExtendedDeviceInfo(&buffer_impl_size, &buffer)); } return com_array{ buffer, buffer_impl_size, take_ownership_from_abi }; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::SetHeadsetOperation(winrt::Windows::Gaming::Input::Preview::HeadsetOperation const& operation, array_view 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->SetHeadsetOperation(static_cast(operation), buffer.size(), get_abi(buffer))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SetHeadsetOperation(static_cast(operation), buffer.size(), get_abi(buffer))); } } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::GetHeadsetOperation(winrt::Windows::Gaming::Input::Preview::HeadsetOperation const& operation) const { uint32_t buffer_impl_size{}; uint8_t* buffer{}; 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->GetHeadsetOperation(static_cast(operation), &buffer_impl_size, &buffer)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetHeadsetOperation(static_cast(operation), &buffer_impl_size, &buffer)); } return com_array{ buffer, buffer_impl_size, take_ownership_from_abi }; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::AppCompatVersion() 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_AppCompatVersion(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AppCompatVersion(&value)); } return value; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::SetStandardControllerButtonRemapping(winrt::Windows::System::User const& user, bool previous, param::map_view const& remapping) 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->SetStandardControllerButtonRemapping(*(void**)(&user), previous, *(void**)(&remapping))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SetStandardControllerButtonRemapping(*(void**)(&user), previous, *(void**)(&remapping))); } } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProvider::GetStandardControllerButtonRemapping(winrt::Windows::System::User const& user, bool previous) const { void* remapping{}; 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->GetStandardControllerButtonRemapping(*(void**)(&user), previous, &remapping)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetStandardControllerButtonRemapping(*(void**)(&user), previous, &remapping)); } return winrt::Windows::Foundation::Collections::IMapView{ remapping, take_ownership_from_abi }; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProviderStatics::FromGameController(winrt::Windows::Gaming::Input::IGameController const& controller) const { void* legacyGipGameControllerProvider{}; 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->FromGameController(*(void**)(&controller), &legacyGipGameControllerProvider)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->FromGameController(*(void**)(&controller), &legacyGipGameControllerProvider)); } return winrt::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider{ legacyGipGameControllerProvider, take_ownership_from_abi }; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProviderStatics::FromGameControllerProvider(winrt::Windows::Gaming::Input::Custom::IGameControllerProvider const& provider) const { void* legacyGipGameControllerProvider{}; 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->FromGameControllerProvider(*(void**)(&provider), &legacyGipGameControllerProvider)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->FromGameControllerProvider(*(void**)(&provider), &legacyGipGameControllerProvider)); } return winrt::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider{ legacyGipGameControllerProvider, take_ownership_from_abi }; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProviderStatics::PairPilotToCopilot(winrt::Windows::System::User const& user, param::hstring const& pilotControllerProviderId, param::hstring const& copilotControllerProviderId) 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->PairPilotToCopilot(*(void**)(&user), *(void**)(&pilotControllerProviderId), *(void**)(&copilotControllerProviderId))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->PairPilotToCopilot(*(void**)(&user), *(void**)(&pilotControllerProviderId), *(void**)(&copilotControllerProviderId))); } } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProviderStatics::ClearPairing(winrt::Windows::System::User const& user, param::hstring const& controllerProviderId) 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->ClearPairing(*(void**)(&user), *(void**)(&controllerProviderId))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ClearPairing(*(void**)(&user), *(void**)(&controllerProviderId))); } } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProviderStatics::IsPilot(winrt::Windows::System::User const& user, param::hstring const& controllerProviderId) const { void* copilotControllerProviderId{}; 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->IsPilot(*(void**)(&user), *(void**)(&controllerProviderId), &copilotControllerProviderId)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsPilot(*(void**)(&user), *(void**)(&controllerProviderId), &copilotControllerProviderId)); } return hstring{ copilotControllerProviderId, take_ownership_from_abi }; } template auto consume_Windows_Gaming_Input_Preview_ILegacyGipGameControllerProviderStatics::IsCopilot(winrt::Windows::System::User const& user, param::hstring const& controllerProviderId) const { void* pilotControllerProviderId{}; 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->IsCopilot(*(void**)(&user), *(void**)(&controllerProviderId), &pilotControllerProviderId)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsCopilot(*(void**)(&user), *(void**)(&controllerProviderId), &pilotControllerProviderId)); } return hstring{ pilotControllerProviderId, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetParentProviderId(void* provider, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetParentProviderId(*reinterpret_cast(&provider))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetProviderId(void* provider, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetProviderId(*reinterpret_cast(&provider))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_BatteryChargingState(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BatteryChargingState()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BatteryKind(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BatteryKind()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BatteryLevel(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BatteryLevel()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDeviceFirmwareCorruptionState(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetDeviceFirmwareCorruptionState()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsFirmwareCorrupted(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsFirmwareCorrupted()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsInterfaceSupported(winrt::guid interfaceId, bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsInterfaceSupported(*reinterpret_cast(&interfaceId))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsSyntheticDevice(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsSyntheticDevice()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_PreferredTypes(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().PreferredTypes()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ExecuteCommand(int32_t command) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ExecuteCommand(*reinterpret_cast(&command)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetHomeLedIntensity(uint8_t intensity) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetHomeLedIntensity(intensity); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetExtendedDeviceInfo(uint32_t* __bufferSize, uint8_t** buffer) noexcept final try { clear_abi(buffer); typename D::abi_guard guard(this->shim()); std::tie(*__bufferSize, *buffer) = detach_abi(this->shim().GetExtendedDeviceInfo()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetHeadsetOperation(int32_t operation, uint32_t __bufferSize, uint8_t* buffer) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetHeadsetOperation(*reinterpret_cast(&operation), array_view(reinterpret_cast(buffer), reinterpret_cast(buffer) + __bufferSize)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetHeadsetOperation(int32_t operation, uint32_t* __bufferSize, uint8_t** buffer) noexcept final try { clear_abi(buffer); typename D::abi_guard guard(this->shim()); std::tie(*__bufferSize, *buffer) = detach_abi(this->shim().GetHeadsetOperation(*reinterpret_cast(&operation))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AppCompatVersion(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AppCompatVersion()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetStandardControllerButtonRemapping(void* user, bool previous, void* remapping) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetStandardControllerButtonRemapping(*reinterpret_cast(&user), previous, *reinterpret_cast const*>(&remapping)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetStandardControllerButtonRemapping(void* user, bool previous, void** remapping) noexcept final try { clear_abi(remapping); typename D::abi_guard guard(this->shim()); *remapping = detach_from>(this->shim().GetStandardControllerButtonRemapping(*reinterpret_cast(&user), previous)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall FromGameController(void* controller, void** legacyGipGameControllerProvider) noexcept final try { clear_abi(legacyGipGameControllerProvider); typename D::abi_guard guard(this->shim()); *legacyGipGameControllerProvider = detach_from(this->shim().FromGameController(*reinterpret_cast(&controller))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromGameControllerProvider(void* provider, void** legacyGipGameControllerProvider) noexcept final try { clear_abi(legacyGipGameControllerProvider); typename D::abi_guard guard(this->shim()); *legacyGipGameControllerProvider = detach_from(this->shim().FromGameControllerProvider(*reinterpret_cast(&provider))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall PairPilotToCopilot(void* user, void* pilotControllerProviderId, void* copilotControllerProviderId) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().PairPilotToCopilot(*reinterpret_cast(&user), *reinterpret_cast(&pilotControllerProviderId), *reinterpret_cast(&copilotControllerProviderId)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ClearPairing(void* user, void* controllerProviderId) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ClearPairing(*reinterpret_cast(&user), *reinterpret_cast(&controllerProviderId)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsPilot(void* user, void* controllerProviderId, void** copilotControllerProviderId) noexcept final try { clear_abi(copilotControllerProviderId); typename D::abi_guard guard(this->shim()); *copilotControllerProviderId = detach_from(this->shim().IsPilot(*reinterpret_cast(&user), *reinterpret_cast(&controllerProviderId))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsCopilot(void* user, void* controllerProviderId, void** pilotControllerProviderId) noexcept final try { clear_abi(pilotControllerProviderId); typename D::abi_guard guard(this->shim()); *pilotControllerProviderId = detach_from(this->shim().IsCopilot(*reinterpret_cast(&user), *reinterpret_cast(&controllerProviderId))); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Gaming::Input::Preview { inline auto GameControllerProviderInfo::GetParentProviderId(winrt::Windows::Gaming::Input::Custom::IGameControllerProvider const& provider) { return impl::call_factory([&](IGameControllerProviderInfoStatics const& f) { return f.GetParentProviderId(provider); }); } inline auto GameControllerProviderInfo::GetProviderId(winrt::Windows::Gaming::Input::Custom::IGameControllerProvider const& provider) { return impl::call_factory([&](IGameControllerProviderInfoStatics const& f) { return f.GetProviderId(provider); }); } inline auto LegacyGipGameControllerProvider::FromGameController(winrt::Windows::Gaming::Input::IGameController const& controller) { return impl::call_factory([&](ILegacyGipGameControllerProviderStatics const& f) { return f.FromGameController(controller); }); } inline auto LegacyGipGameControllerProvider::FromGameControllerProvider(winrt::Windows::Gaming::Input::Custom::IGameControllerProvider const& provider) { return impl::call_factory([&](ILegacyGipGameControllerProviderStatics const& f) { return f.FromGameControllerProvider(provider); }); } inline auto LegacyGipGameControllerProvider::PairPilotToCopilot(winrt::Windows::System::User const& user, param::hstring const& pilotControllerProviderId, param::hstring const& copilotControllerProviderId) { impl::call_factory([&](ILegacyGipGameControllerProviderStatics const& f) { return f.PairPilotToCopilot(user, pilotControllerProviderId, copilotControllerProviderId); }); } inline auto LegacyGipGameControllerProvider::ClearPairing(winrt::Windows::System::User const& user, param::hstring const& controllerProviderId) { impl::call_factory([&](ILegacyGipGameControllerProviderStatics const& f) { return f.ClearPairing(user, controllerProviderId); }); } inline auto LegacyGipGameControllerProvider::IsPilot(winrt::Windows::System::User const& user, param::hstring const& controllerProviderId) { return impl::call_factory([&](ILegacyGipGameControllerProviderStatics const& f) { return f.IsPilot(user, controllerProviderId); }); } inline auto LegacyGipGameControllerProvider::IsCopilot(winrt::Windows::System::User const& user, param::hstring const& controllerProviderId) { return impl::call_factory([&](ILegacyGipGameControllerProviderStatics const& f) { return f.IsCopilot(user, controllerProviderId); }); } } 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 {}; #endif #ifdef __cpp_lib_format #endif } #endif