The IMSAdminBase::EnumKeys method enumerates the subkeys of the specified key. A subkey can be enumerated once per call. Subkeys are numbered from 0 to (NumKeys - 1), with NumKeys equal to the number of subkeys below the key.
If dwMDEnumKeyIndex is greater than or equal to the number of subkeys, ERROR_NO_MORE_ITEMS is returned.
HRESULT EnumKeys(
METADATA_HANDLE hMDHandle, //metabase handle.
LPCWSTR pszMDPath, //path to the key.
LPWSTR pszMDName, //receives the name of the subkey.
DWORD dwMDEnumKeyIndex //index of the subkey.
);
Returns an HRESULT that contains one of the following values:
Value | Description |
ERROR_ACCESS_DENIED | Access is denied. Either the open handle does not have read or write permission as needed, or the user does not have sufficient permissions to perform the operation. |
ERROR_INVALID_PARAMETER | The parameter is incorrect. |
ERROR_NO_MORE_ITEMS | There are no more subkeys to enumerate. |
ERROR_PATH_NOT_FOUND | The specified path was not found in the metabase. |
ERROR_SUCCESS | The method succeeded. |
The handle, METADATA_MASTER_ROOT_HANDLE, provides no guarantee against multiple thread access. If your application requires a constant data state, use a handle returned by IMSAdminBase::OpenKey.