Specifying the Actions To Be Performed

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

When you first call WMCreateReader to create the reader object, the second parameter is a bitwise OR of WMT_RIGHTS values. Use this parameter to specify which action(s) the application will take on the first file to be opened. These actions correspond directly to rights that can be specified in the license. On subsequent calls to IWMReader::Open, you can modify the rights that you are requesting by calling IWMDRMReader::SetDRMProperty, specifying the defined constant for the DRM_Rights property, and using string literals (of type WCHAR) separated by semicolons to identify the rights. The following code snippet requests four rights: play the file, copy it to a device, and play it as part of a collaborative playlist.

WCHAR wszRights[] = L"Play;Copy;CollaborativePlay";
p_WMDRMReader->SetDRMProperty(g_wszWMDRM_Rights, WMT_TYPE_STRING,
                              (BYTE*)wszRights, sizeof(wszRights));

Note

Do not confuse the DRM_Rights property with the DRM_Flags property, which is a DWORD used to specify which rights to apply to a local DRM version 1 license when copying content from a CD.

 

Reading Protected Files