Converting a DRM-Protected File to a Windows Media DRM 10 for Network Devices Stream

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

After a device is registered and validated, you can begin processing license request messages from it. License request messages are sent by devices when action from the application is needed. The only action currently supported is "Play", which is a request for secure data for playback.

When you receive a license request message, you should perform the following steps:

  1. Parse the license request message by calling the IWMDRMMessageParser::ParseLicenseRequestMsg method.
  2. Get the IWMRegisteredDevice interface for the device by calling the IWMDeviceRegistration::GetRegisteredDeviceByID method, passing in the certificate and serial number obtained in step 1.
  3. Verify that the device is ready to receive secure data:
  4. Create an instance of the DRM transcryptor object by calling the WMCreateDRMTranscryptor function.
  5. Call the IWMDRMTranscryptor::Initialize method to initialize the transcryptor. This method takes a pointer to your implementation of the IWMStatusCallback interface, which it uses to deliver status messages. This method also returns a license request message that must be sent to the device before continuing.
  6. When your application's IWMStatusCallback::OnStatus method receives the WMT_TRANSCRYPTOR_INIT status message, call the IWMDRMTranscryptor::Seek method to seek to the appropriate start position in the file. To start at the beginning of the file, you must call Seek with time 0.
  7. The transcryptor sends a WMT_TRANSCRYPTOR_SEEKED message when it is ready to deliver data from the file at the new presentation time. Make repeated calls to the IWMDRMTranscryptor::Read method to get converted chunks of media data. Each call is asynchronous and is not complete until a WMT_TRANSCRYPTOR_READ message is received. When you receive the message, you can send the data to the receiving device.
  8. When you receive a WMT_TRANSCRYPTOR_READ message with the hr parameter set to NS_S_TRANSCRYPTOR_EOF, the entire file has been read. At this point, call the IWMDRMTranscryptor::Close method to close the file and free resources.
  9. When the WMT_TRANSCRYPTOR_CLOSED message is received, you can release the IWMDRMTranscryptor interface.

Note

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

 

Using the Windows Media DRM 10 for Network Devices Protocol