IMSAdminBase::DeleteChildKeys

The IMSAdminBase::DeleteChildKeys deletes all subkeys of the specified key and any data they contain. It also recursively deletes all keys below the subkeys.

HRESULT DeleteChildKeys(

  METADATA_HANDLE hMDHandle,  //metabase handle.

  LPCWSTR pszMDPath     //path to the key.

);

 

Parameters
hMDHandle
Specifies a handle with write permissions, as returned by the IMSAdminBase::OpenKey method. METADATA_MASTER_ROOT_HANDLE is not valid for this operation.
pszMDPath
Points to a string that contains the path of the key whose subkeys are to be deleted, relative to the path of hMDHandle. For example, if the handle references the /LM key, you could use the path /W3SVC to specify the Web services subkey. In this case, all subkeys below /LM/W3SVC would be deleted.
Return Values

Returns an HRESULT that contains one of the following values:

Value Description
ERROR_ACCESS_DENIED 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.
ERROR_PATH_NOT_FOUND The specified path is not found in the metabase.
ERROR_SUCCESS The method succeeded.