IPortableDeviceProperties::SetValues method (portabledeviceapi.h)
The SetValues method adds or modifies one or more properties on a specified object on a device.
Syntax
HRESULT SetValues(
[in] LPCWSTR pszObjectID,
[in] IPortableDeviceValues *pValues,
[out] IPortableDeviceValues **ppResults
);
Parameters
[in] pszObjectID
Pointer to a null-terminated string that contains the object ID of the object to modify. To specify the device, use WPD_DEVICE_OBJECT_ID.
[in] pValues
Pointer to an IPortableDeviceValues interface that contains one or more property/value pairs to set. Existing values will be overwritten.
[out] ppResults
Address of a variable that receives a pointer to an IPortableDeviceValues interface that contains a collection of property/HRESULT values. Each value (type VT_ERROR) describes the success or failure of the property set attempt. 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 |
---|---|
|
All specified property values were updated. |
|
One or more properties could not be modified. Those that could not will have an HRESULT of type VT_ERROR in the retrieved ppResults parameter. |
Remarks
To delete a property, call IPortableDeviceProperties::Delete. A property can be deleted only if its WPD_PROPERTY_ATTRIBUTE_CAN_WRITE attribute is True. This attribute can be retrieved by calling GetPropertyAttributes.
Examples
For an example of how to use this method, see Setting Properties for a Single Object.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | portabledeviceapi.h |
Library | PortableDeviceGUIDs.lib |
See also
IPortableDeviceProperties Interface
IPortableDeviceProperties::Delete
IPortableDeviceProperties::GetValues