// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #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.240405.15"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.240405.15" #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 auto consume_Windows_Security_Cryptography_DataProtection_IDataProtectionProvider::ProtectAsync(winrt::Windows::Storage::Streams::IBuffer const& data) const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider)->ProtectAsync(*(void**)(&data), &value)); return winrt::Windows::Foundation::IAsyncOperation{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Cryptography_DataProtection_IDataProtectionProvider::UnprotectAsync(winrt::Windows::Storage::Streams::IBuffer const& data) const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider)->UnprotectAsync(*(void**)(&data), &value)); return winrt::Windows::Foundation::IAsyncOperation{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Cryptography_DataProtection_IDataProtectionProvider::ProtectStreamAsync(winrt::Windows::Storage::Streams::IInputStream const& src, winrt::Windows::Storage::Streams::IOutputStream const& dest) const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider)->ProtectStreamAsync(*(void**)(&src), *(void**)(&dest), &value)); return winrt::Windows::Foundation::IAsyncAction{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Cryptography_DataProtection_IDataProtectionProvider::UnprotectStreamAsync(winrt::Windows::Storage::Streams::IInputStream const& src, winrt::Windows::Storage::Streams::IOutputStream const& dest) const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProvider)->UnprotectStreamAsync(*(void**)(&src), *(void**)(&dest), &value)); return winrt::Windows::Foundation::IAsyncAction{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Cryptography_DataProtection_IDataProtectionProviderFactory::CreateOverloadExplicit(param::hstring const& protectionDescriptor) const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::Cryptography::DataProtection::IDataProtectionProviderFactory)->CreateOverloadExplicit(*(void**)(&protectionDescriptor), &value)); return winrt::Windows::Security::Cryptography::DataProtection::DataProtectionProvider{ value, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall ProtectAsync(void* data, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().ProtectAsync(*reinterpret_cast(&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>(this->shim().UnprotectAsync(*reinterpret_cast(&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(this->shim().ProtectStreamAsync(*reinterpret_cast(&src), *reinterpret_cast(&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(this->shim().UnprotectStreamAsync(*reinterpret_cast(&src), *reinterpret_cast(&dest))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateOverloadExplicit(void* protectionDescriptor, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CreateOverloadExplicit(*reinterpret_cast(&protectionDescriptor))); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Security::Cryptography::DataProtection { inline DataProtectionProvider::DataProtectionProvider() : DataProtectionProvider(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline DataProtectionProvider::DataProtectionProvider(param::hstring const& protectionDescriptor) : DataProtectionProvider(impl::call_factory([&](IDataProtectionProviderFactory const& f) { return f.CreateOverloadExplicit(protectionDescriptor); })) { } } 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 {}; #endif #ifdef __cpp_lib_format #endif } #endif