| 13 | namespace Win32 { |
| 14 | |
| 15 | std::wstring RegGetStringValue(HKEY hKey, const wchar_t* valueName) |
| 16 | { |
| 17 | long length = 0; |
| 18 | long rc = ::RegQueryValue(hKey, valueName, nullptr, &length); |
| 19 | if (rc != ERROR_SUCCESS) |
| 20 | ThrowWin32Error(rc, "RegQueryValue"); |
| 21 | |
| 22 | std::vector<wchar_t> data(length); |
| 23 | rc = ::RegQueryValue(hKey, valueName, data.data(), &length); |
| 24 | if (rc != ERROR_SUCCESS) |
| 25 | ThrowWin32Error(rc, "RegQueryValue"); |
| 26 | return data.data(); |
| 27 | } |
| 28 | |
| 29 | std::wstring RegGetStringValue(HKEY hKey, const wchar_t* valueName, const wchar_t* defaultValue) |
| 30 | { |
no test coverage detected