Skip to content

Latest commit

 

History

History
185 lines (135 loc) · 6.19 KB

nf-peerdist-peerdistserverpublishstream.md

File metadata and controls

185 lines (135 loc) · 6.19 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:peerdist.PeerDistServerPublishStream
PeerDistServerPublishStream function (peerdist.h)
PeerDistServerPublishStream function initializes a new stream to be published to the Peer Distribution service.
PeerDistServerPublishStream
PeerDistServerPublishStream function [Peer Networking]
p2p.peerdistserverpublishstream
peerdist/PeerDistServerPublishStream
p2p\peerdistserverpublishstream.htm
p2p
2133e578-f89d-4cfd-a522-12c2531babaa
12/05/2018
PeerDistServerPublishStream, PeerDistServerPublishStream function [Peer Networking], p2p.peerdistserverpublishstream, peerdist/PeerDistServerPublishStream
peerdist.h
Windows
Windows 7 Professional [desktop apps only]
Windows Server 2008 R2 [desktop apps only]
PeerDist.lib
PeerDist.dll
Windows
19H1
PeerDistServerPublishStream
peerdist/PeerDistServerPublishStream
c++
APIRef
kbSyntax
DllExport
PeerDist.dll
PeerDistServerPublishStream

PeerDistServerPublishStream function

-description

The PeerDistServerPublishStream function initializes a new stream to be published to the Peer Distribution service.

-parameters

-param hPeerDist [in]

A PEERDIST_INSTANCE_HANDLE returned by PeerDistStartup.

-param cbContentIdentifier

The length, in bytes, of the buffer that contains content identifier data.

-param pContentIdentifier [in]

A pointer to an array that contains a content identifier data.

-param cbContentLength

The length, in bytes, of the content to be published. This value can be 0 if the content length is not yet known. If a non-zero argument is provided then it must match to the total data length added by PeerDistServerPublishAddToStream function calls.

-param pPublishOptions [in, optional]

Pointer to a PEERDIST_PUBLICATION_OPTIONS structure that specifies content publishing rules.

-param hCompletionPort [in, optional]

A handle to the completion port that can be used for retrieving the completion notification of the asynchronous function. To create a completion port, use the CreateIoCompletionPort function. This parameter can be NULL.

-param ulCompletionKey [in, optional]

Value returned through the lpCompletionKey parameter of the GetQueuedCompletionStatus function. This parameter is ignored when hCompletionPort is NULL.

-param phStream [out]

A pointer that receives a handle to the stream that is used to publish data into the Peer Distribution service.

-returns

If the function succeeds, the return value is ERROR_SUCCESS. 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 specified hPeerDist is invalid.
PEERDIST_ERROR_ALREADY_EXISTS
The content identifier used for publication is already published.
ERROR_ACCESS_DISABLED_BY_POLICY
The feature is disabled by Group Policy.
PEERDIST_ERROR_SERVICE_UNAVAILABLE
The service is unavailable.

-remarks

A content identifier is a user defined label for the content being published. This content identifier is used for PeerDistServerOpenContentInformation, PeerDistServerUnpublish, and PeerDistServerCancelAsyncOperation calls.

The handle received by phStream can be used in PeerDistServerPublishAddToStream and PeerDistServerPublishCompleteStream to publish data into the Peer Distribution service. This handle should be closed by PeerDistServerCloseStreamHandle.

A publication is accessible only to the User Account that originally published the content. If a different user calls PeerDistServerPublishStream with the same content identifier, a separate publication will be created under the context of that user.

-see-also

PeerDistServerCancelAsyncOperation

PeerDistServerCloseStreamHandle

PeerDistServerOpenContentInformation

PeerDistServerPublishAddToStream

PeerDistServerPublishCompleteStream

PeerDistServerUnpublish