The IMSAdminBase::CopyKey method copies or moves a key, including its subkeys and data, to a specified destination. The copied or moved key becomes a subkey of the destination key.
Specifies the handle of the key to be copied or moved. If the key is to be copied ( bMDCopyFlag is set to TRUE) hMDSourceHandle must have read permissions. If the key is to be moved ( bMDCopyFlag is set to FALSE), hMDSourceHandle must have read/write permissions.
Points to a string that contains the path of the key to be copied or moved relative to the path of hMDSourceHandle. For example, if the handle references the /LM key, you could specify the Web services subkey using the path /W3SVC.
Specifies a handle with write permissions that specifies the destination of the moved or copied key.
Points to a string that contains the path of the new or moved key, relative to hMDDestHandle.
Determines the behavior if the destination key already exists. If set to TRUE, the existing key and all of its data and children are deleted prior to copying or moving the source. If FALSE, the existing key, data, and children remain, and the source is merged with that data. In cases of data conflicts, the source data overwrites the destination data.
Specifies whether to copy or move the specified key. If bMDCopyFlag is TRUE, the key is copied. If bMDCopyFlag is FALSE, the key is moved, and the source key is deleted from its original location.
Returns an HRESULT that contains one of the following values:
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.
The parameter is incorrect.
The specified path was not found in the metabase.
The method succeeded.
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.
Header: Declared in iadmw.h; include iiscnfg.h.