// C++/WinRT v2.0.250303.1 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Storage_AccessCache_H #define WINRT_Windows_Storage_AccessCache_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.Storage.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Storage.2.h" #include "winrt/impl/Windows.System.2.h" #include "winrt/impl/Windows.Storage.AccessCache.2.h" namespace winrt::impl { template auto consume_Windows_Storage_AccessCache_IItemRemovedEventArgs::RemovedEntry() const { winrt::Windows::Storage::AccessCache::AccessListEntry value{}; 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->get_RemovedEntry(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_RemovedEntry(put_abi(value))); } return value; } template auto consume_Windows_Storage_AccessCache_IStorageApplicationPermissionsStatics::FutureAccessList() const { void* value{}; 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->get_FutureAccessList(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_FutureAccessList(&value)); } return winrt::Windows::Storage::AccessCache::StorageItemAccessList{ value, take_ownership_from_abi }; } template auto consume_Windows_Storage_AccessCache_IStorageApplicationPermissionsStatics::MostRecentlyUsedList() const { void* value{}; 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->get_MostRecentlyUsedList(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MostRecentlyUsedList(&value)); } return winrt::Windows::Storage::AccessCache::StorageItemMostRecentlyUsedList{ value, take_ownership_from_abi }; } template auto consume_Windows_Storage_AccessCache_IStorageApplicationPermissionsStatics2::GetFutureAccessListForUser(winrt::Windows::System::User const& user) const { void* value{}; 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->GetFutureAccessListForUser(*(void**)(&user), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetFutureAccessListForUser(*(void**)(&user), &value)); } return winrt::Windows::Storage::AccessCache::StorageItemAccessList{ value, take_ownership_from_abi }; } template auto consume_Windows_Storage_AccessCache_IStorageApplicationPermissionsStatics2::GetMostRecentlyUsedListForUser(winrt::Windows::System::User const& user) const { void* value{}; 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->GetMostRecentlyUsedListForUser(*(void**)(&user), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetMostRecentlyUsedListForUser(*(void**)(&user), &value)); } return winrt::Windows::Storage::AccessCache::StorageItemMostRecentlyUsedList{ value, take_ownership_from_abi }; } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::Add(winrt::Windows::Storage::IStorageItem const& file) const { void* token{}; 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->AddOverloadDefaultMetadata(*(void**)(&file), &token)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->AddOverloadDefaultMetadata(*(void**)(&file), &token)); } return hstring{ token, take_ownership_from_abi }; } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::Add(winrt::Windows::Storage::IStorageItem const& file, param::hstring const& metadata) const { void* token{}; 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->Add(*(void**)(&file), *(void**)(&metadata), &token)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Add(*(void**)(&file), *(void**)(&metadata), &token)); } return hstring{ token, take_ownership_from_abi }; } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::AddOrReplace(param::hstring const& token, winrt::Windows::Storage::IStorageItem const& file) const { 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->AddOrReplaceOverloadDefaultMetadata(*(void**)(&token), *(void**)(&file))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->AddOrReplaceOverloadDefaultMetadata(*(void**)(&token), *(void**)(&file))); } } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::AddOrReplace(param::hstring const& token, winrt::Windows::Storage::IStorageItem const& file, param::hstring const& metadata) const { 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->AddOrReplace(*(void**)(&token), *(void**)(&file), *(void**)(&metadata))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->AddOrReplace(*(void**)(&token), *(void**)(&file), *(void**)(&metadata))); } } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::GetItemAsync(param::hstring const& token) 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->GetItemAsync(*(void**)(&token), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetItemAsync(*(void**)(&token), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::GetFileAsync(param::hstring const& token) 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->GetFileAsync(*(void**)(&token), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetFileAsync(*(void**)(&token), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::GetFolderAsync(param::hstring const& token) 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->GetFolderAsync(*(void**)(&token), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetFolderAsync(*(void**)(&token), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::GetItemAsync(param::hstring const& token, winrt::Windows::Storage::AccessCache::AccessCacheOptions const& options) 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->GetItemWithOptionsAsync(*(void**)(&token), static_cast(options), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetItemWithOptionsAsync(*(void**)(&token), static_cast(options), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::GetFileAsync(param::hstring const& token, winrt::Windows::Storage::AccessCache::AccessCacheOptions const& options) 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->GetFileWithOptionsAsync(*(void**)(&token), static_cast(options), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetFileWithOptionsAsync(*(void**)(&token), static_cast(options), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::GetFolderAsync(param::hstring const& token, winrt::Windows::Storage::AccessCache::AccessCacheOptions const& options) 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->GetFolderWithOptionsAsync(*(void**)(&token), static_cast(options), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetFolderWithOptionsAsync(*(void**)(&token), static_cast(options), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::Remove(param::hstring const& token) const { 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->Remove(*(void**)(&token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Remove(*(void**)(&token))); } } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::ContainsItem(param::hstring const& token) const { bool value{}; 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->ContainsItem(*(void**)(&token), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ContainsItem(*(void**)(&token), &value)); } return value; } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::Clear() const { 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->Clear()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Clear()); } } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::CheckAccess(winrt::Windows::Storage::IStorageItem const& file) const { bool value{}; 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->CheckAccess(*(void**)(&file), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CheckAccess(*(void**)(&file), &value)); } return value; } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::Entries() const { void* entries{}; 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->get_Entries(&entries)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Entries(&entries)); } return winrt::Windows::Storage::AccessCache::AccessListEntryView{ entries, take_ownership_from_abi }; } template auto consume_Windows_Storage_AccessCache_IStorageItemAccessList::MaximumItemsAllowed() const { uint32_t value{}; 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->get_MaximumItemsAllowed(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MaximumItemsAllowed(&value)); } return value; } template auto consume_Windows_Storage_AccessCache_IStorageItemMostRecentlyUsedList::ItemRemoved(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token eventCookie{}; 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->add_ItemRemoved(*(void**)(&handler), put_abi(eventCookie))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->add_ItemRemoved(*(void**)(&handler), put_abi(eventCookie))); } return eventCookie; } template auto consume_Windows_Storage_AccessCache_IStorageItemMostRecentlyUsedList::ItemRemoved(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, ItemRemoved(handler)); } template auto consume_Windows_Storage_AccessCache_IStorageItemMostRecentlyUsedList::ItemRemoved(winrt::event_token const& eventCookie) const noexcept { 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; _winrt_abi_type->remove_ItemRemoved(impl::bind_in(eventCookie)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_ItemRemoved(impl::bind_in(eventCookie)); } } template auto consume_Windows_Storage_AccessCache_IStorageItemMostRecentlyUsedList2::Add(winrt::Windows::Storage::IStorageItem const& file, param::hstring const& metadata, winrt::Windows::Storage::AccessCache::RecentStorageItemVisibility const& visibility) const { void* token{}; 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->AddWithMetadataAndVisibility(*(void**)(&file), *(void**)(&metadata), static_cast(visibility), &token)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->AddWithMetadataAndVisibility(*(void**)(&file), *(void**)(&metadata), static_cast(visibility), &token)); } return hstring{ token, take_ownership_from_abi }; } template auto consume_Windows_Storage_AccessCache_IStorageItemMostRecentlyUsedList2::AddOrReplace(param::hstring const& token, winrt::Windows::Storage::IStorageItem const& file, param::hstring const& metadata, winrt::Windows::Storage::AccessCache::RecentStorageItemVisibility const& visibility) const { 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->AddOrReplaceWithMetadataAndVisibility(*(void**)(&token), *(void**)(&file), *(void**)(&metadata), static_cast(visibility))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->AddOrReplaceWithMetadataAndVisibility(*(void**)(&token), *(void**)(&file), *(void**)(&metadata), static_cast(visibility))); } } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_RemovedEntry(struct struct_Windows_Storage_AccessCache_AccessListEntry* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RemovedEntry()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_FutureAccessList(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().FutureAccessList()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MostRecentlyUsedList(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MostRecentlyUsedList()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetFutureAccessListForUser(void* user, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetFutureAccessListForUser(*reinterpret_cast(&user))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetMostRecentlyUsedListForUser(void* user, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetMostRecentlyUsedListForUser(*reinterpret_cast(&user))); return 0; } catch (...) { return to_hresult(); } }; #endif template struct produce : produce_base { int32_t __stdcall AddOverloadDefaultMetadata(void* file, void** token) noexcept final try { clear_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().Add(*reinterpret_cast(&file))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Add(void* file, void* metadata, void** token) noexcept final try { clear_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().Add(*reinterpret_cast(&file), *reinterpret_cast(&metadata))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall AddOrReplaceOverloadDefaultMetadata(void* token, void* file) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AddOrReplace(*reinterpret_cast(&token), *reinterpret_cast(&file)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall AddOrReplace(void* token, void* file, void* metadata) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AddOrReplace(*reinterpret_cast(&token), *reinterpret_cast(&file), *reinterpret_cast(&metadata)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetItemAsync(void* token, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().GetItemAsync(*reinterpret_cast(&token))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetFileAsync(void* token, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().GetFileAsync(*reinterpret_cast(&token))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetFolderAsync(void* token, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().GetFolderAsync(*reinterpret_cast(&token))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetItemWithOptionsAsync(void* token, uint32_t options, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().GetItemAsync(*reinterpret_cast(&token), *reinterpret_cast(&options))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetFileWithOptionsAsync(void* token, uint32_t options, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().GetFileAsync(*reinterpret_cast(&token), *reinterpret_cast(&options))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetFolderWithOptionsAsync(void* token, uint32_t options, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().GetFolderAsync(*reinterpret_cast(&token), *reinterpret_cast(&options))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Remove(void* token) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Remove(*reinterpret_cast(&token)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ContainsItem(void* token, bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ContainsItem(*reinterpret_cast(&token))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Clear() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Clear(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CheckAccess(void* file, bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CheckAccess(*reinterpret_cast(&file))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Entries(void** entries) noexcept final try { clear_abi(entries); typename D::abi_guard guard(this->shim()); *entries = detach_from(this->shim().Entries()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaximumItemsAllowed(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaximumItemsAllowed()); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall add_ItemRemoved(void* handler, winrt::event_token* eventCookie) noexcept final try { zero_abi(eventCookie); typename D::abi_guard guard(this->shim()); *eventCookie = detach_from(this->shim().ItemRemoved(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ItemRemoved(winrt::event_token eventCookie) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ItemRemoved(*reinterpret_cast(&eventCookie)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall AddWithMetadataAndVisibility(void* file, void* metadata, int32_t visibility, void** token) noexcept final try { clear_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().Add(*reinterpret_cast(&file), *reinterpret_cast(&metadata), *reinterpret_cast(&visibility))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall AddOrReplaceWithMetadataAndVisibility(void* token, void* file, void* metadata, int32_t visibility) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AddOrReplace(*reinterpret_cast(&token), *reinterpret_cast(&file), *reinterpret_cast(&metadata), *reinterpret_cast(&visibility)); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Storage::AccessCache { constexpr auto operator|(AccessCacheOptions const left, AccessCacheOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(AccessCacheOptions& left, AccessCacheOptions const right) noexcept { left = left | right; return left; } constexpr auto operator&(AccessCacheOptions const left, AccessCacheOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(AccessCacheOptions& left, AccessCacheOptions const right) noexcept { left = left & right; return left; } constexpr auto operator~(AccessCacheOptions const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(AccessCacheOptions const left, AccessCacheOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(AccessCacheOptions& left, AccessCacheOptions const right) noexcept { left = left ^ right; return left; } inline auto StorageApplicationPermissions::FutureAccessList() { return impl::call_factory_cast([](IStorageApplicationPermissionsStatics const& f) { return f.FutureAccessList(); }); } inline auto StorageApplicationPermissions::MostRecentlyUsedList() { return impl::call_factory_cast([](IStorageApplicationPermissionsStatics const& f) { return f.MostRecentlyUsedList(); }); } inline auto StorageApplicationPermissions::GetFutureAccessListForUser(winrt::Windows::System::User const& user) { return impl::call_factory([&](IStorageApplicationPermissionsStatics2 const& f) { return f.GetFutureAccessListForUser(user); }); } inline auto StorageApplicationPermissions::GetMostRecentlyUsedListForUser(winrt::Windows::System::User const& user) { return impl::call_factory([&](IStorageApplicationPermissionsStatics2 const& f) { return f.GetMostRecentlyUsedListForUser(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 {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } #endif