PeerDistClientAddContentInformation function (peerdist.h)

The PeerDistClientAddContentInformation function adds the content information associated with a content handle opened by PeerDistClientOpenContent.

Syntax

DWORD PeerDistClientAddContentInformation(
  [in] PEERDIST_INSTANCE_HANDLE hPeerDist,
  [in] PEERDIST_CONTENT_HANDLE  hContentHandle,
       DWORD                    cbNumberOfBytes,
  [in] PBYTE                    pBuffer,
  [in] LPOVERLAPPED             lpOverlapped
);

Parameters

[in] hPeerDist

A PEERDIST_INSTANCE_HANDLE returned by PeerDistStartup.

[in] hContentHandle

A PEERDIST_CONTENT_HANDLE opened by PeerDistClientOpenContent.

cbNumberOfBytes

Number of bytes in the pBuffer array.

[in] pBuffer

Pointer to the buffer that contains the content information. This buffer must remain valid for the duration of the add operation. The caller must not use this buffer until the add operation is completed.

[in] lpOverlapped

Pointer to an OVERLAPPED structure. The Internal member of OVERLAPPED structure contains the completion status of the asynchronous operation. The Offset and OffsetHigh are reserved and must be 0.

Return value

If the function succeeds, the return value is ERROR_IO_PENDING. Otherwise, the function may return one of the following values:

Return code Description
ERROR_INVALID_PARAMETER
One or more parameters are invalid.
ERROR_INVALID_HANDLE
The hPeerDist handle is invalid.
ERROR_ACCESS_DISABLED_BY_POLICY
The feature is disabled by Group Policy.
PEERDIST_ERROR_SERVICE_UNAVAILABLE
The service is unavailable.

Remarks

In order to retrieve content data from Peer Distribution service the client must add content information that it received from the content server by calling the PeerDistClientAddContentInformation function. When all content information data has been added, the PeerDistClientCompleteContentInformation function must be called. Once PeerDistClientCompleteContentInformation is complete, the client can call PeerDistClientStreamRead or PeerDistClientBlockRead to retrieve the data from the Peer Distribution system.

When calling this function multiple times on a single content handle, the caller must wait for each operation to complete before the next call is made.

An application is not limited to adding content information with a single PeerDistClientAddContentInformation API call, as it is possible to add portions of that content information as it is made available. When more content information is available, the application can again call PeerDistClientAddContentInformation. When the application is done adding the entire content information, it must then call PeerDistClientCompleteContentInformation.

Requirements

Requirement Value
Minimum supported client Windows 7 Professional [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header peerdist.h
Library PeerDist.lib
DLL PeerDist.dll

See also

PeerDistClientCompleteContentInformation

PeerDistClientOpenContent

PeerDistStartup