IMSAdminBase::EnumData

The IMSAdminBase::EnumData method enumerates the data entries of a key in the metabase. One entry is enumerated per call. Set dwMDEnumDataIndex to 0 on the first call and increment by 1 on each subsequent call until the method returns ERROR_NO_MORE_ITEMS.

HRESULT EnumData(

  METADATA_HANDLE hMDHandle,  //metadata handle.

  LPCWSTR pszMDPath,    //path to a key relative to hMDHandle.

  PMETADATA_RECORD pmdrMDData,  //pointer to a structure that receives the data.

  DWORD dwMDEnumDataIndex,  //index of the current data entry.

  DWORD *pdwMDRequiredDataLen //receives the required buffer size for the data.

);

 

Parameters
hMDHandle
Specifies the handle to a key in the metabase. The handle can be METADATA_MASTER_ROOT_HANDLE or a handle, with read permission, returned by the IMSAdminBase::OpenKey method.
pszMDPath
Specifies the path of the key to be enumerated, relative to the path of hMDHandle. For example, if the handle references the /LM key, you could specify the Web services subkey using the path /W3SVC.
pmdrMDData
Points to a METADATA_RECORD structure that specifies the data to retrieve and receives the data.
dwMDEnumDataIndex
Specifies the index of the entry retrieved. Set this to 0 before the first call and increment it by 1 on each successive call until ERROR_NO_MORE_ITEMS is returned.
pdwMDRequiredDataLen
Points to a DWORD that receives the required buffer size if the method returns ERROR_INSUFFICIENT_BUFFER.
Return Values

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_INSUFFICIENT_BUFFER The buffer passed into the method call is too small to receive the data.
ERROR_INVALID_PARAMETER The parameter is incorrect.
ERROR_NO_MORE_ITEMS There are no more entries to enumerate.
ERROR_PATH_NOT_FOUND The specified path is not found in the metabase.
ERROR_SUCCESS The method succeeded.

Remarks

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.