Accessing metadata and attributes in the app

A general discussion of metadata and attributes is available in Getting and Setting Metadata and Attributes. This section covers specific application method calls to retrieve or set values.

Applications can retrieve attributes or metadata about a specific storage by calling IWMDMStorage::GetAttributes, IWMDMStorage2::GetAttributes2, IWMDMStorage3::GetMetadata or IWMDMStorage4::GetSpecifiedMetadata. GetMetadata retrieves a full collection of all the metadata associated with a storage, and the application can then enumerate through all values or request specific values from the collection. GetSpecifiedMetadata creates a metadata object on behalf of the caller. The caller may request a subset of the available data by filling in the ppwszPropNames parameter with an array of the desired Windows Media Device Manager property strings, and the count of that array. The returned metadata object will be filled with those properties that could be retrieved. Those properties that couldn't be retrieved will be absent. Metadata is returned on a best-effort basis.

A device can set attributes or metadata on a storage by calling IWMDMStorage::SetAttributes, IWMDMStorage2::SetAttributes2, or IWMDMStorage3::SetMetadata. Note that there is no guarantee that any values set will persist, because they may be stored in a non-persistent external file store, the values may not be supported, or, the device may not support the properties as writeable.

You can also get or set metadata about a device by calling IWMDMDevice3::GetProperty or IWMDMDevice3::SetProperty. There is a separate table of device metadata constants listed at the end of Metadata Constants.

Examples of using these methods are given in each method's reference documentation.

Creating a Windows Media Device Manager Application

Getting and Setting Metadata and Attributes