IMSAdminBase::DeleteData

The IMSAdminBase::DeleteData method deletes a data from a key in the metabase.

HRESULT DeleteData(

  METADATA_HANDLE hMDHandle,  //metadata handle.

  LPCWSTR pszMDPath,    //path to the key relative to hMDHandle.

  DWORD dwMDIdentifier,   //identifier of the data.

  DWORD dwMDDataType    //type of data to remove.

);

 

Parameters
hMDHandle
Specifies a handle returned by the IMSAdminBase::OpenKey method with write permission. This parameter cannot be set to METADATA_MASTER_ROOT_HANDLE.
pszMDPath
Specifies the path of the key to have its data deleted, relative to the path of the handle. 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_CONNECTION_TIMEOUT.
dwMDDataType
Specifies a data type. If this parameter is not set to ALL_METADATA, the data item will be removed only if its data type matches the specified type. This parameter can be one of the following values:
Data type Description
ALL_METADATA Specifies 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.

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_INVALID_PARAMETER The parameter is incorrect.
ERROR_PATH_NOT_FOUND The specified path was not found in the metabase.
ERROR_SUCCESS The method succeeded.
MD_ERROR_DATA_NOT_FOUND The specified data is not found in the metabase.