// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.250303.1 #pragma once #ifndef WINRT_Windows_Security_Credentials_H #define WINRT_Windows_Security_Credentials_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/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Security.Credentials.2.h" #include "winrt/impl/Windows.Security.Cryptography.Core.2.h" #include "winrt/impl/Windows.Storage.Streams.2.h" #include "winrt/impl/Windows.System.2.h" #include "winrt/impl/Windows.UI.2.h" namespace winrt::impl { template auto consume_Windows_Security_Credentials_ICredentialFactory::CreatePasswordCredential(param::hstring const& resource, param::hstring const& userName, param::hstring const& password) const { void* credential{}; 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->CreatePasswordCredential(*(void**)(&resource), *(void**)(&userName), *(void**)(&password), &credential)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreatePasswordCredential(*(void**)(&resource), *(void**)(&userName), *(void**)(&password), &credential)); } return winrt::Windows::Security::Credentials::PasswordCredential{ credential, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredential::Name() 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_Name(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Name(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredential::RetrievePublicKey() 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->RetrievePublicKeyWithDefaultBlobType(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RetrievePublicKeyWithDefaultBlobType(&value)); } return winrt::Windows::Storage::Streams::IBuffer{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredential::RetrievePublicKey(winrt::Windows::Security::Cryptography::Core::CryptographicPublicKeyBlobType const& blobType) 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->RetrievePublicKeyWithBlobType(static_cast(blobType), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RetrievePublicKeyWithBlobType(static_cast(blobType), &value)); } return winrt::Windows::Storage::Streams::IBuffer{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredential::RequestSignAsync(winrt::Windows::Storage::Streams::IBuffer const& data) 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->RequestSignAsync(*(void**)(&data), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RequestSignAsync(*(void**)(&data), &value)); } return winrt::Windows::Foundation::IAsyncOperation{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredential::GetAttestationAsync() 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->GetAttestationAsync(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetAttestationAsync(&value)); } return winrt::Windows::Foundation::IAsyncOperation{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredential2:: RequestDeriveSharedSecretAsync( winrt::Windows::UI::WindowId const& windowId, param::hstring const& message, winrt::Windows::Storage::Streams::IBuffer const& encryptedRequest) 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< winrt::Windows::Security::Credentials::IKeyCredential2, D const*>( 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->RequestDeriveSharedSecretAsync( impl::bind_in(windowId), *(void**)(&message), *(void**)(&encryptedRequest), &operation)); } else { auto const _winrt_abi_type = *(abi_t< winrt::Windows::Security::Credentials::IKeyCredential2>**)this; check_hresult(_winrt_abi_type->RequestDeriveSharedSecretAsync( impl::bind_in(windowId), *(void**)(&message), *(void**)(&encryptedRequest), &operation)); } return winrt::Windows::Foundation::IAsyncOperation< winrt::Windows::Security::Credentials::KeyCredentialOperationResult>{ operation, take_ownership_from_abi}; } template auto consume_Windows_Security_Credentials_IKeyCredential2:: RetrieveAuthorizationContext( winrt::Windows::Storage::Streams::IBuffer const& encryptedRequest) const { void* result{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Windows::Security::Credentials::IKeyCredential2, D const*>( 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->RetrieveAuthorizationContext( *(void**)(&encryptedRequest), &result)); } else { auto const _winrt_abi_type = *(abi_t< winrt::Windows::Security::Credentials::IKeyCredential2>**)this; check_hresult(_winrt_abi_type->RetrieveAuthorizationContext( *(void**)(&encryptedRequest), &result)); } return winrt::Windows::Storage::Streams::IBuffer{result, take_ownership_from_abi}; } template auto consume_Windows_Security_Credentials_IKeyCredentialAttestationResult::CertificateChainBuffer() 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_CertificateChainBuffer(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_CertificateChainBuffer(&value)); } return winrt::Windows::Storage::Streams::IBuffer{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredentialAttestationResult::AttestationBuffer() 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_AttestationBuffer(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AttestationBuffer(&value)); } return winrt::Windows::Storage::Streams::IBuffer{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredentialAttestationResult::Status() const { winrt::Windows::Security::Credentials::KeyCredentialAttestationStatus 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_Status(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Status(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Security_Credentials_IKeyCredentialCacheConfiguration< D>::CacheOption() const { winrt::Windows::Security::Credentials::KeyCredentialCacheOption 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_CacheOption( reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_CacheOption( reinterpret_cast(&value))); } return value; } template auto consume_Windows_Security_Credentials_IKeyCredentialCacheConfiguration< D>::Timeout() const { winrt::Windows::Foundation::TimeSpan 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_Timeout(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Timeout(put_abi(value))); } return value; } template auto consume_Windows_Security_Credentials_IKeyCredentialCacheConfiguration< D>::UsageCount() 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_UsageCount(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UsageCount(&value)); } return value; } template auto consume_Windows_Security_Credentials_IKeyCredentialCacheConfigurationFactory< D>::CreateInstance(winrt::Windows::Security::Credentials:: KeyCredentialCacheOption const& cacheOption, winrt::Windows::Foundation::TimeSpan const& timeout, uint32_t usageCount) const { void* result{}; if constexpr (!std::is_same_v< D, winrt::Windows::Security::Credentials:: IKeyCredentialCacheConfigurationFactory>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Windows::Security::Credentials:: IKeyCredentialCacheConfigurationFactory, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t< winrt::Windows::Security::Credentials:: IKeyCredentialCacheConfigurationFactory>**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateInstance( static_cast(cacheOption), impl::bind_in(timeout), usageCount, &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateInstance( static_cast(cacheOption), impl::bind_in(timeout), usageCount, &result)); } return winrt::Windows::Security::Credentials:: KeyCredentialCacheConfiguration{result, take_ownership_from_abi}; } template auto consume_Windows_Security_Credentials_IKeyCredentialManagerStatics::IsSupportedAsync() 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->IsSupportedAsync(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsSupportedAsync(&value)); } return winrt::Windows::Foundation::IAsyncOperation{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredentialManagerStatics::RenewAttestationAsync() 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->RenewAttestationAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RenewAttestationAsync(&operation)); } return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredentialManagerStatics::RequestCreateAsync(param::hstring const& name, winrt::Windows::Security::Credentials::KeyCredentialCreationOption const& option) 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->RequestCreateAsync(*(void**)(&name), static_cast(option), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RequestCreateAsync(*(void**)(&name), static_cast(option), &value)); } return winrt::Windows::Foundation::IAsyncOperation{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredentialManagerStatics::OpenAsync(param::hstring const& name) 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->OpenAsync(*(void**)(&name), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OpenAsync(*(void**)(&name), &value)); } return winrt::Windows::Foundation::IAsyncOperation{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredentialManagerStatics::DeleteAsync(param::hstring const& name) 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->DeleteAsync(*(void**)(&name), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->DeleteAsync(*(void**)(&name), &operation)); } return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredentialManagerStatics2:: RequestCreateAsync( param::hstring const& name, winrt::Windows::Security::Credentials:: KeyCredentialCreationOption const& option, param::hstring const& algorithm, param::hstring const& message, winrt::Windows::Security::Credentials:: KeyCredentialCacheConfiguration const& cacheConfiguration, winrt::Windows::UI::WindowId const& windowId, winrt::Windows::Security::Credentials::ChallengeResponseKind const& callbackType, winrt::Windows::Security::Credentials:: AttestationChallengeHandler const& attestationCallback) 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->RequestCreateAsync( *(void**)(&name), static_cast(option), *(void**)(&algorithm), *(void**)(&message), *(void**)(&cacheConfiguration), impl::bind_in(windowId), static_cast(callbackType), *(void**)(&attestationCallback), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RequestCreateAsync( *(void**)(&name), static_cast(option), *(void**)(&algorithm), *(void**)(&message), *(void**)(&cacheConfiguration), impl::bind_in(windowId), static_cast(callbackType), *(void**)(&attestationCallback), &operation)); } return winrt::Windows::Foundation::IAsyncOperation< winrt::Windows::Security::Credentials::KeyCredentialRetrievalResult>{ operation, take_ownership_from_abi}; } template auto consume_Windows_Security_Credentials_IKeyCredentialManagerStatics2:: OpenAsync( param::hstring const& name, winrt::Windows::Security::Credentials::ChallengeResponseKind const& callbackType, winrt::Windows::Security::Credentials:: AttestationChallengeHandler const& attestationCallback) 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->OpenAsync( *(void**)(&name), static_cast(callbackType), *(void**)(&attestationCallback), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OpenAsync( *(void**)(&name), static_cast(callbackType), *(void**)(&attestationCallback), &operation)); } return winrt::Windows::Foundation::IAsyncOperation< winrt::Windows::Security::Credentials::KeyCredentialRetrievalResult>{ operation, take_ownership_from_abi}; } template auto consume_Windows_Security_Credentials_IKeyCredentialOperationResult::Result() 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_Result(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Result(&value)); } return winrt::Windows::Storage::Streams::IBuffer{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredentialOperationResult::Status() const { winrt::Windows::Security::Credentials::KeyCredentialStatus 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_Status(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Status(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Security_Credentials_IKeyCredentialRetrievalResult::Credential() 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_Credential(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Credential(&value)); } return winrt::Windows::Security::Credentials::KeyCredential{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IKeyCredentialRetrievalResult::Status() const { winrt::Windows::Security::Credentials::KeyCredentialStatus 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_Status(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Status(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Security_Credentials_IPasswordCredential::Resource() const { void* resource{}; 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_Resource(&resource)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Resource(&resource)); } return hstring{ resource, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IPasswordCredential::Resource(param::hstring const& resource) 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->put_Resource(*(void**)(&resource))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Resource(*(void**)(&resource))); } } template auto consume_Windows_Security_Credentials_IPasswordCredential::UserName() const { void* userName{}; 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_UserName(&userName)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UserName(&userName)); } return hstring{ userName, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IPasswordCredential::UserName(param::hstring const& userName) 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->put_UserName(*(void**)(&userName))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_UserName(*(void**)(&userName))); } } template auto consume_Windows_Security_Credentials_IPasswordCredential::Password() const { void* password{}; 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_Password(&password)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Password(&password)); } return hstring{ password, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IPasswordCredential::Password(param::hstring const& password) 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->put_Password(*(void**)(&password))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Password(*(void**)(&password))); } } template auto consume_Windows_Security_Credentials_IPasswordCredential::RetrievePassword() 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->RetrievePassword()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RetrievePassword()); } } template auto consume_Windows_Security_Credentials_IPasswordCredential::Properties() const { void* props{}; 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_Properties(&props)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Properties(&props)); } return winrt::Windows::Foundation::Collections::IPropertySet{ props, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IPasswordVault::Add(winrt::Windows::Security::Credentials::PasswordCredential const& credential) 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->Add(*(void**)(&credential))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Add(*(void**)(&credential))); } } template auto consume_Windows_Security_Credentials_IPasswordVault::Remove(winrt::Windows::Security::Credentials::PasswordCredential const& credential) 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**)(&credential))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Remove(*(void**)(&credential))); } } template auto consume_Windows_Security_Credentials_IPasswordVault::Retrieve(param::hstring const& resource, param::hstring const& userName) const { void* credential{}; 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->Retrieve(*(void**)(&resource), *(void**)(&userName), &credential)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Retrieve(*(void**)(&resource), *(void**)(&userName), &credential)); } return winrt::Windows::Security::Credentials::PasswordCredential{ credential, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IPasswordVault::FindAllByResource(param::hstring const& resource) const { void* credentials{}; 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->FindAllByResource(*(void**)(&resource), &credentials)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->FindAllByResource(*(void**)(&resource), &credentials)); } return winrt::Windows::Foundation::Collections::IVectorView{ credentials, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IPasswordVault::FindAllByUserName(param::hstring const& userName) const { void* credentials{}; 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->FindAllByUserName(*(void**)(&userName), &credentials)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->FindAllByUserName(*(void**)(&userName), &credentials)); } return winrt::Windows::Foundation::Collections::IVectorView{ credentials, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IPasswordVault::RetrieveAll() const { void* credentials{}; 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->RetrieveAll(&credentials)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RetrieveAll(&credentials)); } return winrt::Windows::Foundation::Collections::IVectorView{ credentials, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccount::WebAccountProvider() 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_WebAccountProvider(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_WebAccountProvider(&value)); } return winrt::Windows::Security::Credentials::WebAccountProvider{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccount::UserName() 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_UserName(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UserName(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccount::State() const { winrt::Windows::Security::Credentials::WebAccountState 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_State(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_State(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Security_Credentials_IWebAccount2::Id() 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_Id(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Id(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccount2::Properties() 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_Properties(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Properties(&value)); } return winrt::Windows::Foundation::Collections::IMapView{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccount2::GetPictureAsync(winrt::Windows::Security::Credentials::WebAccountPictureSize const& desizedSize) const { void* asyncInfo{}; 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->GetPictureAsync(static_cast(desizedSize), &asyncInfo)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetPictureAsync(static_cast(desizedSize), &asyncInfo)); } return winrt::Windows::Foundation::IAsyncOperation{ asyncInfo, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccount2::SignOutAsync() const { void* asyncInfo{}; 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->SignOutAsync(&asyncInfo)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SignOutAsync(&asyncInfo)); } return winrt::Windows::Foundation::IAsyncAction{ asyncInfo, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccount2::SignOutAsync(param::hstring const& clientId) const { void* asyncInfo{}; 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->SignOutWithClientIdAsync(*(void**)(&clientId), &asyncInfo)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SignOutWithClientIdAsync(*(void**)(&clientId), &asyncInfo)); } return winrt::Windows::Foundation::IAsyncAction{ asyncInfo, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccountFactory::CreateWebAccount(winrt::Windows::Security::Credentials::WebAccountProvider const& webAccountProvider, param::hstring const& userName, winrt::Windows::Security::Credentials::WebAccountState const& state) const { void* instance{}; 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->CreateWebAccount(*(void**)(&webAccountProvider), *(void**)(&userName), static_cast(state), &instance)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateWebAccount(*(void**)(&webAccountProvider), *(void**)(&userName), static_cast(state), &instance)); } return winrt::Windows::Security::Credentials::WebAccount{ instance, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccountProvider::Id() 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_Id(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Id(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccountProvider::DisplayName() 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_DisplayName(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DisplayName(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccountProvider::IconUri() 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_IconUri(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IconUri(&value)); } return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccountProvider2::DisplayPurpose() 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_DisplayPurpose(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DisplayPurpose(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccountProvider2::Authority() 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_Authority(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Authority(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccountProvider3::User() const { void* user{}; 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_User(&user)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_User(&user)); } return winrt::Windows::System::User{ user, take_ownership_from_abi }; } template auto consume_Windows_Security_Credentials_IWebAccountProvider4::IsSystemProvider() 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->get_IsSystemProvider(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IsSystemProvider(&value)); } return value; } template auto consume_Windows_Security_Credentials_IWebAccountProviderFactory::CreateWebAccountProvider(param::hstring const& id, param::hstring const& displayName, winrt::Windows::Foundation::Uri const& iconUri) const { void* instance{}; 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->CreateWebAccountProvider(*(void**)(&id), *(void**)(&displayName), *(void**)(&iconUri), &instance)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateWebAccountProvider(*(void**)(&id), *(void**)(&displayName), *(void**)(&iconUri), &instance)); } return winrt::Windows::Security::Credentials::WebAccountProvider{ instance, take_ownership_from_abi }; } template struct delegate< winrt::Windows::Security::Credentials::AttestationChallengeHandler, H> final : implements_delegate { delegate(H&& handler) : implements_delegate(std::forward(handler)) {} int32_t __stdcall Invoke(void* challenge, void** result) noexcept final try { clear_abi(result); *result = detach_from(( *this)( *reinterpret_cast( &challenge))); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreatePasswordCredential(void* resource, void* userName, void* password, void** credential) noexcept final try { clear_abi(credential); typename D::abi_guard guard(this->shim()); *credential = detach_from(this->shim().CreatePasswordCredential(*reinterpret_cast(&resource), *reinterpret_cast(&userName), *reinterpret_cast(&password))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Name(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Name()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RetrievePublicKeyWithDefaultBlobType(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RetrievePublicKey()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RetrievePublicKeyWithBlobType(int32_t blobType, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RetrievePublicKey(*reinterpret_cast(&blobType))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RequestSignAsync(void* data, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().RequestSignAsync(*reinterpret_cast(&data))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetAttestationAsync(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().GetAttestationAsync()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall RequestDeriveSharedSecretAsync( struct struct_Windows_UI_WindowId windowId, void* message, void* encryptedRequest, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().RequestDeriveSharedSecretAsync( *reinterpret_cast( &windowId), *reinterpret_cast(&message), *reinterpret_cast< winrt::Windows::Storage::Streams::IBuffer const*>( &encryptedRequest))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RetrieveAuthorizationContext( void* encryptedRequest, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from( this->shim().RetrieveAuthorizationContext( *reinterpret_cast< winrt::Windows::Storage::Streams::IBuffer const*>( &encryptedRequest))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce< D, winrt::Windows::Security::Credentials::IKeyCredentialAttestationResult> : produce_base { int32_t __stdcall get_CertificateChainBuffer(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from( this->shim().CertificateChainBuffer()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AttestationBuffer(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from( this->shim().AttestationBuffer()); return 0; } catch (...) { return to_hresult(); } 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(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce< D, winrt::Windows::Security::Credentials::IKeyCredentialCacheConfiguration> : produce_base { int32_t __stdcall get_CacheOption(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from< winrt::Windows::Security::Credentials::KeyCredentialCacheOption>( this->shim().CacheOption()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Timeout(int64_t* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from( this->shim().Timeout()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_UsageCount(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UsageCount()); return 0; } catch (...) { return to_hresult(); } }; #endif template struct produce : produce_base { int32_t __stdcall CreateInstance(int32_t cacheOption, int64_t timeout, uint32_t usageCount, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from( this->shim().CreateInstance( *reinterpret_cast( &cacheOption), *reinterpret_cast( &timeout), usageCount)); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce< D, winrt::Windows::Security::Credentials::IKeyCredentialManagerStatics> : produce_base { int32_t __stdcall IsSupportedAsync(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>( this->shim().IsSupportedAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RenewAttestationAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from( this->shim().RenewAttestationAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RequestCreateAsync(void* name, int32_t option, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>( this->shim().RequestCreateAsync( *reinterpret_cast(&name), *reinterpret_cast( &option))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall OpenAsync(void* name, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>( this->shim().OpenAsync(*reinterpret_cast(&name))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall DeleteAsync(void* name, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from( this->shim().DeleteAsync(*reinterpret_cast(&name))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce< D, winrt::Windows::Security::Credentials::IKeyCredentialManagerStatics2> : produce_base { int32_t __stdcall RequestCreateAsync( void* name, int32_t option, void* algorithm, void* message, void* cacheConfiguration, struct struct_Windows_UI_WindowId windowId, int32_t callbackType, void* attestationCallback, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().RequestCreateAsync( *reinterpret_cast(&name), *reinterpret_cast( &option), *reinterpret_cast(&algorithm), *reinterpret_cast(&message), *reinterpret_cast( &cacheConfiguration), *reinterpret_cast( &windowId), *reinterpret_cast( &callbackType), *reinterpret_cast( &attestationCallback))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall OpenAsync(void* name, int32_t callbackType, void* attestationCallback, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().OpenAsync( *reinterpret_cast(&name), *reinterpret_cast( &callbackType), *reinterpret_cast( &attestationCallback))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce< D, winrt::Windows::Security::Credentials::IKeyCredentialOperationResult> : produce_base { int32_t __stdcall get_Result(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from( this->shim().Result()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Status(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from< winrt::Windows::Security::Credentials::KeyCredentialStatus>( this->shim().Status()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Credential(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Credential()); return 0; } catch (...) { return to_hresult(); } 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(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Resource(void** resource) noexcept final try { clear_abi(resource); typename D::abi_guard guard(this->shim()); *resource = detach_from(this->shim().Resource()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Resource(void* resource) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Resource(*reinterpret_cast(&resource)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_UserName(void** userName) noexcept final try { clear_abi(userName); typename D::abi_guard guard(this->shim()); *userName = detach_from(this->shim().UserName()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_UserName(void* userName) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().UserName(*reinterpret_cast(&userName)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Password(void** password) noexcept final try { clear_abi(password); typename D::abi_guard guard(this->shim()); *password = detach_from(this->shim().Password()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Password(void* password) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Password(*reinterpret_cast(&password)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RetrievePassword() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RetrievePassword(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Properties(void** props) noexcept final try { clear_abi(props); typename D::abi_guard guard(this->shim()); *props = detach_from(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall Add(void* credential) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Add(*reinterpret_cast(&credential)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Remove(void* credential) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Remove(*reinterpret_cast(&credential)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Retrieve(void* resource, void* userName, void** credential) noexcept final try { clear_abi(credential); typename D::abi_guard guard(this->shim()); *credential = detach_from(this->shim().Retrieve(*reinterpret_cast(&resource), *reinterpret_cast(&userName))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FindAllByResource(void* resource, void** credentials) noexcept final try { clear_abi(credentials); typename D::abi_guard guard(this->shim()); *credentials = detach_from>(this->shim().FindAllByResource(*reinterpret_cast(&resource))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FindAllByUserName(void* userName, void** credentials) noexcept final try { clear_abi(credentials); typename D::abi_guard guard(this->shim()); *credentials = detach_from>(this->shim().FindAllByUserName(*reinterpret_cast(&userName))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RetrieveAll(void** credentials) noexcept final try { clear_abi(credentials); typename D::abi_guard guard(this->shim()); *credentials = detach_from>(this->shim().RetrieveAll()); return 0; } catch (...) { return to_hresult(); } }; #endif template struct produce : produce_base { int32_t __stdcall get_WebAccountProvider(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().WebAccountProvider()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_UserName(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UserName()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_State(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().State()); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Id(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Id()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Properties(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetPictureAsync(int32_t desizedSize, void** asyncInfo) noexcept final try { clear_abi(asyncInfo); typename D::abi_guard guard(this->shim()); *asyncInfo = detach_from>(this->shim().GetPictureAsync(*reinterpret_cast(&desizedSize))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SignOutAsync(void** asyncInfo) noexcept final try { clear_abi(asyncInfo); typename D::abi_guard guard(this->shim()); *asyncInfo = detach_from(this->shim().SignOutAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SignOutWithClientIdAsync(void* clientId, void** asyncInfo) noexcept final try { clear_abi(asyncInfo); typename D::abi_guard guard(this->shim()); *asyncInfo = detach_from(this->shim().SignOutAsync(*reinterpret_cast(&clientId))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateWebAccount(void* webAccountProvider, void* userName, int32_t state, void** instance) noexcept final try { clear_abi(instance); typename D::abi_guard guard(this->shim()); *instance = detach_from(this->shim().CreateWebAccount(*reinterpret_cast(&webAccountProvider), *reinterpret_cast(&userName), *reinterpret_cast(&state))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Id(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Id()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DisplayName(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DisplayName()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IconUri(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IconUri()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_DisplayPurpose(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DisplayPurpose()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Authority(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Authority()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_User(void** user) noexcept final try { clear_abi(user); typename D::abi_guard guard(this->shim()); *user = detach_from(this->shim().User()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_IsSystemProvider(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsSystemProvider()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateWebAccountProvider(void* id, void* displayName, void* iconUri, void** instance) noexcept final try { clear_abi(instance); typename D::abi_guard guard(this->shim()); *instance = detach_from(this->shim().CreateWebAccountProvider(*reinterpret_cast(&id), *reinterpret_cast(&displayName), *reinterpret_cast(&iconUri))); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Security::Credentials { inline KeyCredentialCacheConfiguration::KeyCredentialCacheConfiguration( winrt::Windows::Security::Credentials::KeyCredentialCacheOption const& cacheOption, winrt::Windows::Foundation::TimeSpan const& timeout, uint32_t usageCount) : KeyCredentialCacheConfiguration( impl::call_factory( [&](IKeyCredentialCacheConfigurationFactory const& f) { return f.CreateInstance(cacheOption, timeout, usageCount); })) {} inline auto KeyCredentialManager::IsSupportedAsync() { return impl::call_factory_cast< winrt::Windows::Foundation::IAsyncOperation (*)( IKeyCredentialManagerStatics const&), KeyCredentialManager, IKeyCredentialManagerStatics>( [](IKeyCredentialManagerStatics const& f) { return f.IsSupportedAsync(); }); } inline auto KeyCredentialManager::RenewAttestationAsync() { return impl::call_factory_cast([](IKeyCredentialManagerStatics const& f) { return f.RenewAttestationAsync(); }); } inline auto KeyCredentialManager::RequestCreateAsync(param::hstring const& name, winrt::Windows::Security::Credentials::KeyCredentialCreationOption const& option) { return impl::call_factory([&](IKeyCredentialManagerStatics const& f) { return f.RequestCreateAsync(name, option); }); } inline auto KeyCredentialManager::OpenAsync(param::hstring const& name) { return impl::call_factory([&](IKeyCredentialManagerStatics const& f) { return f.OpenAsync(name); }); } inline auto KeyCredentialManager::DeleteAsync(param::hstring const& name) { return impl::call_factory([&](IKeyCredentialManagerStatics const& f) { return f.DeleteAsync(name); }); } inline auto KeyCredentialManager::RequestCreateAsync( param::hstring const& name, winrt::Windows::Security::Credentials:: KeyCredentialCreationOption const& option, param::hstring const& algorithm, param::hstring const& message, winrt::Windows::Security::Credentials:: KeyCredentialCacheConfiguration const& cacheConfiguration, winrt::Windows::UI::WindowId const& windowId, winrt::Windows::Security::Credentials::ChallengeResponseKind const& callbackType, winrt::Windows::Security::Credentials:: AttestationChallengeHandler const& attestationCallback) { return impl::call_factory( [&](IKeyCredentialManagerStatics2 const& f) { return f.RequestCreateAsync(name, option, algorithm, message, cacheConfiguration, windowId, callbackType, attestationCallback); }); } inline auto KeyCredentialManager::OpenAsync( param::hstring const& name, winrt::Windows::Security::Credentials::ChallengeResponseKind const& callbackType, winrt::Windows::Security::Credentials:: AttestationChallengeHandler const& attestationCallback) { return impl::call_factory( [&](IKeyCredentialManagerStatics2 const& f) { return f.OpenAsync(name, callbackType, attestationCallback); }); } inline PasswordCredential::PasswordCredential() : PasswordCredential(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline PasswordCredential::PasswordCredential(param::hstring const& resource, param::hstring const& userName, param::hstring const& password) : PasswordCredential(impl::call_factory([&](ICredentialFactory const& f) { return f.CreatePasswordCredential(resource, userName, password); })) { } inline PasswordCredentialPropertyStore::PasswordCredentialPropertyStore() : PasswordCredentialPropertyStore(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline PasswordVault::PasswordVault() : PasswordVault(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline WebAccount::WebAccount(winrt::Windows::Security::Credentials::WebAccountProvider const& webAccountProvider, param::hstring const& userName, winrt::Windows::Security::Credentials::WebAccountState const& state) : WebAccount(impl::call_factory([&](IWebAccountFactory const& f) { return f.CreateWebAccount(webAccountProvider, userName, state); })) { } inline WebAccountProvider::WebAccountProvider(param::hstring const& id, param::hstring const& displayName, winrt::Windows::Foundation::Uri const& iconUri) : WebAccountProvider(impl::call_factory([&](IWebAccountProviderFactory const& f) { return f.CreateWebAccountProvider(id, displayName, iconUri); })) { } template AttestationChallengeHandler::AttestationChallengeHandler(L handler) : AttestationChallengeHandler( impl::make_delegate( std::forward(handler))) {} template AttestationChallengeHandler::AttestationChallengeHandler(F * handler) : AttestationChallengeHandler( [=](auto&&... args) { return handler(args...); }) {} template AttestationChallengeHandler::AttestationChallengeHandler(O * object, M method) : AttestationChallengeHandler( [=](auto&&... args) { return ((*object).*(method))(args...); }) {} template AttestationChallengeHandler::AttestationChallengeHandler( com_ptr && object, M method) : AttestationChallengeHandler( [o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) {} template AttestationChallengeHandler::AttestationChallengeHandler( weak_ref && object, LM && lambda_or_method) : AttestationChallengeHandler( [o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) {} template AttestationChallengeHandler::AttestationChallengeHandler( std::shared_ptr && object, M method) : AttestationChallengeHandler( [o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) {} template AttestationChallengeHandler::AttestationChallengeHandler( std::weak_ptr && object, LM && lambda_or_method) : AttestationChallengeHandler( [o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) {} inline auto AttestationChallengeHandler::operator()( winrt::Windows::Storage::Streams::IBuffer const& challenge) const { void* result{}; check_hresult((*(impl::abi_t**)this) ->Invoke(*(void**)(&challenge), &result)); return winrt::Windows::Storage::Streams::IBuffer{result, take_ownership_from_abi}; } } 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::Windows::Security::Credentials::IKeyCredentialCacheConfiguration> : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template <> struct hash< winrt::Windows::Security::Credentials::IKeyCredentialManagerStatics2> : 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 {}; 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::Windows::Security::Credentials::KeyCredentialCacheConfiguration> : 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