MCPcopy Create free account
hub / github.com/clechasseur/pathcopycopy / GetSubKeys

Method GetSubKeys

PathCopyCopy/src/AtlRegKey.cpp:189–201  ·  view source on GitHub ↗

Returns a list of subkeys of this registry key. @param p_rvSubkeys Where to store information about the subkeys.

Source from the content-addressed store, hash-verified

187// @param p_rvSubkeys Where to store information about the subkeys.
188//
189void 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.

Calls 2

sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected