// WARNING: Please don't edit this file. It was generated by C++/WinRT // v2.0.250303.1 #pragma once #ifndef WINRT_Microsoft_Windows_System_H #define WINRT_Microsoft_Windows_System_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/Microsoft.Windows.System.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_System_IEnvironmentManager< D>::GetEnvironmentVariables() const { void* result{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::System::IEnvironmentManager>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::IEnvironmentManager, 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->GetEnvironmentVariables(&result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetEnvironmentVariables(&result)); } return winrt::Windows::Foundation::Collections::IMapView{ result, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_System_IEnvironmentManager< D>::GetEnvironmentVariable(param::hstring const& name) const { void* result{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::System::IEnvironmentManager>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::IEnvironmentManager, 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->GetEnvironmentVariable(*(void**)(&name), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->GetEnvironmentVariable(*(void**)(&name), &result)); } return hstring{result, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_System_IEnvironmentManager< D>::SetEnvironmentVariable(param::hstring const& name, param::hstring const& value) const { if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::System::IEnvironmentManager>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::IEnvironmentManager, 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->SetEnvironmentVariable(*(void**)(&name), *(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SetEnvironmentVariable(*(void**)(&name), *(void**)(&value))); } } template auto consume_Microsoft_Windows_System_IEnvironmentManager::AppendToPath( param::hstring const& path) const { if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::System::IEnvironmentManager>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::IEnvironmentManager, 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->AppendToPath(*(void**)(&path))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->AppendToPath(*(void**)(&path))); } } template auto consume_Microsoft_Windows_System_IEnvironmentManager::RemoveFromPath( param::hstring const& path) const { if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::System::IEnvironmentManager>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::IEnvironmentManager, 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->RemoveFromPath(*(void**)(&path))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RemoveFromPath(*(void**)(&path))); } } template auto consume_Microsoft_Windows_System_IEnvironmentManager< D>::AddExecutableFileExtension(param::hstring const& pathExt) const { if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::System::IEnvironmentManager>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::IEnvironmentManager, 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->AddExecutableFileExtension(*(void**)(&pathExt))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->AddExecutableFileExtension(*(void**)(&pathExt))); } } template auto consume_Microsoft_Windows_System_IEnvironmentManager< D>::RemoveExecutableFileExtension(param::hstring const& pathExt) const { if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::System::IEnvironmentManager>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::IEnvironmentManager, 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->RemoveExecutableFileExtension(*(void**)(&pathExt))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->RemoveExecutableFileExtension(*(void**)(&pathExt))); } } template auto consume_Microsoft_Windows_System_IEnvironmentManager2< D>::AreChangesTracked() const { bool value{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::System::IEnvironmentManager2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::IEnvironmentManager2, 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->get_AreChangesTracked(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_AreChangesTracked(&value)); } return value; } template auto consume_Microsoft_Windows_System_IEnvironmentManagerStatics< D>::GetForProcess() 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::Microsoft::Windows::System::IEnvironmentManagerStatics, 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->GetForProcess(&result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetForProcess(&result)); } return winrt::Microsoft::Windows::System::EnvironmentManager{ result, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_System_IEnvironmentManagerStatics< D>::GetForUser() 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::Microsoft::Windows::System::IEnvironmentManagerStatics, 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->GetForUser(&result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetForUser(&result)); } return winrt::Microsoft::Windows::System::EnvironmentManager{ result, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_System_IEnvironmentManagerStatics< D>::GetForMachine() 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::Microsoft::Windows::System::IEnvironmentManagerStatics, 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->GetForMachine(&result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetForMachine(&result)); } return winrt::Microsoft::Windows::System::EnvironmentManager{ result, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_System_IEnvironmentManagerStatics< D>::IsSupported() 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< winrt::Microsoft::Windows::System::IEnvironmentManagerStatics, 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->get_IsSupported(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IsSupported(&value)); } return value; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetEnvironmentVariables(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from< winrt::Windows::Foundation::Collections::IMapView>( this->shim().GetEnvironmentVariables()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetEnvironmentVariable(void* name, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetEnvironmentVariable( *reinterpret_cast(&name))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetEnvironmentVariable(void* name, void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetEnvironmentVariable( *reinterpret_cast(&name), *reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall AppendToPath(void* path) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AppendToPath(*reinterpret_cast(&path)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RemoveFromPath(void* path) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RemoveFromPath(*reinterpret_cast(&path)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall AddExecutableFileExtension(void* pathExt) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AddExecutableFileExtension( *reinterpret_cast(&pathExt)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RemoveExecutableFileExtension(void* pathExt) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RemoveExecutableFileExtension( *reinterpret_cast(&pathExt)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_AreChangesTracked(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().AreChangesTracked()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base< D, winrt::Microsoft::Windows::System::IEnvironmentManagerStatics> { int32_t __stdcall GetForProcess(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from( this->shim().GetForProcess()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetForUser(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from( this->shim().GetForUser()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetForMachine(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from( this->shim().GetForMachine()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsSupported(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsSupported()); return 0; } catch (...) { return to_hresult(); } }; #endif } // namespace winrt::impl WINRT_EXPORT namespace winrt::Microsoft::Windows::System { inline auto EnvironmentManager::GetForProcess() { return impl::call_factory_cast< winrt::Microsoft::Windows::System::EnvironmentManager (*)( IEnvironmentManagerStatics const&), EnvironmentManager, IEnvironmentManagerStatics>( [](IEnvironmentManagerStatics const& f) { return f.GetForProcess(); }); } inline auto EnvironmentManager::GetForUser() { return impl::call_factory_cast< winrt::Microsoft::Windows::System::EnvironmentManager (*)( IEnvironmentManagerStatics const&), EnvironmentManager, IEnvironmentManagerStatics>( [](IEnvironmentManagerStatics const& f) { return f.GetForUser(); }); } inline auto EnvironmentManager::GetForMachine() { return impl::call_factory_cast< winrt::Microsoft::Windows::System::EnvironmentManager (*)( IEnvironmentManagerStatics const&), EnvironmentManager, IEnvironmentManagerStatics>( [](IEnvironmentManagerStatics const& f) { return f.GetForMachine(); }); } inline auto EnvironmentManager::IsSupported() { return impl::call_factory_cast( [](IEnvironmentManagerStatics const& f) { return f.IsSupported(); }); } } 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 {}; #endif #ifdef __cpp_lib_format #endif } // namespace std #endif