// WARNING: Please don't edit this file. It was generated by C++/WinRT // v2.0.250303.1 #pragma once #ifndef WINRT_Microsoft_Windows_Private_Workloads_SessionManager_H #define WINRT_Microsoft_Windows_Private_Workloads_SessionManager_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/impl/Microsoft.Windows.Private.Workloads.SessionManager.2.h" #include "winrt/impl/Microsoft.Windows.PrivateCommon.2.h" #include "winrt/impl/Windows.Foundation.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_Private_Workloads_SessionManager_ISessionManager< D>::GetOrCreateSessionAsync(param::hstring const& packageName, param::hstring const& typeName, uint32_t priority) 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->GetOrCreateSessionAsync( *(void**)(&packageName), *(void**)(&typeName), priority, &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetOrCreateSessionAsync( *(void**)(&packageName), *(void**)(&typeName), priority, &operation)); } return winrt::Windows::Foundation::IAsyncOperation< winrt::Windows::Foundation::IInspectable>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_Private_Workloads_SessionManager_ISessionManager2< D>::ReportSessionFailure(winrt::Windows::Foundation::IInspectable const& session, int32_t hrFailure, param::hstring const& failureMessage) const { bool 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->ReportSessionFailure( *(void**)(&session), hrFailure, *(void**)(&failureMessage), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReportSessionFailure( *(void**)(&session), hrFailure, *(void**)(&failureMessage), &result)); } return result; } template auto consume_Microsoft_Windows_Private_Workloads_SessionManager_ISessionManager3< D>::GetOrCreateUninitializedSessionAsync(param::hstring const& packageName, param::hstring const& typeName, uint32_t priority) 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->GetOrCreateUninitializedSessionAsync( *(void**)(&packageName), *(void**)(&typeName), priority, &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetOrCreateUninitializedSessionAsync( *(void**)(&packageName), *(void**)(&typeName), priority, &operation)); } return winrt::Windows::Foundation::IAsyncOperation< winrt::Windows::Foundation::IInspectable>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_Private_Workloads_SessionManager_ISessionManagerStatics< D>::GetOrCreateAsync() 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->GetOrCreateAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetOrCreateAsync(&operation)); } return winrt::Windows::Foundation::IAsyncOperation< winrt::Microsoft::Windows::Private::Workloads::SessionManager:: SessionManager>{operation, take_ownership_from_abi}; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetOrCreateSessionAsync(void* packageName, void* typeName, uint32_t priority, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().GetOrCreateSessionAsync( *reinterpret_cast(&packageName), *reinterpret_cast(&typeName), priority)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall ReportSessionFailure(void* session, int32_t hrFailure, void* failureMessage, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().ReportSessionFailure( *reinterpret_cast( &session), hrFailure, *reinterpret_cast(&failureMessage))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetOrCreateUninitializedSessionAsync( void* packageName, void* typeName, uint32_t priority, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().GetOrCreateUninitializedSessionAsync( *reinterpret_cast(&packageName), *reinterpret_cast(&typeName), priority)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetOrCreateAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().GetOrCreateAsync()); return 0; } catch (...) { return to_hresult(); } }; #endif } // namespace winrt::impl WINRT_EXPORT namespace winrt::Microsoft::Windows::Private::Workloads:: SessionManager { inline auto SessionManager::GetOrCreateAsync() { return impl::call_factory_cast< winrt::Windows::Foundation::IAsyncOperation< winrt::Microsoft::Windows::Private::Workloads::SessionManager:: SessionManager> (*)(ISessionManagerStatics const&), SessionManager, ISessionManagerStatics>( [](ISessionManagerStatics const& f) { return f.GetOrCreateAsync(); }); } } 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 } // namespace std #endif