IPortableDeviceProperties::GetPropertyAttributes method (portabledeviceapi.h)
The GetPropertyAttributes method retrieves attributes of a specified object property on a device.
Syntax
HRESULT GetPropertyAttributes(
[in] LPCWSTR pszObjectID,
[in] REFPROPERTYKEY Key,
[out] IPortableDeviceValues **ppAttributes
);
Parameters
[in] pszObjectID
Pointer to a null-terminated string that contains the object ID of the object to query. To specify the device, use WPD_DEVICE_OBJECT_ID.
[in] Key
A REFPROPERTYKEY that specifies the property to query for. You can retrieve a list of supported properties by calling GetSupportedProperties. For a list of properties that are defined by Windows Portable Devices, see Properties and Attributes.
[out] ppAttributes
Address of a variable that receives a pointer to an IPortableDeviceValues interface that holds the retrieved property attributes. These are PROPERTYKEY/value pairs, where the PROPERTYKEY is the property, and the value data type depends on the specific property. The caller must release this interface when it is done with it. Attributes defined by Windows Portable Devices can be found on the Properties and Attributes page.
Return value
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Return code | Description |
---|---|
|
The method succeeded, and all attributes were retrieved successfully. |
|
Only some attribute values could be retrieved. Others could not, and will contain an HRESULT value of type VT_ERROR. |
|
A required pointer argument was NULL. |
Remarks
Property attributes describe a property's access rights, valid values, and other information. For example, a property can have a WPD_PROPERTY_ATTRIBUTE_CAN_DELETE value set to False to prevent deletion, and have a range of valid values stored as individual entries.
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