다음을 통해 공유


WMRMRestrictions.AddRestriction

banner art

Previous Next

WMRMRestrictions.AddRestriction

The AddRestriction method specifies protection levels for different types of output.

Syntax

  WMRMRestrictions.AddRestriction(val, level)

Parameters

val

[in] A value from the WMRM_RESTRICTION_TYPE enumeration that specifies the type of output for which you are setting a protection level.

level

[in] A DWORD that specifies the minimum level of protection you want to require. It must be one of the following values. For information about the current output protection levels, see the document WMRM SDK Compliance Rules that accompanied your license agreement from Microsoft.

Return Values

This method does not return a value.

Remarks

A protection level indicates the minimum level of security you want to require for a specific type of output. For example, you can require that your compressed digital audio content can be played only by using technologies that use a minimum of low encryption technology. Or, you can specify that content can be transferred only to devices that meet protection level 400.

By default, protection levels are not set.

Example Code

' Set playback and copy restrictions.
Dim RestrictObj              ' WMRMRestrictions object
Dim PlayRestrictions         ' Playback restrictions
Dim CopyRestrictions         ' Copy restrictions

Set RestrictObj = Server.CreateObject("WMRMObjs.WMRMRestrictions")

' Set output protection levels for playback.  
Call RestrictObj.AddRestriction(1, 300)  ' Uncompressed digital video
Call RestrictObj.AddRestriction(2, 500)  ' Compressed digital video
Call RestrictObj.AddRestriction(3, 200)  ' Analog video
Call RestrictObj.AddRestriction(4, 200)  ' Compressed digital audio
Call RestrictObj.AddRestriction(5, 200)  ' Uncompressed digital audio

' Add an extended technology for playing analog video.
Call RestrictObj.AddExtension("{C3FD11C6-F8B7-4d20-B008-1DB17D61F2DA}", 1)

' Get the playback restrictions string.
PlayRestrictions = RestrictObj.GetRestrictions

' Set output protection levels for copying.  
Set RestrictObj = Nothing
Set RestrictObj = Server.CreateObject("WMRMObjs.WMRMRestrictions")

Call RestrictObj.AddRestriction(6, 400)    ' Copied output.

' Get the copy restrictions string.
CopyRestrictions = RestrictObj.GetRestrictions

Requirements

Version: Windows Media Rights Manager 10 SDK or later

Reference: wmrmobjs 1.0 Type Library

Library: wmrmobjs.dll

Platform: Windows Server 2003

See Also

Previous Next

© 2007 Microsoft Corporation. All rights reserved.