mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 15:16:12 -04:00
180 lines
12 KiB
C++
180 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_Windows_Security_Cryptography_DataProtection_H
|
|
#define WINRT_Windows_Security_Cryptography_DataProtection_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.Security.Cryptography.h"
|
|
#include "winrt/impl/Windows.Foundation.2.h"
|
|
#include "winrt/impl/Windows.Storage.Streams.2.h"
|
|
#include "winrt/impl/Windows.Security.Cryptography.DataProtection.2.h"
|
|
namespace winrt::impl
|
|
{
|
|
template <typename D> auto consume_Windows_Security_Cryptography_DataProtection_IDataProtectionProvider<D>::ProtectAsync(winrt::Windows::Storage::Streams::IBuffer const& data) const
|
|
{
|
|
void* value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider>)
|
|
{
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider, 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::Security::Cryptography::DataProtection::IDataProtectionProvider>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->ProtectAsync(*(void**)(&data), &value));
|
|
}
|
|
else
|
|
{
|
|
auto const _winrt_abi_type = *(abi_t<winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider>**)this;
|
|
check_hresult(_winrt_abi_type->ProtectAsync(*(void**)(&data), &value));
|
|
}
|
|
return winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::IBuffer>{ value, take_ownership_from_abi };
|
|
}
|
|
template <typename D> auto consume_Windows_Security_Cryptography_DataProtection_IDataProtectionProvider<D>::UnprotectAsync(winrt::Windows::Storage::Streams::IBuffer const& data) const
|
|
{
|
|
void* value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider>)
|
|
{
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider, 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::Security::Cryptography::DataProtection::IDataProtectionProvider>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->UnprotectAsync(*(void**)(&data), &value));
|
|
}
|
|
else
|
|
{
|
|
auto const _winrt_abi_type = *(abi_t<winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider>**)this;
|
|
check_hresult(_winrt_abi_type->UnprotectAsync(*(void**)(&data), &value));
|
|
}
|
|
return winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::IBuffer>{ value, take_ownership_from_abi };
|
|
}
|
|
template <typename D> auto consume_Windows_Security_Cryptography_DataProtection_IDataProtectionProvider<D>::ProtectStreamAsync(winrt::Windows::Storage::Streams::IInputStream const& src, winrt::Windows::Storage::Streams::IOutputStream const& dest) const
|
|
{
|
|
void* value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider>)
|
|
{
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider, 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::Security::Cryptography::DataProtection::IDataProtectionProvider>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->ProtectStreamAsync(*(void**)(&src), *(void**)(&dest), &value));
|
|
}
|
|
else
|
|
{
|
|
auto const _winrt_abi_type = *(abi_t<winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider>**)this;
|
|
check_hresult(_winrt_abi_type->ProtectStreamAsync(*(void**)(&src), *(void**)(&dest), &value));
|
|
}
|
|
return winrt::Windows::Foundation::IAsyncAction{ value, take_ownership_from_abi };
|
|
}
|
|
template <typename D> auto consume_Windows_Security_Cryptography_DataProtection_IDataProtectionProvider<D>::UnprotectStreamAsync(winrt::Windows::Storage::Streams::IInputStream const& src, winrt::Windows::Storage::Streams::IOutputStream const& dest) const
|
|
{
|
|
void* value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider>)
|
|
{
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider, 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::Security::Cryptography::DataProtection::IDataProtectionProvider>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->UnprotectStreamAsync(*(void**)(&src), *(void**)(&dest), &value));
|
|
}
|
|
else
|
|
{
|
|
auto const _winrt_abi_type = *(abi_t<winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider>**)this;
|
|
check_hresult(_winrt_abi_type->UnprotectStreamAsync(*(void**)(&src), *(void**)(&dest), &value));
|
|
}
|
|
return winrt::Windows::Foundation::IAsyncAction{ value, take_ownership_from_abi };
|
|
}
|
|
template <typename D> auto consume_Windows_Security_Cryptography_DataProtection_IDataProtectionProviderFactory<D>::CreateOverloadExplicit(param::hstring const& protectionDescriptor) const
|
|
{
|
|
void* value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProviderFactory>)
|
|
{
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProviderFactory, 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::Security::Cryptography::DataProtection::IDataProtectionProviderFactory>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->CreateOverloadExplicit(*(void**)(&protectionDescriptor), &value));
|
|
}
|
|
else
|
|
{
|
|
auto const _winrt_abi_type = *(abi_t<winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProviderFactory>**)this;
|
|
check_hresult(_winrt_abi_type->CreateOverloadExplicit(*(void**)(&protectionDescriptor), &value));
|
|
}
|
|
return winrt::Windows::Security::Cryptography::DataProtection::DataProtectionProvider{ value, take_ownership_from_abi };
|
|
}
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <typename D>
|
|
struct produce<D, winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider> : produce_base<D, winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider>
|
|
{
|
|
int32_t __stdcall ProtectAsync(void* data, void** value) noexcept final try
|
|
{
|
|
clear_abi(value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::IBuffer>>(this->shim().ProtectAsync(*reinterpret_cast<winrt::Windows::Storage::Streams::IBuffer const*>(&data)));
|
|
return 0;
|
|
}
|
|
catch (...) { return to_hresult(); }
|
|
int32_t __stdcall UnprotectAsync(void* data, void** value) noexcept final try
|
|
{
|
|
clear_abi(value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::IBuffer>>(this->shim().UnprotectAsync(*reinterpret_cast<winrt::Windows::Storage::Streams::IBuffer const*>(&data)));
|
|
return 0;
|
|
}
|
|
catch (...) { return to_hresult(); }
|
|
int32_t __stdcall ProtectStreamAsync(void* src, void* dest, void** value) noexcept final try
|
|
{
|
|
clear_abi(value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<winrt::Windows::Foundation::IAsyncAction>(this->shim().ProtectStreamAsync(*reinterpret_cast<winrt::Windows::Storage::Streams::IInputStream const*>(&src), *reinterpret_cast<winrt::Windows::Storage::Streams::IOutputStream const*>(&dest)));
|
|
return 0;
|
|
}
|
|
catch (...) { return to_hresult(); }
|
|
int32_t __stdcall UnprotectStreamAsync(void* src, void* dest, void** value) noexcept final try
|
|
{
|
|
clear_abi(value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<winrt::Windows::Foundation::IAsyncAction>(this->shim().UnprotectStreamAsync(*reinterpret_cast<winrt::Windows::Storage::Streams::IInputStream const*>(&src), *reinterpret_cast<winrt::Windows::Storage::Streams::IOutputStream const*>(&dest)));
|
|
return 0;
|
|
}
|
|
catch (...) { return to_hresult(); }
|
|
};
|
|
#endif
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <typename D>
|
|
struct produce<D, winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProviderFactory> : produce_base<D, winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProviderFactory>
|
|
{
|
|
int32_t __stdcall CreateOverloadExplicit(void* protectionDescriptor, void** value) noexcept final try
|
|
{
|
|
clear_abi(value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<winrt::Windows::Security::Cryptography::DataProtection::DataProtectionProvider>(this->shim().CreateOverloadExplicit(*reinterpret_cast<hstring const*>(&protectionDescriptor)));
|
|
return 0;
|
|
}
|
|
catch (...) { return to_hresult(); }
|
|
};
|
|
#endif
|
|
}
|
|
WINRT_EXPORT namespace winrt::Windows::Security::Cryptography::DataProtection
|
|
{
|
|
inline DataProtectionProvider::DataProtectionProvider() :
|
|
DataProtectionProvider(impl::call_factory_cast<DataProtectionProvider(*)(winrt::Windows::Foundation::IActivationFactory const&), DataProtectionProvider>([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance<DataProtectionProvider>(); }))
|
|
{
|
|
}
|
|
inline DataProtectionProvider::DataProtectionProvider(param::hstring const& protectionDescriptor) :
|
|
DataProtectionProvider(impl::call_factory<DataProtectionProvider, IDataProtectionProviderFactory>([&](IDataProtectionProviderFactory const& f) { return f.CreateOverloadExplicit(protectionDescriptor); }))
|
|
{
|
|
}
|
|
}
|
|
namespace std
|
|
{
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template<> struct hash<winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider> : winrt::impl::hash_base {};
|
|
template<> struct hash<winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProviderFactory> : winrt::impl::hash_base {};
|
|
template<> struct hash<winrt::Windows::Security::Cryptography::DataProtection::DataProtectionProvider> : winrt::impl::hash_base {};
|
|
#endif
|
|
#ifdef __cpp_lib_format
|
|
#endif
|
|
}
|
|
#endif
|