IWMDMStorage4::GetReferences
The GetReferences method returns an array of pointers to IWMDMStorage objects comprising the references contained in a storage such as one representing playlist or album objects.
Syntax
HRESULT GetReferences(
DWORD* pdwRefs,
IWMDMStorage*** pppIWMDMStorage
);
Parameters
pdwRefs
[out] Pointer to the count of IWMDMStorage interface pointers being returned in pppIWMDMStorage.
pppIWMDMStorage
[out] Pointer to a pointer to the array of IWMDMStorage interface pointers that represent references on a storage. Such references can, for example, represent items in a playlist or album. The ordering of references matches the ordering in this array. Memory for this array is allocated by Windows Media Device Manager. When the calling application has finished accessing this array, Release must be called on all of the interface pointers and the array memory must be freed using CoTaskMemFree.
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. |
S_FALSE | The method succeeded. However, one or more items referenced by the storage on the device side have been deleted since the last call to SetReferences. |
E_INVALIDARG | Either pointer pdwRefs or pppIWMDMStorage is NULL. |
E_OUTOFMEMORY | Method could not be completed due to insufficient memory. |
WMDM_E_INTERFACEDEAD | The storage represented by this IWMDMStorage4 interface has been deleted. |
Remarks
Windows Media Device Manager delegates to the underlying service provider the task of adding and removing the references on a storage such as a playlist or an album.
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.
Another possibility is that the storage has reference to one or more items that have been deleted from the device. Windows Media Device Manager itself does nothing about stale references, deferring action to the service provider or the device itself. However, references to nonexistent storage objects are not allowed in the returned interface pointer array and therefore are simply omitted. S_FALSE is returned to indicate this condition. The application might choose to refresh the playlist object by using the known-good references returned here.
Requirements
Header: Defined in wmdm.idl.
Library: mssachlp.lib
See Also