Previous | Next |
The GetAttributes method retrieves the attributes of a storage object.
Syntax
HRESULT GetAttributes(
DWORD* pdwAttributes,
_WAVEFORMATEX* pFormat
);
Parameters
pdwAttributes
[out] Pointer to a double word containing the attributes. The following table 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 type of 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_FLASH | This storage medium is flash memory. |
WMDM_STORAGE_ATTR_HARDDISK | This storage medium is a hard disk. |
WMDM_STORAGE_ATTR_DRAM | This storage medium is DRAM memory. |
WMDM_STORAGE_ATTR_ZIP | This storage medium is a zip-type cartridge disk |
WMDM_STORAGE_ATTR_CD | This storage medium is a CD-ROM drive. |
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 an association between multiple files. |
WMDM_FILE_ATTR_AUDIO | This file contains audio data. |
WMDM_FILE_ATTR_DATA | This file contains 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 contains music. |
WMDM_FILE_ATTR_AUDIOBOOK | This is an audio book file. |
pFormat
[out] Pointer to a _WAVEFORMATEX structure that contains attribute information about the object.
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. Some devices do not support hierarchical storage of data on storage media. The GetAttributes method is used 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 IWMDMStorage interface indicates a storage medium, and IWMDMEnumStorage 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 IWMDMStorage::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, if the file is not audio, the _WAVEFORMATEX parameter (pFormat) is ignored.
See Also
Previous | Next |