Returns a list of subkeys of this registry key. @param p_rvSubkeys Where to store information about the subkeys.
| 187 | // @param p_rvSubkeys Where to store information about the subkeys. |
| 188 | // |
| 189 | void AtlRegKey::GetSubKeys(SubkeyInfoV& p_rvSubkeys) const |
| 190 | { |
| 191 | // Scan subkeys, starting with the first one. |
| 192 | std::wstring subkeyName(256, L'\0'); // See MSDN's RegEnumKeyEx. |
| 193 | LONG res = ERROR_SUCCESS; |
| 194 | for (DWORD index = 0; res == ERROR_SUCCESS; ++index) { |
| 195 | DWORD subkeyNameSize = gsl::narrow<DWORD>(subkeyName.size()); |
| 196 | res = m_Key.EnumKey(index, &*subkeyName.begin(), &subkeyNameSize); |
| 197 | if (res == ERROR_SUCCESS) { |
| 198 | p_rvSubkeys.emplace_back(m_Key.m_hKey, subkeyName.c_str()); |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | // |
| 204 | // Tries to save a DWORD value in the registry key. |
no test coverage detected