Freigeben über


Windows Media Rights Manager SDK banner art

WMRMRights.SetSAPMode

The SetSAPMode method specifies the secure audio path (SAP) mode required for a license.

The SAP mode is set automatically when you specify a protection level of 300 or 400 for digital audio output. For more information, see Output Protection Levels for Playback.

Syntax

WMRMRights.SetSAPMode(varAllowDigitalOut, varCheckDriverCerts, varMinDriverSecurity)

Parameters

varAllowDigitalOut

[in] Variant indicating whether the license permits digital output.

varCheckDriverCerts

[in] Variant indicating whether the license requires the DRM kernel component to verify that all drivers in the audio stack have been certified by Microsoft as SAP-compliant.

varMinDriverSecurity

[in] Variant indicating the minimum driver security level that SAP requires for playback.

Return Values

This method does not return a value. If the method succeeds, it sets S_OK in the error object. Otherwise, it sets 0x80020005 in the error object.

Remarks

Secure Audio Path (SAP) is only supported on Windows Millennium Edition and Windows XP. Therefore, this method should only be called when delivering a license to a computer that is running one of these operating systems.

Parameter Description
varAllowDigitalOut Set this parameter to False to disable digital output on the audio card while your content is being played. If this parameter is set to True, a consumer can make a digital copy of your content by using the digital output from the sound card.
varCheckDriverCerts Set this parameter to True if you want your content to be played only with audio drivers that have been certified by Microsoft as SAP-compliant. If this parameter is set to False, your content can be played with non-certified audio drivers.
varMinDriverSecurity This parameter specifies the minimum security level for SAP-compliant audio drivers that can access your content. The security level of all SAP-compliant audio drivers for Windows Millennium Edition is set to 1100. The security level of all SAP-compliant audio drivers for Windows XP is set to 1200.

For high-security content, it is recommended that you set varAllowDigitalOut to False and varCheckDriverCerts to True. However, not all audio drivers for Windows Millennium Edition are certified as SAP-compliant. If having your content reach a broader audience is more important than security, you can allow non SAP-compliant drivers to play your content by setting varAllowDigitalOut to False and varCheckDriverCerts to False. In this case, the DRM components still use SAP to protect your content until it reaches the audio kernel. However, the DRM components cannot ensure that your content remains protected in the kernel when you allow the use of non SAP-compliant audio drivers.

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

' Require SAP-certified drivers,disable digital output, allow playback on Windows Me and Windows XP
    RightsObj.SetSAPMode(False,True,1100)

' 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