Compartir a través de


IPortableDeviceProperties::SetValues

banner art

Previous Next

IPortableDeviceProperties::SetValues

The SetValues method adds or modifies one or more properties on a specified object on a device.

Syntax

  HRESULT SetValues(
  LPCWSTR  pszObjectID,
  IPortableDeviceValues*  pValues,
  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 Values

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

Return code Description
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.

Requirements

Header: Defined in PortableDeviceApi.h

Library: PortableDeviceGUIDs.lib

See Also

Previous Next