IPortableDeviceValues::GetBufferValue method

The GetBufferValue method retrieves a byte array value (type VT_VECTOR | VT_UI1) specified by a key.

Syntax

HRESULT GetBufferValue(
  [in]  REFPROPERTYKEY key,
  [out] BYTE           **ppValue,
  [out] DWORD          *pcbValue
);

Parameters

key [in]

A REFPROPERTYKEY key that specifies the item to retrieve.

ppValue [out]

Pointer to the retrieved BYTE* value. The caller is responsible for freeing the memory by calling CoTaskMemFree.

pcbValue [out]

Pointer to the size of ppValue, in bytes.

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.
DISP_E_TYPEMISMATCH
The property specified by key is not a BYTE* type.
HRESULT_FROM_WIN32(ERROR_NOT_FOUND)
The property specified by key is not in the collection.

Remarks

Retrieving a NULL buffer or a zero-sized buffer is not supported.

Requirements

Requirement Value
Header
PortableDeviceTypes.h
Library
PortableDeviceGUIDs.lib

See also

IPortableDeviceValues Interface

IPortableDeviceValues::SetBufferValue