IStreamAsync::ReadAsync method (shobjidl.h)

Reads information from a stream asynchronously. For example, the Shell implements this interface on file items when transferring them asynchronously.

Syntax

HRESULT ReadAsync(
  [out]           void         *pv,
  [in]            DWORD        cb,
  [out, optional] LPDWORD      pcbRead,
  [in]            LPOVERLAPPED lpOverlapped
);

Parameters

[out] pv

Type: void*

When this method returns successfully, returns a buffer that is cb bytes long and contains pcbRead bytes of information from the read operation.

[in] cb

Type: DWORD

The number of bytes to read from the stream.

[out, optional] pcbRead

Type: LPDWORD

Pointer to a DWORD value that, when this method returns successfully, states the actual number of bytes read to the buffer pointed to by pv. This value can be NULL.

[in] lpOverlapped

Type: LPOVERLAPPED

A pointer to an OVERLAPPED structure that contains information used in the asynchronous read operation.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

IStreamAsync::ReadAsync should reset the event specified by the hEvent member of the OVERLAPPED structure to a nonsignaled state when it begins the input/output (I/O) operation.

This method has been implemented in the Shell as a thin wrapper around the public ReadFile API.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl.h