Freigeben über


Windows Media Rights Manager SDK banner art

WMRMRights.ExcludeApplication

The ExcludeApplication method specifies the application ID of a player that you want to prevent from accessing your protected files.

Syntax

WMRMRights.ExcludeApplication(dwAppID)

Parameters

dwAppID

[in] DWORD containing the application ID of the player to exclude.

Return Values

This method does not return a value.

Remarks

Only players based on the Windows Media Format 7.1 or later SDK can interpret this right. You can use the WMRMChallenge.CheckClientCapability method to find out whether a player is based on Windows Media Format 7.1 SDK or a later version, and then specify the rights accordingly.

You can exclude any player from using your packaged files; the player does not have to be revoked in order for you to exclude it. You can find the application ID of a player when you receive a license request from it by using the SUBJECTID2 attribute with the WMRMChallenge.ClientAttribute property.

Call this method once for every player to exclude.

You can also determine whether a player has been excluded before you issue a license by using the WMRMLicGen.IsClientExcluded property. However, this WMRMRights.ExcludeApplication method is useful when enforcing application exclusion after a license has been issued. For example, a consumer might try to use a different player than the one used to acquire the license, or you might choose to predeliver licenses.

Example Code

' Before you can issue a license, you must specify the consumer's
' rights and set them in the WMRMLicGen object.

' Declare objects.
    Dim sRights
    Dim RightsObj
    Dim LicGenObj

' Create objects.
    Set RightsObj = Server.CreateObject("Wmrmobjs.WMRMRights")
    Set LicGenObj = Server.CreateObject("Wmrmobjs.WMRMLicGen")

' Reset the WMRMRights object.
    RightsObj.Reset()

' Specify the rights that will be granted to the consumer.
    RightsObj.AllowBackupRestore = True
    RightsObj.AllowPlay = True
    RightsObj.BeginDate = "#20050101Z#"
    RightsObj.ExpirationDate = "#20051231Z#"
    RightsObj.DisableOnClockRollback = True

' Exclude two applications. 
    RightsObj.ExcludeApplication(123)
    RightsObj.ExcludeApplication(456)

' Retrieve the string containing the rights.
    sRights = RightsObj.GetAllRights()

' Set the rights in the license generator.
    LicGenObj.Rights = sRights

' Continue the license issuing process.

Requirements

Version: Windows Media Rights Manager 7 SDK or later

Reference: wmrmobjs 1.0 Type Library

Library: wmrmobjs.dll

Platform: Windows Server 2003

See Also