// 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_Custom_H #define WINRT_Windows_Gaming_Input_Custom_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.2.h" #include "winrt/impl/Windows.Gaming.Input.2.h" #include "winrt/impl/Windows.Storage.Streams.2.h" #include "winrt/impl/Windows.Gaming.Input.Custom.2.h" namespace winrt::impl { template auto consume_Windows_Gaming_Input_Custom_ICustomGameControllerFactory::CreateGameController(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->CreateGameController(*(void**)(&provider), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateGameController(*(void**)(&provider), &value)); } return winrt::Windows::Foundation::IInspectable{ value, take_ownership_from_abi }; } template auto consume_Windows_Gaming_Input_Custom_ICustomGameControllerFactory::OnGameControllerAdded(winrt::Windows::Gaming::Input::IGameController 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->OnGameControllerAdded(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OnGameControllerAdded(*(void**)(&value))); } } template auto consume_Windows_Gaming_Input_Custom_ICustomGameControllerFactory::OnGameControllerRemoved(winrt::Windows::Gaming::Input::IGameController 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->OnGameControllerRemoved(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OnGameControllerRemoved(*(void**)(&value))); } } template auto consume_Windows_Gaming_Input_Custom_IGameControllerFactoryManagerStatics::RegisterCustomFactoryForGipInterface(winrt::Windows::Gaming::Input::Custom::ICustomGameControllerFactory const& factory, winrt::guid const& interfaceId) 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->RegisterCustomFactoryForGipInterface(*(void**)(&factory), impl::bind_in(interfaceId))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RegisterCustomFactoryForGipInterface(*(void**)(&factory), impl::bind_in(interfaceId))); } } template auto consume_Windows_Gaming_Input_Custom_IGameControllerFactoryManagerStatics::RegisterCustomFactoryForHardwareId(winrt::Windows::Gaming::Input::Custom::ICustomGameControllerFactory const& factory, uint16_t hardwareVendorId, uint16_t hardwareProductId) 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->RegisterCustomFactoryForHardwareId(*(void**)(&factory), hardwareVendorId, hardwareProductId)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RegisterCustomFactoryForHardwareId(*(void**)(&factory), hardwareVendorId, hardwareProductId)); } } template auto consume_Windows_Gaming_Input_Custom_IGameControllerFactoryManagerStatics::RegisterCustomFactoryForXusbType(winrt::Windows::Gaming::Input::Custom::ICustomGameControllerFactory const& factory, winrt::Windows::Gaming::Input::Custom::XusbDeviceType const& xusbType, winrt::Windows::Gaming::Input::Custom::XusbDeviceSubtype const& xusbSubtype) 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->RegisterCustomFactoryForXusbType(*(void**)(&factory), static_cast(xusbType), static_cast(xusbSubtype))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RegisterCustomFactoryForXusbType(*(void**)(&factory), static_cast(xusbType), static_cast(xusbSubtype))); } } template auto consume_Windows_Gaming_Input_Custom_IGameControllerFactoryManagerStatics2::TryGetFactoryControllerFromGameController(winrt::Windows::Gaming::Input::Custom::ICustomGameControllerFactory const& factory, winrt::Windows::Gaming::Input::IGameController const& gameController) const { void* factoryController{}; 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->TryGetFactoryControllerFromGameController(*(void**)(&factory), *(void**)(&gameController), &factoryController)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->TryGetFactoryControllerFromGameController(*(void**)(&factory), *(void**)(&gameController), &factoryController)); } return winrt::Windows::Gaming::Input::IGameController{ factoryController, take_ownership_from_abi }; } template auto consume_Windows_Gaming_Input_Custom_IGameControllerInputSink::OnInputResumed(uint64_t timestamp) 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->OnInputResumed(timestamp)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OnInputResumed(timestamp)); } } template auto consume_Windows_Gaming_Input_Custom_IGameControllerInputSink::OnInputSuspended(uint64_t timestamp) 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->OnInputSuspended(timestamp)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OnInputSuspended(timestamp)); } } template auto consume_Windows_Gaming_Input_Custom_IGameControllerProvider::FirmwareVersionInfo() const { winrt::Windows::Gaming::Input::Custom::GameControllerVersionInfo 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_FirmwareVersionInfo(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_FirmwareVersionInfo(put_abi(value))); } return value; } template auto consume_Windows_Gaming_Input_Custom_IGameControllerProvider::HardwareProductId() const { uint16_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_HardwareProductId(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_HardwareProductId(&value)); } return value; } template auto consume_Windows_Gaming_Input_Custom_IGameControllerProvider::HardwareVendorId() const { uint16_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_HardwareVendorId(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_HardwareVendorId(&value)); } return value; } template auto consume_Windows_Gaming_Input_Custom_IGameControllerProvider::HardwareVersionInfo() const { winrt::Windows::Gaming::Input::Custom::GameControllerVersionInfo 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_HardwareVersionInfo(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_HardwareVersionInfo(put_abi(value))); } return value; } template auto consume_Windows_Gaming_Input_Custom_IGameControllerProvider::IsConnected() 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_IsConnected(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IsConnected(&value)); } return value; } template auto consume_Windows_Gaming_Input_Custom_IGipFirmwareUpdateResult::ExtendedErrorCode() 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_ExtendedErrorCode(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ExtendedErrorCode(&value)); } return value; } template auto consume_Windows_Gaming_Input_Custom_IGipFirmwareUpdateResult::FinalComponentId() 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_FinalComponentId(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_FinalComponentId(&value)); } return value; } template auto consume_Windows_Gaming_Input_Custom_IGipFirmwareUpdateResult::Status() const { winrt::Windows::Gaming::Input::Custom::GipFirmwareUpdateStatus 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_Status(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Status(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Gaming_Input_Custom_IGipGameControllerInputSink::OnKeyReceived(uint64_t timestamp, uint8_t keyCode, bool isPressed) 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->OnKeyReceived(timestamp, keyCode, isPressed)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OnKeyReceived(timestamp, keyCode, isPressed)); } } template auto consume_Windows_Gaming_Input_Custom_IGipGameControllerInputSink::OnMessageReceived(uint64_t timestamp, winrt::Windows::Gaming::Input::Custom::GipMessageClass const& messageClass, uint8_t messageId, uint8_t sequenceId, array_view messageBuffer) 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->OnMessageReceived(timestamp, static_cast(messageClass), messageId, sequenceId, messageBuffer.size(), get_abi(messageBuffer))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OnMessageReceived(timestamp, static_cast(messageClass), messageId, sequenceId, messageBuffer.size(), get_abi(messageBuffer))); } } template auto consume_Windows_Gaming_Input_Custom_IGipGameControllerProvider::SendMessage(winrt::Windows::Gaming::Input::Custom::GipMessageClass const& messageClass, uint8_t messageId, array_view messageBuffer) 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->SendMessage(static_cast(messageClass), messageId, messageBuffer.size(), get_abi(messageBuffer))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SendMessage(static_cast(messageClass), messageId, messageBuffer.size(), get_abi(messageBuffer))); } } template auto consume_Windows_Gaming_Input_Custom_IGipGameControllerProvider::SendReceiveMessage(winrt::Windows::Gaming::Input::Custom::GipMessageClass const& messageClass, uint8_t messageId, array_view requestMessageBuffer, array_view responseMessageBuffer) 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->SendReceiveMessage(static_cast(messageClass), messageId, requestMessageBuffer.size(), get_abi(requestMessageBuffer), responseMessageBuffer.size(), put_abi(responseMessageBuffer))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SendReceiveMessage(static_cast(messageClass), messageId, requestMessageBuffer.size(), get_abi(requestMessageBuffer), responseMessageBuffer.size(), put_abi(responseMessageBuffer))); } } template auto consume_Windows_Gaming_Input_Custom_IGipGameControllerProvider::UpdateFirmwareAsync(winrt::Windows::Storage::Streams::IInputStream const& firmwareImage) const { void* result{}; 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->UpdateFirmwareAsync(*(void**)(&firmwareImage), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->UpdateFirmwareAsync(*(void**)(&firmwareImage), &result)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress{ result, take_ownership_from_abi }; } template auto consume_Windows_Gaming_Input_Custom_IHidGameControllerInputSink::OnInputReportReceived(uint64_t timestamp, uint8_t reportId, array_view reportBuffer) 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->OnInputReportReceived(timestamp, reportId, reportBuffer.size(), get_abi(reportBuffer))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OnInputReportReceived(timestamp, reportId, reportBuffer.size(), get_abi(reportBuffer))); } } template auto consume_Windows_Gaming_Input_Custom_IHidGameControllerProvider::UsageId() const { uint16_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_UsageId(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UsageId(&value)); } return value; } template auto consume_Windows_Gaming_Input_Custom_IHidGameControllerProvider::UsagePage() const { uint16_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_UsagePage(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UsagePage(&value)); } return value; } template auto consume_Windows_Gaming_Input_Custom_IHidGameControllerProvider::GetFeatureReport(uint8_t reportId, array_view reportBuffer) 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->GetFeatureReport(reportId, reportBuffer.size(), put_abi(reportBuffer))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetFeatureReport(reportId, reportBuffer.size(), put_abi(reportBuffer))); } } template auto consume_Windows_Gaming_Input_Custom_IHidGameControllerProvider::SendFeatureReport(uint8_t reportId, array_view reportBuffer) 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->SendFeatureReport(reportId, reportBuffer.size(), get_abi(reportBuffer))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SendFeatureReport(reportId, reportBuffer.size(), get_abi(reportBuffer))); } } template auto consume_Windows_Gaming_Input_Custom_IHidGameControllerProvider::SendOutputReport(uint8_t reportId, array_view reportBuffer) 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->SendOutputReport(reportId, reportBuffer.size(), get_abi(reportBuffer))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SendOutputReport(reportId, reportBuffer.size(), get_abi(reportBuffer))); } } template auto consume_Windows_Gaming_Input_Custom_IXusbGameControllerInputSink::OnInputReceived(uint64_t timestamp, uint8_t reportId, array_view inputBuffer) 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->OnInputReceived(timestamp, reportId, inputBuffer.size(), get_abi(inputBuffer))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OnInputReceived(timestamp, reportId, inputBuffer.size(), get_abi(inputBuffer))); } } template auto consume_Windows_Gaming_Input_Custom_IXusbGameControllerProvider::SetVibration(double lowFrequencyMotorSpeed, double highFrequencyMotorSpeed) 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->SetVibration(lowFrequencyMotorSpeed, highFrequencyMotorSpeed)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SetVibration(lowFrequencyMotorSpeed, highFrequencyMotorSpeed)); } } template struct produce : produce_base { int32_t __stdcall CreateGameController(void* provider, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CreateGameController(*reinterpret_cast(&provider))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall OnGameControllerAdded(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().OnGameControllerAdded(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall OnGameControllerRemoved(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().OnGameControllerRemoved(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall RegisterCustomFactoryForGipInterface(void* factory, winrt::guid interfaceId) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RegisterCustomFactoryForGipInterface(*reinterpret_cast(&factory), *reinterpret_cast(&interfaceId)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RegisterCustomFactoryForHardwareId(void* factory, uint16_t hardwareVendorId, uint16_t hardwareProductId) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RegisterCustomFactoryForHardwareId(*reinterpret_cast(&factory), hardwareVendorId, hardwareProductId); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RegisterCustomFactoryForXusbType(void* factory, int32_t xusbType, int32_t xusbSubtype) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RegisterCustomFactoryForXusbType(*reinterpret_cast(&factory), *reinterpret_cast(&xusbType), *reinterpret_cast(&xusbSubtype)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall TryGetFactoryControllerFromGameController(void* factory, void* gameController, void** factoryController) noexcept final try { clear_abi(factoryController); typename D::abi_guard guard(this->shim()); *factoryController = detach_from(this->shim().TryGetFactoryControllerFromGameController(*reinterpret_cast(&factory), *reinterpret_cast(&gameController))); return 0; } catch (...) { return to_hresult(); } }; #endif template struct produce : produce_base { int32_t __stdcall OnInputResumed(uint64_t timestamp) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().OnInputResumed(timestamp); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall OnInputSuspended(uint64_t timestamp) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().OnInputSuspended(timestamp); return 0; } catch (...) { return to_hresult(); } }; template struct produce : produce_base { int32_t __stdcall get_FirmwareVersionInfo(struct struct_Windows_Gaming_Input_Custom_GameControllerVersionInfo* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().FirmwareVersionInfo()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_HardwareProductId(uint16_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().HardwareProductId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_HardwareVendorId(uint16_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().HardwareVendorId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_HardwareVersionInfo(struct struct_Windows_Gaming_Input_Custom_GameControllerVersionInfo* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().HardwareVersionInfo()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsConnected(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsConnected()); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_ExtendedErrorCode(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ExtendedErrorCode()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_FinalComponentId(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().FinalComponentId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Status(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Status()); return 0; } catch (...) { return to_hresult(); } }; #endif template struct produce : produce_base { int32_t __stdcall OnKeyReceived(uint64_t timestamp, uint8_t keyCode, bool isPressed) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().OnKeyReceived(timestamp, keyCode, isPressed); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall OnMessageReceived(uint64_t timestamp, int32_t messageClass, uint8_t messageId, uint8_t sequenceId, uint32_t __messageBufferSize, uint8_t* messageBuffer) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().OnMessageReceived(timestamp, *reinterpret_cast(&messageClass), messageId, sequenceId, array_view(reinterpret_cast(messageBuffer), reinterpret_cast(messageBuffer) + __messageBufferSize)); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall SendMessage(int32_t messageClass, uint8_t messageId, uint32_t __messageBufferSize, uint8_t* messageBuffer) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SendMessage(*reinterpret_cast(&messageClass), messageId, array_view(reinterpret_cast(messageBuffer), reinterpret_cast(messageBuffer) + __messageBufferSize)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SendReceiveMessage(int32_t messageClass, uint8_t messageId, uint32_t __requestMessageBufferSize, uint8_t* requestMessageBuffer, uint32_t __responseMessageBufferSize, uint8_t* responseMessageBuffer) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SendReceiveMessage(*reinterpret_cast(&messageClass), messageId, array_view(reinterpret_cast(requestMessageBuffer), reinterpret_cast(requestMessageBuffer) + __requestMessageBufferSize), array_view(reinterpret_cast(responseMessageBuffer), reinterpret_cast(responseMessageBuffer) + __responseMessageBufferSize)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall UpdateFirmwareAsync(void* firmwareImage, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from>(this->shim().UpdateFirmwareAsync(*reinterpret_cast(&firmwareImage))); return 0; } catch (...) { return to_hresult(); } }; #endif template struct produce : produce_base { int32_t __stdcall OnInputReportReceived(uint64_t timestamp, uint8_t reportId, uint32_t __reportBufferSize, uint8_t* reportBuffer) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().OnInputReportReceived(timestamp, reportId, array_view(reinterpret_cast(reportBuffer), reinterpret_cast(reportBuffer) + __reportBufferSize)); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_UsageId(uint16_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UsageId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_UsagePage(uint16_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UsagePage()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetFeatureReport(uint8_t reportId, uint32_t __reportBufferSize, uint8_t* reportBuffer) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().GetFeatureReport(reportId, array_view(reinterpret_cast(reportBuffer), reinterpret_cast(reportBuffer) + __reportBufferSize)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SendFeatureReport(uint8_t reportId, uint32_t __reportBufferSize, uint8_t* reportBuffer) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SendFeatureReport(reportId, array_view(reinterpret_cast(reportBuffer), reinterpret_cast(reportBuffer) + __reportBufferSize)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SendOutputReport(uint8_t reportId, uint32_t __reportBufferSize, uint8_t* reportBuffer) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SendOutputReport(reportId, array_view(reinterpret_cast(reportBuffer), reinterpret_cast(reportBuffer) + __reportBufferSize)); return 0; } catch (...) { return to_hresult(); } }; #endif template struct produce : produce_base { int32_t __stdcall OnInputReceived(uint64_t timestamp, uint8_t reportId, uint32_t __inputBufferSize, uint8_t* inputBuffer) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().OnInputReceived(timestamp, reportId, array_view(reinterpret_cast(inputBuffer), reinterpret_cast(inputBuffer) + __inputBufferSize)); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall SetVibration(double lowFrequencyMotorSpeed, double highFrequencyMotorSpeed) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetVibration(lowFrequencyMotorSpeed, highFrequencyMotorSpeed); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Gaming::Input::Custom { inline auto GameControllerFactoryManager::RegisterCustomFactoryForGipInterface(winrt::Windows::Gaming::Input::Custom::ICustomGameControllerFactory const& factory, winrt::guid const& interfaceId) { impl::call_factory([&](IGameControllerFactoryManagerStatics const& f) { return f.RegisterCustomFactoryForGipInterface(factory, interfaceId); }); } inline auto GameControllerFactoryManager::RegisterCustomFactoryForHardwareId(winrt::Windows::Gaming::Input::Custom::ICustomGameControllerFactory const& factory, uint16_t hardwareVendorId, uint16_t hardwareProductId) { impl::call_factory([&](IGameControllerFactoryManagerStatics const& f) { return f.RegisterCustomFactoryForHardwareId(factory, hardwareVendorId, hardwareProductId); }); } inline auto GameControllerFactoryManager::RegisterCustomFactoryForXusbType(winrt::Windows::Gaming::Input::Custom::ICustomGameControllerFactory const& factory, winrt::Windows::Gaming::Input::Custom::XusbDeviceType const& xusbType, winrt::Windows::Gaming::Input::Custom::XusbDeviceSubtype const& xusbSubtype) { impl::call_factory([&](IGameControllerFactoryManagerStatics const& f) { return f.RegisterCustomFactoryForXusbType(factory, xusbType, xusbSubtype); }); } inline auto GameControllerFactoryManager::TryGetFactoryControllerFromGameController(winrt::Windows::Gaming::Input::Custom::ICustomGameControllerFactory const& factory, winrt::Windows::Gaming::Input::IGameController const& gameController) { return impl::call_factory([&](IGameControllerFactoryManagerStatics2 const& f) { return f.TryGetFactoryControllerFromGameController(factory, gameController); }); } } 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 {}; #endif #ifdef __cpp_lib_format #endif } #endif