IPortableDeviceContent::GetObjectIDsFromPersistentUniqueIDs method (portabledeviceapi.h)

The GetObjectIDsFromPersistentUniqueIDs method retrieves the current object ID of one or more objects, given their persistent unique IDs (PUIDs).

Syntax

HRESULT GetObjectIDsFromPersistentUniqueIDs(
  [in]  IPortableDevicePropVariantCollection *pPersistentUniqueIDs,
  [out] IPortableDevicePropVariantCollection **ppObjectIDs
);

Parameters

[in] pPersistentUniqueIDs

Pointer to an IPortableDevicePropVariantCollection interface that contains one or more persistent unique ID (PUID) string values (type VT_LPWSTR).

[out] ppObjectIDs

Pointer to an IPortableDevicePropVariantCollection interface pointer that contains the retrieved object IDs, as type VT_LPWSTR. The retrieved IDs will be in the same order as the submitted PUIDs; if a value could not be found, it is indicated by an empty string. The caller must release this interface when it is done with it.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.
E_POINTER
At least one of the required arguments was a NULL pointer.

Remarks

Windows Portable Devices Object IDs are unique across the device, but may be different across sessions. An Object ID can change when the application reconnects to the device.

Certain applications, such as synchronization engines, require a way to identify the object across connection sessions. Every object has a WPD_OBJECT_PERSISTENT_UNIQUE_ID property, which indicates an identifier that is persistent across sessions. Applications can read and save this property in their initial session, by calling the Properties method.

Examples

For an example of how to use this method, see Retrieving an Object Identifier from a Persistent Unique Identifier

Requirements

Requirement Value
Target Platform Windows
Header portabledeviceapi.h
Library PortableDeviceGUIDs.lib

See also

IPortableDeviceContent Interface

Retrieving an Object Identifier from a Persistent Unique Identifier