IWMDMStorage4::GetSpecifiedMetadata

banner art

The GetSpecifiedMetadata method retrieves one or more specific metadata properties from the storage.

Syntax

HRESULT GetSpecifiedMetadata(DWORDcProperties,LPCWSTR*ppwszPropNames,IWMDMMetaData**ppMetadata);

Parameters

cProperties

[in]  Count of properties to retrieve.

ppwszPropNames

[in]  Array of property names to retrieve. The length of this array should be equal to cProperties. The application should free this memory using CoTaskMemFree.

ppMetadata

[out]  Pointer to the returned IWMDMMetaData interface pointer, containing the retrieved values. The caller must release this interface when finished with it.

Return Values

The method returns an HRESULT. All the interface methods in Windows Media Device Manager 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 an extenstive 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.
WMDM_S_NOT_ALL_PROPERTIES_RETRIEVED The method succeeded but only some of the requested properties were retuned.
E_INVALIDARG This value is returned if either of the following is true:

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

ii) None of the properties requested are supported by the storage.

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. This can be more efficient than IWMDMStorage3::GetMetadata, and is recommended when the client needs only a subset of properties supported by the storage.

If this method is used to retrieve data from a Windows Portable Devices (WPD) device, the data is returned in binary form in an IPortableDeviceValues object. The application should de-serialize this data in order to obtain the actual property values.

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 S_OK, E_INVALIDARG, and WMDM_E_NOTSUPPORTED. Thus, in the case of a single property, the method succeeds only if the property is successfully retrieved.

Requirements

Header: Defined in mswmdm.h.

Library: mssachlp.lib

See Also