Share via


IContentDirectory::UpdateObject

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This method modifies, inserts, or deletes object metadata.

Syntax

virtual DWORD UpdateObject(
  LPCWSTR pszObjectID,
  LPCWSTR pszCurrentTagValue,
  LPCWSTR pszNewTagValue
) = 0;

Parameters

  • pszObjectID
    [in] ID of the object whose metadata is to be modified. Corresponds to the A_ARG_TYPE_ObjectID state variable.
  • pszCurrentTagValue
    [in] Comma-separated list of existing metadata elements, or empty placeholders. The provided elements must match existing object metadata elements exactly. The number of elements in this parameter must match the number of elements in the pszNewTagValue parameter. Corresponds to the A_ARG_TYPE_TagValueList state variable.
  • pszNewTagValue
    [in] Comma-separated list of new metadata elements, or empty placeholders. The number of elements in this parameter must match the number of elements in the pszCurrentTagValue parameter. Corresponds to the A_ARG_TYPE_TagValueList state variable.

Return Value

Custom implementations can return appropriate error codes. Should return SUCCESS_AV if the method succeeds. Otherwise, should return an error code defined in WinError.h or UPnP.h, or one of the UPnP AV-specific return values specified in UPnPAVError, especially the following errors documented for this action in the ContentDirectory DCP documentation:

  • ERROR_AV_UPNP_ACTION_FAILED
  • ERROR_AV_UPNP_CD_NO_SUCH_OBJECT
  • ERROR_AV_UPNP_CD_INVALID_CURRENTTAGVALUE
  • ERROR_AV_UPNP_CD_INVALID_NEWTAGVALUE
  • ERROR_AV_UPNP_CD_REQUIRED_TAG_DELETE
  • ERROR_AV_UPNP_CD_READONLY_TAG_UPDATE
  • ERROR_AV_UPNP_CD_PARAMETER_NUM_MISMATCH
  • ERROR_AV_UPNP_CD_RESTRICTED_OBJECT
  • ERROR_AV_UPNP_CD_BAD_METADATA
  • ERROR_AV_UPNP_CD_RESTRICTED_PARENT_OBJECT

Remarks

This method corresponds to the ContentDirectory service's UpdateObject action.

During processing, the values in the pszCurrentTagValue and pszNewTagValue lists are compared and the object metadata is updated according to the following rules.

  • If an element exists at the same index in both lists, the element in pszNewTagValue replaces the existing element in the object metadata.
  • If an element exists in pszOldTagValue and the corresponding index in pszNewTagValue contains no element, the element in pszOldTagValue is removed from the object metadata.
  • If an element exists in pszNewTagValue and the corresponding index in pszOldTagValue contains no element, the element in pszNewTagValue is inserted in to the object data at the specified location.

The ContentDirectory service does not require that this method be implemented. The IContentDirectoryImpl class therefore overrides this method to return ERROR_AV_UPNP_INVALID_ACTION.

For more information about the actions in the ContentDirectory service, see UPnP AV DCP Documentation.

Requirements

Header av_upnp.h
Library Av_upnp.lib
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

IContentDirectory
IContentDirectoryImpl
UPnPAVError