共用方式為


取得驅動程式憑證鏈結

[與此頁面相關的功能 DirectShow是舊版功能。 它已被 MediaPlayerIMFMediaEngineMedia Foundation 中的音訊/視訊擷取取代。 這些功能已針對Windows 10和Windows 11進行優化。 Microsoft 強烈建議新程式碼盡可能使用 MediaPlayerIMFMediaEngine音訊/視訊擷取 ,而不是 DirectShow。 Microsoft 建議使用舊版 API 的現有程式碼盡可能重寫為使用新的 API。

若要使用認證輸出保護通訊協定 (COPP) ,應用程式必須先建置 DirectShow 圖表,其中包含視訊混合轉譯篩選 (VMR-7 或 VMR-9) 。 較舊的影片轉譯器篩選不支援 COPP。 呼叫任何 COPP 方法之前,應用程式必須建置視訊播放圖表,並將解碼器連線到 VMR 篩選器的輸入針腳。 不需要播放視訊檔案。

建置圖形之後,請查詢 IAMCertifiedOutputProtection 介面的 VMR,然後呼叫 IAMCertifiedOutputProtection::KeyExchange。 這個方法會傳回輸入為 GUID 的 128 位亂數,以及位元組陣列的指標,其中包含 UTF-8 格式的驅動程式 XML 憑證鏈結。 下列程式碼示範如何取得憑證鏈結。

GUID guidRandom;
BYTE *pbCertificateChain = NULL;
DWORD cbCertificateChainLen;   // Size of the certificate chain, in bytes.
hr = pCOPP->KeyExchange(&guidRandom, &pbCertificateChain,
         &cbCertificateChainLen);
if (SUCCEEDED(hr))
{
    // TODO: Validate the certificate chain and get the driver's
    // public key. 

    // When you are done, free the buffer that contains the 
    // certificate chain.
    CoTaskMemFree(pbCertificateChain);
}

使用認證輸出保護通訊協定 (COPP)