Share via


IWMDMStorage4::GetSpecifiedMetadata

banner art

The GetSpecifiedMetadata method retrieves only the specified metadata object for a storage.

Syntax

HRESULT GetSpecifiedMetadata(
  DWORD  cProperties,
  LPCWSTR*  ppwszPropNames,
  IWMDMMetaData**  ppMetadata
);

Parameters

cProperties

[in]  Count of properties to be retrieved.

ppwszPropNames

[in]  Array that contains the property names to be retrieved. The size of this array should be equal to cProperties.

ppMetadata

[out]  Pointer to the returned IWMDMMetaData interface pointer.

Return Values

The method returns an HRESULT. All the interface methods in Windows Media Device Manager and service provider can return any of the following classes of error codes:

  • Standard COM error codes
  • Windows error codes converted to HRESULT values
  • Windows Media Device Manager error codes

For a complete list of possible error codes, see Error Codes.

Possible values include, but are not limited to, those in the following table. If the method fails with an error, it returns a standard error code.

Return code Description
S_OK The method succeeded.
E_INVALIDARG This value is returned if any of the following is true:

i) One of cProperties and ppwszPropNames is zero while the other is non-zero.

ii) None of the property names passed-in is valid for the storage.

WMDM_S_NOT_ALL_PROPERTIES_RETRIEVED The method succeeded but only some of the requested properties were retuned.
WMDM_E_NOTSUPPORTED None of the properties was returned by the device. It is possible that one or more properties are supported by the device but could not be returned at this time.

Remarks

This method gives the client control over which properties are retrieved. The client can specify the property names for the properties that the client needs to retrieve. This can be more efficient and is recommended when the client needs only a subset of properties supported by the storage.

In contrast, the GetMetadata method retrieves all the storage metadata (properties).

The method succeeds and returns WMDM_S_NOT_ALL_PROPERTIES_RETRIEVED even if some of the specified properties could not be retrieved (but at least one property was retrieved). The method fails and returns WMDM_E_NOTSUPPORTED if none of the specified properties could be retrieved.

Requesting a single property is a special case of this method. If the client requests a single property, the possible return codes are listed in the following table.

Return code Description
S_OK The method succeeded and all the requested properties were retrieved
E_INVALIDARG The property name passed in is not valid for the storage.
WMDM_E_NOTSUPPORTED The requested property was not returned by the device. It is possible that the property is supported by the device but could not be returned at this time.

Thus in the case of a single property, the method succeeds only if the property is successfully retrieved.

Requirements

Header: Defined in wmdm.idl.

Library: mssachlp.lib

See Also