共用方式為


IMSAdminBase::GetData

The IMSAdminBase::GetData method retrieves an entry from the metabase.

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

Parameters

  • hMDHandle
    Specifies a handle to the metabase. This can be either METADATA_MASTER_ROOT_HANDLE or a handle returned by the IMSAdminBase::OpenKey method with read permission.

  • pszMDPath
    Specifies the path of the key that contains the data. This path is 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 retrieved data.

  • pdwMDRequiredDataLen
    Receives the data length of the required buffer size if the buffer size specified by pmdrMDData-> dwMDDataLen is not large enough to hold the data returned ( HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) is returned).

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 to the method call is too small to receive the data.

E_INVALIDARG

The parameter is incorrect.

HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND)

The specified path is not found in the metabase.

S_OK

The method succeeded.

MD_ERROR_DATA_NOT_FOUND

The specified data is not found in the metabase.

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.