次の方法で共有


IMSAdminBase::GetDataPaths

The IMSAdminBase::GetDataPaths determines which keys in the metabase contain a specified data identifier. This method retrieves the paths of all keys in the subtree relative to a specified starting key that actually contains the identifier. You can use this method to determine the scope of inherited data values, because only keys that contain the identifier itself are returned. Paths to keys that contain only inherited data for the specified identifier will not be returned.

HRESULT GetDataPaths(
      METADATA_HANDLE hMDHandle,
      LPCWSTR pszMDPath,
      DWORD dwMDIdentifier,
      DWORD dwMDDataType,
      DWORD dwMDBufferSize,
      LPWSTR pszBuffer,
      DWORD* pdwMDRequiredBufferSize
);

Parameters

  • hMDHandle
    Specifies a handle to the metabase. This can either be METADATA_MASTER_ROOT_HANDLE or a handle returned by a previous call to IMSAdminBase::OpenKey.

  • pszMDPath
    Points to a string that contains the path of the key to be opened, relative to hMDHandle. For example, if the handle references the /LM key, you could specify the Web services subkey using the path /W3SVC.

  • dwMDIdentifier
    Specifies the identifier of the data, such as MD_ACCESS_PERM.

  • dwMDDataType
    A DWORD that specifies the type of data to be located. This parameter can be one of the following values:

    Data type

    Meaning

    ALL_METADATA

    Copy or move all data, regardless of type.

    BINARY_METADATA

    Binary data in any form.

    DWORD_METADATA

    An unsigned 32-bit number.

    EXPANDSZ_METADATA

    A null-terminated string that contains unexpanded environment variables, such as %PATH%.

    MULTISZ_METADATA

    An array of null-terminated strings, terminated by two null characters.

    STRING_METADATA

    A null-terminated ASCII string.

  • dwMDBufferSize
    Specifies the size, in wchars, of the buffer.

  • pszBuffer
    Points to a buffer that receives the data. If the method call is successful, the buffer will contain a double-null terminated multsz of all paths in the subtree that contain the specified identifier. The returned paths are relative to the handle specified. If the identifier exists on the key designated by the handle and path specified, this path will be the first entry in the list.

  • pdwMDRequiredBufferSize
    Points to a DWORD that contains the buffer length required, in wchars. This parameter is used only 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_INVALIDARG

The parameter is incorrect.

HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY)

There is not enough memory to complete the operation.

HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND)

The specified path is not found.

S_OK

The method succeeded.

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.