IMDSPStorage2::GetStorage method (mswmdm.h)

The GetStorage method makes it possible to go directly to a storage object from a storage name instead of enumerating through all storages to find it.


HRESULT GetStorage(
  [in]  LPCWSTR      pszStorageName,
  [out] IMDSPStorage **ppStorage


[in] pszStorageName

Pointer to a null-terminated string containing the storage name.

[out] ppStorage

Pointer to the storage object specified by pszStorageName, or NULL if no such storage was found.

Return value

The method returns an HRESULT. All the interface methods in Windows Media Device Manager 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 an extensive list of possible error codes, see Error Codes.


The IMDSPStorage2::GetStorage interface extends the functionality of IMDSPStorage.

IMDSPStorage2::GetStorage does not support wildcard characters. It is not recursive, that is, it will only find storage objects in the current storage.

If this method is not implemented, it should return E_NOTIMPL. (It should not return WMDM_E_NOT_SUPPORTED or any other codes indicating that this method is not implemented). This will ensure that Windows Media Device Manager will attempt to substitute this functionality itself by enumerating all storages to find a match based on the storage name passed in as pszStorageName.

It is strongly recommended that a service provider implement this method to efficiently return a storage object based on name.

This method is optional. For more information, see Mandatory and Optional Interfaces.


Target Platform Windows
Header mswmdm.h
Library Mssachlp.lib

See also

IMDSPStorage Interface

IMDSPStorage2 Interface