// C++/WinRT v2.0.250303.1

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#pragma once
#ifndef WINRT_Windows_UI_Shell_CompanionWindows_H
#define WINRT_Windows_UI_Shell_CompanionWindows_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.UI.Shell.h"
#include "winrt/impl/Windows.Foundation.2.h"
#include "winrt/impl/Windows.UI.2.h"
#include "winrt/impl/Windows.UI.Shell.CompanionWindows.2.h"
namespace winrt::impl
{
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowCoordinator<D>::RequestWindowFromAppAsync(param::hstring const& appId) const
    {
        void* operation{};
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>**)&_winrt_casted_result;
            check_hresult(_winrt_abi_type->RequestWindowFromAppAsync(*(void**)(&appId), &operation));
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>**)this;
            check_hresult(_winrt_abi_type->RequestWindowFromAppAsync(*(void**)(&appId), &operation));
        }
        return winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowRequestResult>{ operation, take_ownership_from_abi };
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowCoordinator<D>::DetachCompanionWindow() const
    {
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>**)&_winrt_casted_result;
            check_hresult(_winrt_abi_type->DetachCompanionWindow());
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>**)this;
            check_hresult(_winrt_abi_type->DetachCompanionWindow());
        }
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowCoordinator<D>::CompanionWindowId() const
    {
        winrt::Windows::UI::WindowId value{};
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>**)&_winrt_casted_result;
            check_hresult(_winrt_abi_type->get_CompanionWindowId(put_abi(value)));
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>**)this;
            check_hresult(_winrt_abi_type->get_CompanionWindowId(put_abi(value)));
        }
        return value;
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowCoordinator<D>::Changed(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowCoordinator, winrt::Windows::Foundation::IInspectable> const& handler) const
    {
        winrt::event_token token{};
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>**)&_winrt_casted_result;
            check_hresult(_winrt_abi_type->add_Changed(*(void**)(&handler), put_abi(token)));
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>**)this;
            check_hresult(_winrt_abi_type->add_Changed(*(void**)(&handler), put_abi(token)));
        }
        return token;
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowCoordinator<D>::Changed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowCoordinator, winrt::Windows::Foundation::IInspectable> const& handler) const
    {
        return impl::make_event_revoker<D, Changed_revoker>(this, Changed(handler));
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowCoordinator<D>::Changed(winrt::event_token const& token) const noexcept
    {
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>**)&_winrt_casted_result;
            _winrt_abi_type->remove_Changed(impl::bind_in(token));
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>**)this;
            _winrt_abi_type->remove_Changed(impl::bind_in(token));
        }
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowCoordinatorStatics<D>::GetForWindow(winrt::Windows::UI::WindowId const& windowId) const
    {
        void* result{};
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinatorStatics>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinatorStatics, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinatorStatics>**)&_winrt_casted_result;
            check_hresult(_winrt_abi_type->GetForWindow(impl::bind_in(windowId), &result));
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinatorStatics>**)this;
            check_hresult(_winrt_abi_type->GetForWindow(impl::bind_in(windowId), &result));
        }
        return winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowCoordinator{ result, take_ownership_from_abi };
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowRequest<D>::Accept(winrt::Windows::UI::WindowId const& windowId) const
    {
        void* result{};
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest>**)&_winrt_casted_result;
            check_hresult(_winrt_abi_type->Accept(impl::bind_in(windowId), &result));
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest>**)this;
            check_hresult(_winrt_abi_type->Accept(impl::bind_in(windowId), &result));
        }
        return winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowCoordinator{ result, take_ownership_from_abi };
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowRequest<D>::Reject() const
    {
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest>**)&_winrt_casted_result;
            check_hresult(_winrt_abi_type->Reject());
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest>**)this;
            check_hresult(_winrt_abi_type->Reject());
        }
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowRequest<D>::GetDeferral() const
    {
        void* result{};
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest>**)&_winrt_casted_result;
            check_hresult(_winrt_abi_type->GetDeferral(&result));
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest>**)this;
            check_hresult(_winrt_abi_type->GetDeferral(&result));
        }
        return winrt::Windows::Foundation::Deferral{ result, take_ownership_from_abi };
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowRequest<D>::RequestingWindowId() const
    {
        winrt::Windows::UI::WindowId value{};
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest>**)&_winrt_casted_result;
            check_hresult(_winrt_abi_type->get_RequestingWindowId(put_abi(value)));
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest>**)this;
            check_hresult(_winrt_abi_type->get_RequestingWindowId(put_abi(value)));
        }
        return value;
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowRequestResult<D>::Succeeded() const
    {
        bool value{};
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult>**)&_winrt_casted_result;
            check_hresult(_winrt_abi_type->get_Succeeded(&value));
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult>**)this;
            check_hresult(_winrt_abi_type->get_Succeeded(&value));
        }
        return value;
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowRequestResult<D>::Status() const
    {
        winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowRequestResultStatus value{};
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult>**)&_winrt_casted_result;
            check_hresult(_winrt_abi_type->get_Status(reinterpret_cast<int32_t*>(&value)));
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult>**)this;
            check_hresult(_winrt_abi_type->get_Status(reinterpret_cast<int32_t*>(&value)));
        }
        return value;
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowRequestResult<D>::ExtendedError() const
    {
        winrt::hresult value{};
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult>**)&_winrt_casted_result;
            check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value)));
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult>**)this;
            check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value)));
        }
        return value;
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowRequestResult<D>::CompanionWindowId() const
    {
        winrt::Windows::UI::WindowId value{};
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult>**)&_winrt_casted_result;
            check_hresult(_winrt_abi_type->get_CompanionWindowId(put_abi(value)));
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult>**)this;
            check_hresult(_winrt_abi_type->get_CompanionWindowId(put_abi(value)));
        }
        return value;
    }
    template <typename D> auto consume_Windows_UI_Shell_CompanionWindows_ICompanionWindowRequestStatics<D>::GetFromLaunchUri(winrt::Windows::Foundation::Uri const& launchUri) const
    {
        void* result{};
        if constexpr (!std::is_same_v<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestStatics>)
        {
            winrt::hresult _winrt_cast_result_code;
            auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestStatics, D const*>(static_cast<D const*>(this), _winrt_cast_result_code);
            check_hresult(_winrt_cast_result_code);
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestStatics>**)&_winrt_casted_result;
            check_hresult(_winrt_abi_type->GetFromLaunchUri(*(void**)(&launchUri), &result));
        }
        else
        {
            auto const _winrt_abi_type = *(abi_t<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestStatics>**)this;
            check_hresult(_winrt_abi_type->GetFromLaunchUri(*(void**)(&launchUri), &result));
        }
        return winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowRequest{ result, take_ownership_from_abi };
    }
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator> : produce_base<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator>
    {
        int32_t __stdcall RequestWindowFromAppAsync(void* appId, void** operation) noexcept final try
        {
            clear_abi(operation);
            typename D::abi_guard guard(this->shim());
            *operation = detach_from<winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowRequestResult>>(this->shim().RequestWindowFromAppAsync(*reinterpret_cast<hstring const*>(&appId)));
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall DetachCompanionWindow() noexcept final try
        {
            typename D::abi_guard guard(this->shim());
            this->shim().DetachCompanionWindow();
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall get_CompanionWindowId(struct struct_Windows_UI_WindowId* value) noexcept final try
        {
            zero_abi<winrt::Windows::UI::WindowId>(value);
            typename D::abi_guard guard(this->shim());
            *value = detach_from<winrt::Windows::UI::WindowId>(this->shim().CompanionWindowId());
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall add_Changed(void* handler, winrt::event_token* token) noexcept final try
        {
            zero_abi<winrt::event_token>(token);
            typename D::abi_guard guard(this->shim());
            *token = detach_from<winrt::event_token>(this->shim().Changed(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowCoordinator, winrt::Windows::Foundation::IInspectable> const*>(&handler)));
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall remove_Changed(winrt::event_token token) noexcept final
        {
            typename D::abi_guard guard(this->shim());
            this->shim().Changed(*reinterpret_cast<winrt::event_token const*>(&token));
            return 0;
        }
    };
#endif
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinatorStatics> : produce_base<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinatorStatics>
    {
        int32_t __stdcall GetForWindow(struct struct_Windows_UI_WindowId windowId, void** result) noexcept final try
        {
            clear_abi(result);
            typename D::abi_guard guard(this->shim());
            *result = detach_from<winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowCoordinator>(this->shim().GetForWindow(*reinterpret_cast<winrt::Windows::UI::WindowId const*>(&windowId)));
            return 0;
        }
        catch (...) { return to_hresult(); }
    };
#endif
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest> : produce_base<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest>
    {
        int32_t __stdcall Accept(struct struct_Windows_UI_WindowId windowId, void** result) noexcept final try
        {
            clear_abi(result);
            typename D::abi_guard guard(this->shim());
            *result = detach_from<winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowCoordinator>(this->shim().Accept(*reinterpret_cast<winrt::Windows::UI::WindowId const*>(&windowId)));
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall Reject() noexcept final try
        {
            typename D::abi_guard guard(this->shim());
            this->shim().Reject();
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall GetDeferral(void** result) noexcept final try
        {
            clear_abi(result);
            typename D::abi_guard guard(this->shim());
            *result = detach_from<winrt::Windows::Foundation::Deferral>(this->shim().GetDeferral());
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall get_RequestingWindowId(struct struct_Windows_UI_WindowId* value) noexcept final try
        {
            zero_abi<winrt::Windows::UI::WindowId>(value);
            typename D::abi_guard guard(this->shim());
            *value = detach_from<winrt::Windows::UI::WindowId>(this->shim().RequestingWindowId());
            return 0;
        }
        catch (...) { return to_hresult(); }
    };
#endif
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult> : produce_base<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult>
    {
        int32_t __stdcall get_Succeeded(bool* value) noexcept final try
        {
            typename D::abi_guard guard(this->shim());
            *value = detach_from<bool>(this->shim().Succeeded());
            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<winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowRequestResultStatus>(this->shim().Status());
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall get_ExtendedError(winrt::hresult* value) noexcept final try
        {
            zero_abi<winrt::hresult>(value);
            typename D::abi_guard guard(this->shim());
            *value = detach_from<winrt::hresult>(this->shim().ExtendedError());
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall get_CompanionWindowId(struct struct_Windows_UI_WindowId* value) noexcept final try
        {
            zero_abi<winrt::Windows::UI::WindowId>(value);
            typename D::abi_guard guard(this->shim());
            *value = detach_from<winrt::Windows::UI::WindowId>(this->shim().CompanionWindowId());
            return 0;
        }
        catch (...) { return to_hresult(); }
    };
#endif
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestStatics> : produce_base<D, winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestStatics>
    {
        int32_t __stdcall GetFromLaunchUri(void* launchUri, void** result) noexcept final try
        {
            clear_abi(result);
            typename D::abi_guard guard(this->shim());
            *result = detach_from<winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowRequest>(this->shim().GetFromLaunchUri(*reinterpret_cast<winrt::Windows::Foundation::Uri const*>(&launchUri)));
            return 0;
        }
        catch (...) { return to_hresult(); }
    };
#endif
}
WINRT_EXPORT namespace winrt::Windows::UI::Shell::CompanionWindows
{
    inline auto CompanionWindowCoordinator::GetForWindow(winrt::Windows::UI::WindowId const& windowId)
    {
        return impl::call_factory<CompanionWindowCoordinator, ICompanionWindowCoordinatorStatics>([&](ICompanionWindowCoordinatorStatics const& f) { return f.GetForWindow(windowId); });
    }
    inline auto CompanionWindowRequest::GetFromLaunchUri(winrt::Windows::Foundation::Uri const& launchUri)
    {
        return impl::call_factory<CompanionWindowRequest, ICompanionWindowRequestStatics>([&](ICompanionWindowRequestStatics const& f) { return f.GetFromLaunchUri(launchUri); });
    }
}
namespace std
{
#ifndef WINRT_LEAN_AND_MEAN
    template<> struct hash<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinator> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowCoordinatorStatics> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequest> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestResult> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::UI::Shell::CompanionWindows::ICompanionWindowRequestStatics> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowCoordinator> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowRequest> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::UI::Shell::CompanionWindows::CompanionWindowRequestResult> : winrt::impl::hash_base {};
#endif
#ifdef __cpp_lib_format
#endif
}
#endif
