Compartilhar via


IMSAdminBase::RenameKey

The IMSAdminBase::RenameKey method renames a key in the metabase.

HRESULT RenameKey(
      METADATA_HANDLE hMDHandle,
      LPCWSTR pszMDPath,
      LPCWSTR pszMDNewName
);

Parameters

  • hMDHandle
    Specifies a handle to a metabase key. This is a handle with write permissions returned by the IMSAdminBase::OpenKey method.

  • pszMDPath
    Points to a string that contains the path of the key, relative to the path of hMDHandle. For example, if the handle references the /LM key, you could specify the virtual directory, VDir1, on the third Web server by using the path /W3SVC/3/ROOT/VDir1. This parameter must not be NULL or an empty string.

  • pszMDNewName
    Points to a string that contains the new name for the key. This parameter must not be NULL or an empty string. Also, it must not contain / or \.

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_ALREADY_EXISTS)

A key of that name already exists in the metabase.

E_INVALIDARG

The parameter is incorrect.

HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY)

Not enough memory is available to process this command.

HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND)

The specified path was not found in the metabase.

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.