Compartir a través de


IWMReaderAdvanced6::SetProtectStreamSamples method (wmsdkidl.h)

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The SetProtectStreamSamples method configures sample protection.

Syntax

HRESULT SetProtectStreamSamples(
  [in]      BYTE  *pbCertificate,
  [in]      DWORD cbCertificate,
  [in]      DWORD dwCertificateType,
  [in]      DWORD dwFlags,
  [out]     BYTE  *pbInitializationVector,
  [in, out] DWORD *pcbInitializationVector
);

Parameters

[in] pbCertificate

Buffer containing the certificate to use for protection.

[in] cbCertificate

Size of the certificate in bytes.

[in] dwCertificateType

Type of certificate passed in pbCertificate. The only supported type is WMDRM_CERTIFICATE_TYPE_XML.

[in] dwFlags

The type of session protection to use for re-encoding. The only supported type is WMDRM_PROTECTION_TYPE_RC4.

[out] pbInitializationVector

Receives the initialization vector. The initialization vector is OEAP-encrypted with the RSA public key found in the certificate. Set to NULL to receive the required buffer size in pcbInitializationVector.

[in, out] pcbInitializationVector

On input, the size of the buffer passed as pbInitializationVector. On output, the size of the used portion of the buffer. If you pass NULL for pbInitializationVector, this value is set to the required buffer size on output.

Return value

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

Return code Description
NS_E_DRM_RIV_TOO_SMALL
An updated content revocation list is needed.
S_OK
The method succeeded.

Remarks

The constants used for dwCertificateType and dwFlags are defined in wmdrmsdk.h.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only],Windows Media Format 11 SDK
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header wmsdkidl.h (include Wmsdk.h)
Library WMStubDRM.lib

See also

IWMReaderAdvanced6 Interface