// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_Security_DataProtection_H #define WINRT_Windows_Security_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/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Storage.2.h" #include "winrt/impl/Windows.Storage.Streams.2.h" #include "winrt/impl/Windows.System.2.h" #include "winrt/impl/Windows.Security.DataProtection.2.h" namespace winrt::impl { template auto consume_Windows_Security_DataProtection_IUserDataAvailabilityStateChangedEventArgs::GetDeferral() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::DataProtection::IUserDataAvailabilityStateChangedEventArgs)->GetDeferral(&result)); return winrt::Windows::Foundation::Deferral{ result, take_ownership_from_abi }; } template auto consume_Windows_Security_DataProtection_IUserDataBufferUnprotectResult::Status() const { winrt::Windows::Security::DataProtection::UserDataBufferUnprotectStatus value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::DataProtection::IUserDataBufferUnprotectResult)->get_Status(reinterpret_cast(&value))); return value; } template auto consume_Windows_Security_DataProtection_IUserDataBufferUnprotectResult::UnprotectedBuffer() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::DataProtection::IUserDataBufferUnprotectResult)->get_UnprotectedBuffer(&value)); return winrt::Windows::Storage::Streams::IBuffer{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_DataProtection_IUserDataProtectionManager::ProtectStorageItemAsync(winrt::Windows::Storage::IStorageItem const& storageItem, winrt::Windows::Security::DataProtection::UserDataAvailability const& availability) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::DataProtection::IUserDataProtectionManager)->ProtectStorageItemAsync(*(void**)(&storageItem), static_cast(availability), &result)); return winrt::Windows::Foundation::IAsyncOperation{ result, take_ownership_from_abi }; } template auto consume_Windows_Security_DataProtection_IUserDataProtectionManager::GetStorageItemProtectionInfoAsync(winrt::Windows::Storage::IStorageItem const& storageItem) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::DataProtection::IUserDataProtectionManager)->GetStorageItemProtectionInfoAsync(*(void**)(&storageItem), &result)); return winrt::Windows::Foundation::IAsyncOperation{ result, take_ownership_from_abi }; } template auto consume_Windows_Security_DataProtection_IUserDataProtectionManager::ProtectBufferAsync(winrt::Windows::Storage::Streams::IBuffer const& unprotectedBuffer, winrt::Windows::Security::DataProtection::UserDataAvailability const& availability) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::DataProtection::IUserDataProtectionManager)->ProtectBufferAsync(*(void**)(&unprotectedBuffer), static_cast(availability), &result)); return winrt::Windows::Foundation::IAsyncOperation{ result, take_ownership_from_abi }; } template auto consume_Windows_Security_DataProtection_IUserDataProtectionManager::UnprotectBufferAsync(winrt::Windows::Storage::Streams::IBuffer const& protectedBuffer) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::DataProtection::IUserDataProtectionManager)->UnprotectBufferAsync(*(void**)(&protectedBuffer), &result)); return winrt::Windows::Foundation::IAsyncOperation{ result, take_ownership_from_abi }; } template auto consume_Windows_Security_DataProtection_IUserDataProtectionManager::IsContinuedDataAvailabilityExpected(winrt::Windows::Security::DataProtection::UserDataAvailability const& availability) const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::DataProtection::IUserDataProtectionManager)->IsContinuedDataAvailabilityExpected(static_cast(availability), &value)); return value; } template auto consume_Windows_Security_DataProtection_IUserDataProtectionManager::DataAvailabilityStateChanged(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::DataProtection::IUserDataProtectionManager)->add_DataAvailabilityStateChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_Security_DataProtection_IUserDataProtectionManager::DataAvailabilityStateChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, DataAvailabilityStateChanged(handler)); } template auto consume_Windows_Security_DataProtection_IUserDataProtectionManager::DataAvailabilityStateChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Security::DataProtection::IUserDataProtectionManager)->remove_DataAvailabilityStateChanged(impl::bind_in(token)); } template auto consume_Windows_Security_DataProtection_IUserDataProtectionManagerStatics::TryGetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::DataProtection::IUserDataProtectionManagerStatics)->TryGetDefault(&result)); return winrt::Windows::Security::DataProtection::UserDataProtectionManager{ result, take_ownership_from_abi }; } template auto consume_Windows_Security_DataProtection_IUserDataProtectionManagerStatics::TryGetForUser(winrt::Windows::System::User const& user) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::DataProtection::IUserDataProtectionManagerStatics)->TryGetForUser(*(void**)(&user), &result)); return winrt::Windows::Security::DataProtection::UserDataProtectionManager{ result, take_ownership_from_abi }; } template auto consume_Windows_Security_DataProtection_IUserDataStorageItemProtectionInfo::Availability() const { winrt::Windows::Security::DataProtection::UserDataAvailability value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Security::DataProtection::IUserDataStorageItemProtectionInfo)->get_Availability(reinterpret_cast(&value))); return value; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDeferral(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetDeferral()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Status(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Status()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_UnprotectedBuffer(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UnprotectedBuffer()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall ProtectStorageItemAsync(void* storageItem, int32_t availability, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from>(this->shim().ProtectStorageItemAsync(*reinterpret_cast(&storageItem), *reinterpret_cast(&availability))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetStorageItemProtectionInfoAsync(void* storageItem, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from>(this->shim().GetStorageItemProtectionInfoAsync(*reinterpret_cast(&storageItem))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ProtectBufferAsync(void* unprotectedBuffer, int32_t availability, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from>(this->shim().ProtectBufferAsync(*reinterpret_cast(&unprotectedBuffer), *reinterpret_cast(&availability))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall UnprotectBufferAsync(void* protectedBuffer, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from>(this->shim().UnprotectBufferAsync(*reinterpret_cast(&protectedBuffer))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsContinuedDataAvailabilityExpected(int32_t availability, bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsContinuedDataAvailabilityExpected(*reinterpret_cast(&availability))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_DataAvailabilityStateChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().DataAvailabilityStateChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_DataAvailabilityStateChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().DataAvailabilityStateChanged(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall TryGetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().TryGetDefault()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall TryGetForUser(void* user, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().TryGetForUser(*reinterpret_cast(&user))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Availability(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Availability()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Security::DataProtection { inline auto UserDataProtectionManager::TryGetDefault() { return impl::call_factory_cast([](IUserDataProtectionManagerStatics const& f) { return f.TryGetDefault(); }); } inline auto UserDataProtectionManager::TryGetForUser(winrt::Windows::System::User const& user) { return impl::call_factory([&](IUserDataProtectionManagerStatics const& f) { return f.TryGetForUser(user); }); } } 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 {}; 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 } #endif