Partager via


IWMDMDevice2::GetStorage

banner art

The GetStorage method retrieves a pointer to the IWMDMStorage interface of a storage object based on storage name. This makes it possible to retrieve a storage object directly, based on its name, instead of enumerating storages and searching for it.

Syntax

HRESULT GetStorage(
  LPCWSTR  pszStorageName,
  IWMDMStorage**  ppStorage
);

Parameters

pszStorageName

[in]  Pointer to a null-terminated string containing the storage name on the current root.

ppStorage

[out]  Pointer to the storage object specified by the pszStorageName parameter.

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.
S_FALSE The storage cannot be found.

Remarks

GetStorage does not support wildcard characters. It is not recursive. Memory for ppStorage parameter ** is allocated by this method and must be freed by the caller using CoTaskMemFree, a standard Win32 function.

Requirements

Header: Defined in wmdm.idl.

Library: mssachlp.lib

See Also