IWSDInboundAttachment::Read method (wsdattachment.h)

Retrieves attachment data from a message sent by a remote host.

Syntax

HRESULT Read(
  [out] BYTE    *pBuffer,
  [in]  DWORD   dwBytesToRead,
  [out] LPDWORD pdwNumberOfBytesRead
);

Parameters

[out] pBuffer

Pointer to a buffer receiving the data read from the attachment stream. The application program is responsible for allocating and freeing this data buffer.

[in] dwBytesToRead

Size of the pBuffer input buffer, in bytes.

[out] pdwNumberOfBytesRead

Pointer to a DWORD containing the number of bytes of data read from the attachment stream into the pBuffer input buffer.

Return value

Possible return values include, but are not limited to, the following:

Return code Description
S_OK
Method completed successfully.
S_FALSE
The end of the attachment stream has been reached.
E_INVALIDARG
pBuffer is NULL.
E_POINTER
pdwNumberofBytesRead is NULL.

Remarks

The Read method allows an application to receive arbitrary data from a remote host in a MIME-encapsulated message attachment. WSDAPI will provide an object implementing this interface when an attachment stream is received as part of a message. The call to Read opens the inbound attachment stream and transfers the attachment data to the application's buffer. If Read returns S_OK or S_FALSE, pdwNumberofBytesRead is set to the number of bytes read, which may be less than the size of the buffer. The Read call may block on network traffic.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header wsdattachment.h (include Wsdapi.h)
DLL Wsdapi.dll

See also

IWSDInboundAttachment