peerDistServerOpenContentInformation 函式 (peerdist.h)
PeerDistServerOpenContentInformation 函式會開啟PEERDIST_CONTENTINFO_HANDLE。 用戶端會使用 句柄來擷取內容資訊。
語法
DWORD PeerDistServerOpenContentInformation(
[in] PEERDIST_INSTANCE_HANDLE hPeerDist,
DWORD cbContentIdentifier,
[in] PBYTE pContentIdentifier,
ULONGLONG ullContentOffset,
ULONGLONG cbContentLength,
[in, optional] HANDLE hCompletionPort,
[in, optional] ULONG_PTR ulCompletionKey,
[out] PPEERDIST_CONTENTINFO_HANDLE phContentInfo
);
參數
[in] hPeerDist
PeerDistStartup 傳回的PEERDIST_INSTANCE_HANDLE。
cbContentIdentifier
內容標識碼的長度,以位元組為單位。
[in] pContentIdentifier
包含內容識別碼的緩衝區指標。
ullContentOffset
要求內容資訊句柄的已發行內容開頭的位移。
cbContentLength
從要求內容資訊的 ullContentOffset) 開始,以位元組為單位的內容長度 (。
[in, optional] hCompletionPort
用來擷取異步函式完成通知之完成埠的句柄。 若要建立完成埠,請使用 CreateIoCompletionPort 函式。 此參數可以是 Null。
[in, optional] ulCompletionKey
要透過 GetQueuedCompletionStatus 函式的 lpCompletionKey 參數傳回的值。 當 hCompletionPort 為 NULL 時,會忽略 此參數。
[out] phContentInfo
用來擷取內容資訊的句柄。
傳回值
如果函式成功,傳回值會 ERROR_SUCCESS。 否則,此函式可能會傳回下列其中一個值:
傳回碼 | Description |
---|---|
|
一或多個參數無效。 |
|
hPeerDist 句柄無效。 |
|
未發佈指定的內容識別碼數據。 |
|
群組原則 會停用此功能。 |
|
服務無法使用。 |
備註
如果函式成功, phContentInfo 收到的句柄可以傳遞至
PeerDistServerRetrieveContentInformation 函式 可擷取內容資訊。
句柄必須透過 PeerDistServerCloseContentInformation函式 關閉。
如果 ullContentOffset 和 cbContentLength 都是零,則會擷取整個內容的內容資訊。
規格需求
需求 | 值 |
---|---|
最低支援的用戶端 | Windows 7 專業版 [僅限傳統型應用程式] |
最低支援的伺服器 | Windows Server 2008 R2 [僅限桌面應用程式] |
目標平台 | Windows |
標頭 | peerdist.h |
程式庫 | PeerDist.lib |
Dll | PeerDist.dll |