Question

Suppose you have a .wma / .wmv file and you want to detect:

  1. is it DRM protected ?
  2. (then hopefully) details of the DRM protection (like when does the license expire etc.)?

Is there a C# / C++ api for it? It seems that Windows Media Player can do it - if you click properties on that file... but Explorer does not show this info.

Note: I do not belive this is a trivial question, I have tried taglib and searched the web for a solution for about 2 hours now.

Was it helpful?

Solution

From Here. More info on the Format SDK here

In c# using the Format SDK:

[DllImport("WMVCore.dll", CharSet=CharSet.Unicode)]

private static extern int WMIsContentProtected(string pwszFileName, out bool 
pfIsProtected);

OTHER TIPS

One method of detecting DRM files under a folder using Powershell is: -

$wmplayer = New-Object -ComObject "WMPlayer.OCX"
ls -recurse | ? { $_.Name -like "*.wma" -and [bool]::Parse($wmplayer.newMedia($_.FullName).getItemInfo("Is_Protected")) }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top