IWMDMStorage4::SetReferences
The SetReferences method sets the references contained in a storage that has references (such as playlist/album), overwriting any previously existing references contained in this storage.
Syntax
HRESULT SetReferences(
DWORD dwRefs,
IWMDMStorage** ppIWMDMStorage
);
Parameters
dwRefs
[in] Count of IWMDMStorage interface pointers contained in the passed-in array. Zero is an acceptable value and resets the storage to contain zero references. The storage itself is not deleted in this case.
ppIWMDMStorage
[in] Pointer to an array of IWMDMStorage interface pointers used to set references in a storage. The ordering of references matches the ordering of the corresponding IWMDMStorage interface pointers in this array. NULL is an acceptable value if dwRefs is also zero.
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 | The dwRefs is non-zero and ppIWMDMStorage is NULL. |
E_OUTOFMEMORY | Method could not be completed due to insufficient memory. |
WMDM_E_INTERFACEDEAD | The playlist object on the device represented by this IWMDMStorage4 interface has been deleted. |
Remarks
Any valid IWMDMStorage object can be contained in the ppIWMDMStorage array. This includes folders and other storages containing references themselves (creating, for example, a playlist of playlists). The device itself determines how any particular case of referent object will be 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 wmdm.idl.
Library: mssachlp.lib
See Also