IPortableDeviceProperties::Delete method

The Delete method deletes specified properties from a specified object on a device.

Syntax


HRESULT Delete(
  [in] LPCWSTR                      pszObjectID,
  [in] IPortableDeviceKeyCollection *pKeys
);

Parameters

pszObjectID [in]

Pointer to a null-terminated string that specifies the ID of the object whose properties you will delete. To specify the device, use WPD_DEVICE_OBJECT_ID.

pKeys [in]

Pointer to an IPortableDeviceKeyCollection interface that specifies which properties to delete. For a list of properties defined by Windows Portable Devices, see Properties and Attributes.

Return value

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

Return codeDescription
S_OK

The method succeeded.

S_FALSE

One or more property values could not be deleted.

E_POINTER

The required pointer argument was NULL.

 

Remarks

Properties can be deleted only if their WPD_PROPERTY_ATTRIBUTE_CAN_DELETE attribute is True. This attribute can be retrieved by calling GetPropertyAttributes.

The driver has no way to indicate partial success; that is, if only some properties could be deleted, the driver will return S_FALSE, but this method does not indicate which properties were successfully deleted. The only way to learn which properties were deleted is to request all properties by calling IPortableDeviceProperties::GetValues.

Requirements

Header

PortableDeviceApi.h

Library

PortableDeviceGUIDs.lib

See also

IPortableDeviceProperties Interface

 

 

Community Additions

ADD
Show: