// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #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.240405.15"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.240405.15" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Microsoft.Windows.System.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_System_IEnvironmentManager::GetEnvironmentVariables() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::IEnvironmentManager)->GetEnvironmentVariables(&result)); return winrt::Windows::Foundation::Collections::IMapView{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_System_IEnvironmentManager::GetEnvironmentVariable(param::hstring const& name) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::IEnvironmentManager)->GetEnvironmentVariable(*(void**)(&name), &result)); return hstring{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_System_IEnvironmentManager::SetEnvironmentVariable(param::hstring const& name, param::hstring const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::IEnvironmentManager)->SetEnvironmentVariable(*(void**)(&name), *(void**)(&value))); } template auto consume_Microsoft_Windows_System_IEnvironmentManager::AppendToPath(param::hstring const& path) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::IEnvironmentManager)->AppendToPath(*(void**)(&path))); } template auto consume_Microsoft_Windows_System_IEnvironmentManager::RemoveFromPath(param::hstring const& path) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::IEnvironmentManager)->RemoveFromPath(*(void**)(&path))); } template auto consume_Microsoft_Windows_System_IEnvironmentManager::AddExecutableFileExtension(param::hstring const& pathExt) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::IEnvironmentManager)->AddExecutableFileExtension(*(void**)(&pathExt))); } template auto consume_Microsoft_Windows_System_IEnvironmentManager::RemoveExecutableFileExtension(param::hstring const& pathExt) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::IEnvironmentManager)->RemoveExecutableFileExtension(*(void**)(&pathExt))); } template auto consume_Microsoft_Windows_System_IEnvironmentManager2::AreChangesTracked() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::IEnvironmentManager2)->get_AreChangesTracked(&value)); return value; } template auto consume_Microsoft_Windows_System_IEnvironmentManagerStatics::GetForProcess() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::IEnvironmentManagerStatics)->GetForProcess(&result)); return winrt::Microsoft::Windows::System::EnvironmentManager{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_System_IEnvironmentManagerStatics::GetForUser() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::IEnvironmentManagerStatics)->GetForUser(&result)); return winrt::Microsoft::Windows::System::EnvironmentManager{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_System_IEnvironmentManagerStatics::GetForMachine() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::IEnvironmentManagerStatics)->GetForMachine(&result)); return winrt::Microsoft::Windows::System::EnvironmentManager{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_System_IEnvironmentManagerStatics::IsSupported() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::IEnvironmentManagerStatics)->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>(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 { 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 } WINRT_EXPORT namespace winrt::Microsoft::Windows::System { inline auto EnvironmentManager::GetForProcess() { return impl::call_factory_cast([](IEnvironmentManagerStatics const& f) { return f.GetForProcess(); }); } inline auto EnvironmentManager::GetForUser() { return impl::call_factory_cast([](IEnvironmentManagerStatics const& f) { return f.GetForUser(); }); } inline auto EnvironmentManager::GetForMachine() { return impl::call_factory_cast([](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 } #endif