次の方法で共有


IWpdSerializer::WriteIPortableDeviceValuesToBuffer

banner art

Previous Next

IWpdSerializer::WriteIPortableDeviceValuesToBuffer

The WriteIPortableDeviceValuesToBuffer method serializes an IPortableDeviceValues interface to a caller-allocated byte array.

Syntax

  HRESULT WriteIPortableDeviceValuesToBuffer(
  DWORD  dwOutputBufferLength,
  IPortableDeviceValues*  pResults,
  BYTE*  pBuffer,
  DWORD*  pdwBytesWritten
);

Parameters

dwOutputBufferLength

[in]  DWORD that specifies the size of pBuffer, in bytes.

pResults

[in]  Pointer to an IPortableDeviceValues interface to serialize.

pBuffer

[out]  Pointer to a caller-allocated buffer. To learn the size of the required buffer, call GetSerializedSize.

pdwBytesWritten

[out]  Pointer to a DWORD that indicates the number of bytes that was actually written to the caller-allocated buffer.

Return Values

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.
E_POINTER A required pointer argument was NULL.
E_OUTOFMEMORY The caller-provided buffer was not big enough.

Remarks

This method copies an IPortableDeviceValues interface into an existing buffer. If you want to allocate a new buffer, use GetBufferFromIPortableDeviceValues.

Requirements

Header: Defined in PortableDeviceTypes.h

Library: PortableDeviceGUIDs.lib

See Also

Previous Next