| 822 | } |
| 823 | |
| 824 | bool keyHasValues(HKEY key) |
| 825 | { |
| 826 | auto name = std::make_unique<wchar_t[]>(1000 + 1); |
| 827 | DWORD nameSize = 1000; |
| 828 | |
| 829 | // note that RegEnumValueW() also enumerates the default value if it exists |
| 830 | auto r = ::RegEnumValueW(key, 0, name.get(), &nameSize, nullptr, nullptr, nullptr, |
| 831 | nullptr); |
| 832 | |
| 833 | if (r != ERROR_NO_MORE_ITEMS) { |
| 834 | return true; |
| 835 | } |
| 836 | |
| 837 | // no values, no default, it's empty |
| 838 | return false; |
| 839 | } |
| 840 | |
| 841 | bool forEachSubKey(HKEY key, std::function<bool(const wchar_t* name)> f) |
| 842 | { |