Reading Protected Files

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

Reading a DRM-protected file or network stream basically involves attempting to open the file (or connect to the stream) and then handling any events that might be sent from the DRM components.

If a player is not DRM-enabled (does not link to a valid wmstubdrm.lib library) the IWMReader::Open call fails when it tries to open a protected file and returns NS_E_PROTECTED_CONTENT or some related error.

When a DRM-enabled application attempts to open a DRM-protected file, the DRM component automatically searches the local system for a valid license. If one is found, the DRM component automatically decrypts the file in a way that is completely transparent to the application. The action that an application may perform on the decrypted file depends on the rights specified in the license. For a full description of possible rights, see the Windows Media Rights Manager SDK documentation.

If the application does not have a valid license for a file, the player receives a status notification from the DRM component. The player application can then initiate the license acquisition process. After a valid license has been received, the file can be accessed. The following sections describe the basic tasks that an application must perform in implementing the license acquisition process:

Note

DRM is not supported by the x64-based version of this SDK.

 

Digital Rights Management Features

DRM Attribute List

DRM Properties

Enabling DRM Support