Share via


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 HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS).

HRESULT EnumData(
      METADATA_HANDLE hMDHandle,
      LPCWSTR pszMDPath,
      PMETADATA_RECORD pmdrMDData,
      DWORD dwMDEnumDataIndex,
      DWORD* pdwMDRequiredDataLen
);

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 HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS) is returned.

  • pdwMDRequiredDataLen
    Points to a DWORD that receives the required buffer size if the method returns HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER).

Return Values

Returns an HRESULT that contains one of the following values:

Value

Description

E_ACCESSDENIED

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.

HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)

The buffer passed into the method call is too small to receive the data.

E_INVALIDARG

The parameter is incorrect.

HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS)

There are no more entries to enumerate.

HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND)

The specified path is not found in the metabase.

S_OK

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.

Requirements

Client: Requires Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.

Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.

Product: IIS

Header: Declared in iadmw.h; include iiscnfg.h.