Non-Silent License Acquisition

[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.]

Non-silent license acquisition enables the license provider to interact with the end user through a Web page, as an intermediate step in the license acquisition process. Non-silent license acquisition is initiated in response to a user trying to access protected content.

To perform non-silent license acquisition, use the following steps:

  1. Call the IWMDRMLicenseManagement::AcquireLicense method. Pass in the DRM header from the protected file as the bstrHeaderData parameter. Specify what rights you want the license to grant in the bstrActions parameter. Finally, set the dwFlags parameter to WMDRM_ACQUIRE_LICENSE_NONSILENT.
  2. Trap events for the IWMDRMLicenseManagement interface. When you receive the MEWMDRMLicenseAcquisitionCompleted event, get its associated value by calling IMFMediaEvent::GetValue. The value should be of type VT_UNKNOWN, a pointer to an IUnknown interface.
  3. Call the QueryInterface method of the IUnknown interface retrieved in step 2 to get the IWMDRMNonSilentLicenseAquisition interface.
  4. Call IWMDRMNonSilentLicenseAquisition::GetChallenge to retrieve the license challenge. Also call IWMDRMNonSilentLicenseAquisition::GetURL if you do not have the URL of the license server already.
  5. Send the challenge to the Web page specified by the URL.

Acquiring Licenses

Using the Media Foundation Event Model