Previous | Next |
The GetAttributes method retrieves the attributes of this storage object.
Syntax
HRESULT GetAttributes(
DWORD* pdwAttributes,
_WAVEFORMATEX* pFormat
);
Parameters
pdwAttributes
[out] Pointer to a double word containing the attributes.
pFormat
[out] Pointer to a _WAVEFORMATEX structure that is filled with attribute information about the object. The table below lists the object attributes that can be returned by the pdwAttributes parameter.
Attribute | Description |
WMDM_STORAGE_ATTR_FILESYSTEM | This object is the top-level storage medium. For example, a memory card or some other on board storage. |
WMDM_STORAGE_ATTR_REMOVABLE | This storage medium is removable. |
WMDM_STORAGE_ATTR_NONREMOVABLE | This storage medium is not removable. |
WMDM_STORAGE_ATTR_FOLDERS | This storage medium supports folders and file hierarchy. |
WMDM_STORAGE_ATTR_HAS_FILES | This storage object, if it is a folder, contains at least one file. |
WMDM_STORAGE_ATTR_HAS_FOLDERS | This storage object, if it is a folder, also has sub-folders. |
WMDM_FILE_ATTR_FILE | This is a file on the storage medium. |
WMDM_FILE_ATTR_FOLDER | This is a folder on the storage medium. |
WMDM_FILE_ATTR_LINK | This is a link that creates association between multiple files. |
WMDM_FILE_ATTR_AUDIO | This file is audio data. |
WMDM_FILE_ATTR_DATA | This is non-audio data. |
WMDM_FILE_ATTR_CANPLAY | This audio file can be played by the device. |
WMDM_FILE_ATTR_CANDELETE | This file can be deleted. |
WMDM_FILE_ATTR_CANMOVE | This file or folder can be moved around on the storage medium. |
WMDM_FILE_ATTR_CANRENAME | This file or folder can be renamed. |
WMDM_FILE_ATTR_CANREAD | This file can be read by the host computer. |
WMDM_FILE_ATTR_MUSIC | This audio file is music. |
WMDM_FILE_ATTR_AUDIOBOOK | This audio file is an audio book file. |
Return Values
If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.
Return code | Description |
E_INVALIDARG | The pdwAttributes parameter is an invalid or NULL pointer. |
E_FAIL | An unspecified error occurred. |
Remarks
Evaluation of attributes is a crucial step when exposing the contents of the media device. Devices may not support hierarchical storage of data on storage media. The GetAttributes method allows the application to infer the support and format of the file system by discovering its structure through object attributes.
For example, the attributes of a top-level IMDSPStorage interface indicate a storage medium, and IMDSPEnumStorage exposes the contents of the medium. For an .mp3 file, the attributes indicate a file whose type can be determined by further examination of both the attributes and the file name. In a hierarchical medium, the attributes can indicate a directory whose contents can be exposed by IMDSPStorage::EnumStorage.
The _WAVEFORMATEX parameter is optional. If you pass a valid _WAVEFORMATEX pointer to an audio file, GetAttributes passes descriptive information back into the structure. However, of the file is not audio, the _WAVEFORMATEX parameter is ignored.
See Also
Previous | Next |