Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IPortableDeviceProperties::SetValues method

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

pszObjectID [in]

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.

pValues [in]

Pointer to an IPortableDeviceValues interface that contains one or more property/value pairs to set. Existing values will be overwritten.

ppResults [out]

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 codeDescription
S_OK

All specified property values were updated.

S_FALSE

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

Header

PortableDeviceApi.h

Library

PortableDeviceGUIDs.lib

See also

IPortableDeviceProperties Interface
IPortableDeviceProperties::Delete
IPortableDeviceProperties::GetValues
Setting Properties for a Single Object
Writing Content-Object Properties

 

 

Community Additions

Show:
© 2017 Microsoft