retCode = RegQueryInfoKey(hKey, achClass, &cchClassName, NULL, &cSubKeys, NULL, NULL, &cValues, NULL, NULL,
#define REGISTRY_DISCOVERY_MODE_KEYS 0
#define REGISTRY_DISCOVERY_MODE_VALUES 1
static HKEY get_hkey_from_fullkey(char *fullkey)
if (0 == strcmp("HKEY_CLASSES_ROOT", fullkey) || 0 == strcmp("HKCR", fullkey))
return HKEY_CLASSES_ROOT;
else if (0 == strcmp("HKEY_CURRENT_CONFIG", fullkey) || 0 == strcmp("HKCC", fullkey))
return HKEY_CURRENT_CONFIG;
else if (0 == strcmp("HKEY_CURRENT_USER", fullkey) || 0 == strcmp("HKCU", fullkey))
return HKEY_CURRENT_USER;
else if (0 == strcmp("HKEY_CURRENT_USER_LOCAL_SETTINGS", fullkey) || 0 == strcmp("HKCULS", fullkey))
return HKEY_CURRENT_USER_LOCAL_SETTINGS;
else if (0 == strcmp("HKEY_LOCAL_MACHINE", fullkey) || 0 == strcmp("HKLM", fullkey))
return HKEY_LOCAL_MACHINE;
else if (0 == strcmp("HKEY_PERFORMANCE_DATA", fullkey) || 0 == strcmp("HKPD", fullkey))
return HKEY_PERFORMANCE_DATA;
else if (0 == strcmp("HKEY_PERFORMANCE_NLSTEXT", fullkey) || 0 == strcmp("HKPN", fullkey))
return HKEY_PERFORMANCE_NLSTEXT;
else if (0 == strcmp("HKEY_PERFORMANCE_TEXT", fullkey) || 0 == strcmp("HKPT", fullkey))
return HKEY_PERFORMANCE_TEXT;
else if (0 == strcmp("HKEY_USERS", fullkey) || 0 == strcmp("HKU", fullkey))
static const char *registry_type_to_string(DWORD type)