IMFSampleProtection::InitOutputProtection method (mfidl.h)

Retrieves initialization information for sample protection from the upstream component.


HRESULT InitOutputProtection(
  [in]  DWORD dwVersion,
  [in]  DWORD dwOutputId,
  [in]  BYTE  *pbCert,
  [in]  DWORD cbCert,
  [out] BYTE  **ppbSeed,
  [out] DWORD *pcbSeed


[in] dwVersion

Specifies the version number of the sample protection scheme. The version number is specified as a SAMPLE_PROTECTION_VERSION enumeration value.

[in] dwOutputId

Identifier of the output stream. The identifier corresponds to the output stream identifier returned by the IMFTransform interface.

[in] pbCert

Pointer to a certificate provided by the downstream component.

[in] cbCert

Size of the certificate, in bytes.

[out] ppbSeed

Receives a pointer to a buffer that contains the initialization information for downstream component. The caller must free the memory for the buffer by calling CoTaskMemFree.

[out] pcbSeed

Receives the size of the ppbSeed buffer, in bytes.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
The method succeeded.
Not implemented.


This method must be implemented by the upstream component. The method fails if the component does not support the requested sample protection version. Downstream components do not implement this method and should return E_NOTIMPL.


Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header mfidl.h
Library Mfuuid.lib

See also