Windows Media Format SDK banner art
PreviousNext

IMDSPStorage::CreateStorage

The CreateStorage method creates a new storage at the level of this storage and returns a pointer to the IMDSPStorage interface on the newly created storage.

Syntax

HRESULT CreateStorage(
  DWORD  dwAttributes,
  _WAVEFORMATEX*  pFormat,
  LPWSTR  pwszName,
  IMDSPStorage**  ppNewStorage
);

Parameters

  dwAttributes

[in]  Double word containing the attributes for the new storage. The table below lists the available storage attributes.

Attribute Description
WMDM_STORAGECONTROL_INSERTBEFORE The new storage object will be created in front of the target object.
WMDM_STORAGECONTROL_INSERTAFTER The new storage object will be created after the target object.
WMDM_STORAGECONTROL_INSERTINTO The new storage object will be created in the target object folder.
WMDM_STORAGECONTROL_OVERWRITE If a storage with the same name already exists, it will be destroyed and a new storage created.
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_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.
WMDM_STORAGE_ATTR_FOLDERS This storage medium supports folders and file hierarchy.
WMDM_FILE_ATTR_FOLDER This is a folder on the storage medium.
WMDM_FILE_ATTR_LINK This is a link that creates an association among multiple files.
WMDM_FILE_ATTR_FILE This is a file on the storage medium.
WMDM_FILE_ATTR_AUDIO This file is audio data.
WMDM_FILE_ATTR_DATA This file 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 audiobook file.

  pFormat

[in]  Pointer to a _WAVEFORMATEX structure that contains information about the object, if the object is an audio file.

  pwszName

[in]  Pointer to a wide-character NULL-terminated string containing the name for the new storage.

  ppNewStorage

[out]  Pointer to an IMDSPStorage pointer to receive the IMDSPStorage interface for the newly created storage.

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Return code Description
E_INVALIDARG A parameter is invalid or a NULL pointer.
E_FAIL An unspecified error occurred.

Remarks

If both the WMDM_FILE_ATTR_FOLDER and WMDM_FILE_ATTR_FILE attributes are set, the folder attribute overrides the file attribute, and the new storage is created as a folder.

See Also

PreviousNext


© 1999 Microsoft Corporation. All rights reserved.