Partager via


Enumerating Keys and Data Using ABO

Enumerate metabase keys and data to obtain a list of all properties set at a metabase node, all virtual directories on a server, or other lists of useful information.

Using EnumKeys and EnumData

Use the EnumKeys method to enumerate the subkeys of a key. The name of one subkey is returned per enumeration call. HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS) is returned after the last subkey has been enumerated. To get a total count of the subkeys associated with a key, increment the index parameter of the method.

Alternatively, use the EnumData method to enumerate the data elements of a key. One data item is enumerated per call, but unlike enumerating keys, the EnumData method returns the data as well as the data identifier, so a METADATA_RECORD structure must be passed to receive the data. HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS) is returned after the last data item has been enumerated. To get a total count of the data items associated with a key, you must increment the index parameter of the method.

Note

The EnumKeys and EnumData methods are very inefficient compared to GetAllData and GetChildPaths, though they make enumeration slightly easier. For high-performance applications, use GetAllData and GetChildPaths.