static bool EnumerateRegistryKeys()

in Source/RiderSourceCodeAccess/Private/RiderPathLocator/Win/RiderPathLocatorWin.cpp [54:75]


static bool EnumerateRegistryKeys(HKEY Key, TArray<FString> &OutNames)
{
	for (DWORD Index = 0;; Index++)
	{
		TCHAR KeyName[256];
		DWORD KeyNameLength = sizeof(KeyName) / sizeof(KeyName[0]);

		const LONG Result = RegEnumKeyEx(Key, Index, KeyName, &KeyNameLength, nullptr, nullptr, nullptr, nullptr);
		if (Result == ERROR_NO_MORE_ITEMS)
		{
			break;
		}

		if (Result != ERROR_SUCCESS)
		{
			return false;
		}

		OutNames.Add(KeyName);
	}
	return true;
}