Files
nearby/internal/platform/implementation/windows/generated/winrt/Microsoft.Windows.Private.Workloads.SessionManager.h
T
2026-01-27 23:46:02 -08:00

255 lines
12 KiB
C++

// 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 <typename D>
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<D,
winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManager>) {
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result =
impl::try_as_with_reason<winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManager,
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::Microsoft::Windows::Private::Workloads::SessionManager::
ISessionManager>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->GetOrCreateSessionAsync(
*(void**)(&packageName), *(void**)(&typeName), priority, &operation));
} else {
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::Private::Workloads::SessionManager::
ISessionManager>**)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 <typename D>
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<D,
winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManager2>) {
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result =
impl::try_as_with_reason<winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManager2,
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::Microsoft::Windows::Private::Workloads::SessionManager::
ISessionManager2>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->ReportSessionFailure(
*(void**)(&session), hrFailure, *(void**)(&failureMessage), &result));
} else {
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::Private::Workloads::SessionManager::
ISessionManager2>**)this;
check_hresult(_winrt_abi_type->ReportSessionFailure(
*(void**)(&session), hrFailure, *(void**)(&failureMessage), &result));
}
return result;
}
template <typename D>
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<D,
winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManager3>) {
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result =
impl::try_as_with_reason<winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManager3,
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::Microsoft::Windows::Private::Workloads::SessionManager::
ISessionManager3>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->GetOrCreateUninitializedSessionAsync(
*(void**)(&packageName), *(void**)(&typeName), priority, &operation));
} else {
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::Private::Workloads::SessionManager::
ISessionManager3>**)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 <typename D>
auto consume_Microsoft_Windows_Private_Workloads_SessionManager_ISessionManagerStatics<
D>::GetOrCreateAsync() const {
void* operation{};
if constexpr (!std::is_same_v<D,
winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManagerStatics>) {
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result =
impl::try_as_with_reason<winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManagerStatics,
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::Microsoft::Windows::Private::Workloads::SessionManager::
ISessionManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->GetOrCreateAsync(&operation));
} else {
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::Private::Workloads::SessionManager::
ISessionManagerStatics>**)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 <typename D>
struct produce<D, winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManager>
: produce_base<D, winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManager> {
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<winrt::Windows::Foundation::IAsyncOperation<
winrt::Windows::Foundation::IInspectable>>(
this->shim().GetOrCreateSessionAsync(
*reinterpret_cast<hstring const*>(&packageName),
*reinterpret_cast<hstring const*>(&typeName), priority));
return 0;
} catch (...) {
return to_hresult();
}
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManager2>
: produce_base<D, winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManager2> {
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<bool>(this->shim().ReportSessionFailure(
*reinterpret_cast<winrt::Windows::Foundation::IInspectable const*>(
&session),
hrFailure, *reinterpret_cast<hstring const*>(&failureMessage)));
return 0;
} catch (...) {
return to_hresult();
}
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManager3>
: produce_base<D, winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManager3> {
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<winrt::Windows::Foundation::IAsyncOperation<
winrt::Windows::Foundation::IInspectable>>(
this->shim().GetOrCreateUninitializedSessionAsync(
*reinterpret_cast<hstring const*>(&packageName),
*reinterpret_cast<hstring const*>(&typeName), priority));
return 0;
} catch (...) {
return to_hresult();
}
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
struct produce<D, winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManagerStatics>
: produce_base<D, winrt::Microsoft::Windows::Private::Workloads::
SessionManager::ISessionManagerStatics> {
int32_t __stdcall GetOrCreateAsync(void** operation) noexcept final try {
clear_abi(operation);
typename D::abi_guard guard(this->shim());
*operation = detach_from<winrt::Windows::Foundation::IAsyncOperation<
winrt::Microsoft::Windows::Private::Workloads::SessionManager::
SessionManager>>(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::Microsoft::Windows::Private::Workloads::SessionManager::
ISessionManager> : winrt::impl::hash_base {};
template <>
struct hash<winrt::Microsoft::Windows::Private::Workloads::SessionManager::
ISessionManager2> : winrt::impl::hash_base {};
template <>
struct hash<winrt::Microsoft::Windows::Private::Workloads::SessionManager::
ISessionManager3> : winrt::impl::hash_base {};
template <>
struct hash<winrt::Microsoft::Windows::Private::Workloads::SessionManager::
ISessionManagerStatics> : winrt::impl::hash_base {};
template <>
struct hash<winrt::Microsoft::Windows::Private::Workloads::SessionManager::
SessionManager> : winrt::impl::hash_base {};
#endif
#ifdef __cpp_lib_format
#endif
} // namespace std
#endif