Compartilhar via


IMDSPEnumStorage Interface

banner art

The IMDSPEnumStorage interface is used to enumerate the storage media on a device. For more information on the standard implementation of enumeration interfaces, see the Microsoft COM documentation, available at the Microsoft Web site. The storage media on a device are organized in a hierarchical manner similar to disk drives on a computer.

When accessed from the IMDSPDevice::EnumStorage method, this interface enumerates the individual storage media on the device in the same way that you would see the individual disk drives on a computer.

When accessed from the IWMDMStorage::EnumStorage method, this interface enumerates the contents of the storage medium. EnumStorage can be called on the enumerated storage objects recursively, and thus the contents of a storage medium are returned in the hierarchical fashion in which they are stored on the storage medium. If the file system of the storage medium supports a notion of order among the content, the enumerator will return the contents in the same order.

The storage enumerator returns a snapshot of the state of storages. It may not reflect the effect of storage media insertion and removal and may not reflect the effects of subsequent Insert, Move and Delete methods. The client should obtain a new enumerator to get the new state of the storage media.

The Insert, Move, and Delete methods of the IWMDMStorageControl interface change the order of files. If these operations are invoked, then the order of objects as originally returned by the IMDSPEnumStorage interface can be changed.

If an application is going to display the order of content on a media device, the application programmer must take into account order changes that can occur as a result of IWMDMStorageControl operations. There are two ways to deal with this situation. One way is to simply re-enumerate whenever a change to content occurs. Another way is to maintain the order of IWMDMStorage objects programmatically.

No matter how this issue is handled, it must be handled by the application if the order of files is important to the application.

In addition to the methods inherited from IUnknown, the IMDSPEnumStorage interface exposes the following methods.

Method Description
Clone Creates another enumerator that contains the same enumeration state as the current one.
Next Retrieves a pointer to the next IMDSPStorage interface.
Reset Resets the enumeration sequence to the beginning.
Skip Skips over the next specified number of storage interface(s) in the enumeration sequence.

See Also