共用方式為


PeerDistServerOpenContentInformationEx 函式 (peerdist.h)

PeerDistServerOpenContentInformationEx 函式會開啟PEERDIST_CONTENTINFO_HANDLE。 用戶端會使用控制碼來擷取內容資訊。

語法

DWORD PeerDistServerOpenContentInformationEx(
  [in]           PEERDIST_INSTANCE_HANDLE     hPeerDist,
  [in]           DWORD                        cbContentIdentifier,
  [in]           PBYTE                        pContentIdentifier,
                 ULONGLONG                    ullContentOffset,
                 ULONGLONG                    cbContentLength,
  [in]           PEERDIST_RETRIEVAL_OPTIONS   *pRetrievalOptions,
  [in, optional] HANDLE                       hCompletionPort,
  [in, optional] ULONG_PTR                    ulCompletionKey,
  [out]          PPEERDIST_CONTENTINFO_HANDLE phContentInfo
);

參數

[in] hPeerDist

PeerDistStartup 傳回的PEERDIST_INSTANCE_HANDLE

[in] cbContentIdentifier

內容識別碼的長度 (以位元組為單位)。

[in] pContentIdentifier

包含內容識別碼之緩衝區的指標。

ullContentOffset

從要求內容資訊句柄之已發佈內容開頭的位移量。

cbContentLength

要求內容資訊的內容長度 (以位元組為單位) (從 ullContentOffset 開始)。

[in] pRetrievalOptions

指定擷取內容資訊的其他選項的 PEER_RETRIEVAL_OPTIONS 結構。

[in, optional] hCompletionPort

用來擷取非同步函式完成通知之完成埠的控制碼。 若要建立完成埠,請使用 CreateIoCompletionPort 函式。 此參數可以是 NULL。

[in, optional] ulCompletionKey

要透過 GetQueuedCompletionStatus 函式的 lpCompletionKey 參數傳回的值。 當 hCompletionPortNull 時,會忽略此參數。

[out] phContentInfo

用來擷取內容資訊的控制碼。

返回值

如果函式成功,則傳回值為 ERROR_SUCCESS

備註

如果函式成功, phContentInfo 收到的句柄可以傳遞至
PeerDistServerRetrieveContentInformation 函式來擷取內容資訊。 控制碼必須透過 PeerDistServerCloseContentInformation 函式關閉。

如果 ullContentOffsetcbContentLength 都是零,則會擷取整個內容的內容資訊。

pRetrievalOptions 參數可用來指定要求用戶端設定為處理的內容資訊版本範圍。 這可讓用戶端擷取內容資訊結構的適用版本。

需求

Requirement 價值觀
最低支援的用戶端 Windows 8 [僅限傳統型應用程式]
支援的最低伺服器 Windows Server 2012 [僅限傳統型應用程式]
目標平臺 窗戶
Header 對等區.h
Library PeerDist.lib

另請參閱

CreateIoCompletionPort

PEER_RETRIEVAL_OPTIONS

PeerDistServerCloseContentInformation

PeerDistServerRetrieveContentInformation

PeerDistStartup