How to determine the use rights (DRM) file

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

  • Is it protected by DRM?
  • (then, hopefully) DRM protection details (for example, when a license expires, etc.)?

Is there any C # / C ++ api for it? It looks like Windows Media Player can do this - if you click the properties in this file ... but Explorer does not show this information.

Note. I do not believe this is a trivial question, I tried taglib and searched the web solution to solve for about 2 hours.

+3
source share
2 answers

From here . Learn more about the SDK format here.

# SDK:

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

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

DRM Powershell: -

$wmplayer = New-Object -ComObject "WMPlayer.OCX"
ls -recurse | ? { $_.Name -like "*.wma" -and [bool]::Parse($wmplayer.newMedia($_.FullName).getItemInfo("Is_Protected")) }
+7

Source: https://habr.com/ru/post/1727876/


All Articles