IWMDMStorage2::GetAttributes2
The GetAttributes2 method gets the attributes of storages.
Syntax
HRESULT GetAttributes2(
DWORD* pdwAttributes,
DWORD* pdwAttributesEx,
_WAVEFORMATEX* pAudioFormat,
_VIDEOINFOHEADER* pVideoFormat
);
Parameters
pdwAttributes
[out] Pointer to a DWORD containing the base attributes as defined in the IWMDMStorage::GetAttributes method.
pdwAttributesEx
[out] Pointer to a DWORD containing the extended attributes. Currently, no extended attributes are defined.
pAudioFormat
[out] Pointer to a _WAVEFORMATEX structure that contains attribute information about the object. This parameter is optional and is ignored if the file is not audio.
pVideoFormat
[out] Pointer to a _VIDEOINFOHEADER structure that contains attribute information about the object. This parameter is optional and is ignored if the file is not video.
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.
Return code | Description |
S_OK | The method succeeded. |
E_INVALIDARG | A parameter is invalid or is a NULL pointer. |
E_FAIL | An unspecified error occurred. |
WMDM_E_NOTCERTIFIED | The caller is not certified. |
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 GetAttributes2 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 IWMDMStorage2 interface indicate 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 pAudioFormat parameter is optional. If you pass a valid _WAVEFORMATEX pointer to an audio file, GetAttributes2 passes descriptive information back into the structure. However, if the file is not audio, the pAudioFormat (_WAVEFORMATEX) parameter is ignored.
Requirements
Header: Defined in wmdm.idl.
Library: mssachlp.lib
See Also