DRM Support in DirectShow

[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 and writing DRM-protected files in DirectShow is done in basically the same way as when you use the Windows Media Format SDK directly. To begin with, you need the wmstubdrm static library, which is obtained separately from Microsoft. In addition, you must implement the IKeyProvider interface to enable your application to access the Windows Media Format SDK run-time objects when DRM is enabled.

When applying DRM version 1 protection, use the IWMHeaderInfo interface, which is obtained as described in Reading ASF Files in DirectShow. When applying DRM version 7 protection, obtain the IWMDRMWriter interface by calling QueryService on the WM ASF Writer filter, as shown in the code snippet later in this topic.

All other DRM-specific configuration is exactly the same as described in Enabling DRM Support. Use QueryService to obtain the IWMDRMReader interface from the WM ASF Reader filter.

DirectX 9.0 contains a sample, PlayWndASF, a DRM-enabled DirectShow player application that demonstrates DRM version 1 and version 7 license acquisition. This sample also includes an implementation of the CKeyProvider class, which supports the IKeyProvider interface.