Share via


IWMDMStorage4::SetReferences (deprecated)

banner art

This is preliminary documentation and subject to change.

This topic documents a feature of the Windows Media Device Manager SDK. We recommend that you migrate your application to use the Windows Portable Devices API. For more information, see the Windows Portable Devices SDK.

The SetReferences method sets the references contained in a storage that has references (such as a playlist or album), overwriting any previously existing references held by the storage.

Syntax

HRESULT SetReferences(
  DWORD  dwRefs,
  IWMDMStorage**  ppIWMDMStorage
);

Parameters

dwRefs

[in]  Count of IWMDMStorage interface pointers in ppIWMDMStorage. Zero is an acceptable value and clears all references from the storage. The storage itself is not deleted in this case.

ppIWMDMStorage

[in]  Pointer to an array of IWMDMStorage interface pointers to be referenced by the storage. This order is preserved by the storage. NULL is an acceptable value if dwRefs is also zero. The caller is responsible for allocating and releasing this array.

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.
E_INVALIDARG The dwRefs is non-zero and ppIWMDMStorage is NULL.
E_OUTOFMEMORY Method could not be completed due to insufficient memory.
WMDM_E_INTERFACEDEAD The object represented by this interface has been deleted.
E_NOINTERFACE The device does not support metadata.

Remarks

This method is used to set references in objects that are composed of references, such as playlists or albums. If a device does not support metadata, this method will probably not be supported.

Any valid IWMDMStorage object can be contained in the ppIWMDMStorage array. This includes folders and other storages specifying references themselves (creating, for example, a playlist of playlists). The device itself determines how any particular case of referent object is handled. Windows Media Device Manager does not enforce any rules beyond that of IWMDMStorage validity. Consider the case of a playlist containing nested playlist references. On one device, this is disallowed and SetReferences fails. On another device, this is allowed; playback simply traverses the entire set of contained references in depth-first order.

The situation may arise where an IWMDMStorage4 interface pointer corresponds to a storage that no longer exists on the device. WMDM_E_INTERFACEDEAD is returned in this case.

Requirements

Header: Defined in mswmdm.h.

Library: mssachlp.lib

See Also