Partager via


IWMDMDevice3::FindStorage

banner art

The FindStorage method finds a storage when given the persistent unique identifier of that storage. The persistent unique identifier of a storage is described by the g_wszWMDMPersistentUniqueID property of that storage.

Syntax

HRESULT FindStorage(
  WMDM_FIND_SCOPE  findScope,
  LPCWSTR  pwszUniqueID,
  IWMDMStorage**  ppStorage
);

Parameters

findScope

[in]  Scope of the find operation. It must be one of the following values.

Value Description
WMDM_FIND_SCOPE_GLOBAL Search the whole device.
WMDM_FIND_SCOPE_IMMEDIATE_CHILDREN Search only in the immediate children of the current storage.

pwszUniqueID

[in]  Persistent unique identifier of the storage.

ppStorage

[out]  Pointer to the returned storage specified by the pwszUniqueID 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. If the method fails with an error, it returns a standard error code.

Return code Description
S_OK The method succeeded.
E_INVALIDARG The findScope parameter is invalid, or pwszUniqueID or ppStorage is NULL.
HRESULT_FROM_WIN32(ERROR_NOT_FOUND) No storage was found with the specified persistent unique identifier.

Remarks

A persistent unique identifier is used to uniquely identify content stored on a particular device. It does not represent a content-specific globally unique identifier that remains identical across all devices. Thus, the same content stored in different storages will have different persistent unique identifiers. Similarly, different content can have same persistent unique identifier when it is stored on different devices. Using the analogy of content on a device being similar to rows in a database, this property serves the same purpose as the identity column serves in a database.

Because it is generated by the device, the format of the persistent unique identifier is device-dependent. The application should get the persistent unique identifier by querying the g_wszWMDMPersistentUniqueID property of the storage. An application can use the GetSpecifiedMetadata or GetMetadata methods to query this property.

Requirements

Header: Defined in wmdm.idl.

Library: mssachlp.lib

See Also