PeerDistClientAddContentInformation function

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

Syntax


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

Parameters

hPeerDist [in]

A PEERDIST_INSTANCE_HANDLE returned by PeerDistStartup.

hContentHandle [in]

A PEERDIST_CONTENT_HANDLE opened by PeerDistClientOpenContent.

cbNumberOfBytes

Number of bytes in the pBuffer array.

pBuffer [in]

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.

lpOverlapped [in]

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 codeDescription
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

Minimum supported client

Windows 7 Professional [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

PeerDist.h

Library

PeerDist.lib

DLL

PeerDist.dll

See also

PeerDistStartup
PeerDistClientCompleteContentInformation
PeerDistClientOpenContent

 

 

Community Additions

ADD
Show: