| 87 | } |
| 88 | |
| 89 | bool RegistryConfig::TryGetString(const std::wstring& valueName, std::wstring& value) const |
| 90 | { |
| 91 | auto key = OpenKey(true); |
| 92 | if (!key) return false; |
| 93 | |
| 94 | wil::unique_cotaskmem_string result; |
| 95 | if (SUCCEEDED(wil::reg::get_value_string_nothrow(key.get(), valueName.c_str(), result))) |
| 96 | { |
| 97 | value = result.get(); |
| 98 | return true; |
| 99 | } |
| 100 | return false; |
| 101 | } |
| 102 | |
| 103 | void RegistryConfig::DeleteValue(const std::wstring& valueName) |
| 104 | { |