IPortableDeviceConnector::SetProperty method (portabledeviceconnectapi.h)

The SetProperty method sets the given property on the MTP/Bluetooth Bus Enumerator device.

Syntax

HRESULT SetProperty(
  [in] const DEVPROPKEY *pPropertyKey,
  [in] DEVPROPTYPE      PropertyType,
  [in] const BYTE       *pData,
  [in] UINT32           cbData
);

Parameters

[in] pPropertyKey

A pointer to a property key for the given property.

[in] PropertyType

The property type.

[in] pData

A pointer to the property data.

[in] cbData

The size (in bytes) of the property data.

Return value

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

Return code Description
S_OK
The method succeeded.
HRESULT_FROM_WIN32(ERROR_NOT_FOUND)
The specified property key is not supported.

Remarks

Before calling this method, an application must verify that it has Administrator user rights.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header portabledeviceconnectapi.h
Library PortableDeviceGuids.lib

See also

IPortableDeviceConnector