DRM 函数和接口

The system driver components Drmk.sys and Portcls.sys implement a collection of DRM functions and interfaces that drivers use for managing the digital rights of kernel-streaming audio content. The Drmk.sys component implements a number of DrmXxx functions, and Portcls.sys implements a DRM-specific set of PcXxx functions, and also the IDrmPort and IDrmPort2 interfaces.

可以使用以下 DRM 函数:

DrmAddContentHandlers

为系统提供一个驱动程序接口,其中包含用于处理受保护内容的函数列表。 DrmCreateContentMixed

创建 DRM 内容 ID,用于标识包含来自多个输入流的混合内容的 KS 音频流。 DrmDestroyContent

删除 DRM 内容 ID。 DrmForwardContentToDeviceObject

对驱动程序进行身份验证,并向其发送系统分配给包含受保护内容的流的 DRM 内容 ID 和内容权限。 DrmForwardContentToFileObject

Obsolete function. DrmForwardContentToInterface

对驱动程序对象进行身份验证,并向其发送系统分配给包含受保护内容的流的 DRM 内容 ID 和内容权限。 DrmGetContentRights

检索系统已分配给 DRM 内容 ID 的 DRM 内容权限。 此列表中的函数在头文件 Drmk.h 中声明。 内核模式 DRMK 系统驱动程序 Drmk.sys导出这些函数的入口点。

在 Windows XP 及更高版本中,PortCls 系统驱动程序 Portcls.sys导出同一组 DRM 函数的不同入口点。 PortCls 函数的名称类似于上一列表中的名称,只不过它们使用前缀 Pc 而不是 Drm:

PcAddContentHandlers

PcCreateContentMixed

PcDestroyContent

PcForwardContentToDeviceObject

PcForwardContentToFileObject

PcForwardContentToInterface

PcGetContentRights

这些函数名称在头文件 Portcls.h 中声明。 Portcls.sys 中的入口点只执行任何作,而不是调用 Drmk.sys中的相应函数。 为方便起见,只需提供 PortCls 入口点,以便已连接到 Portcls.sys 的音频驱动程序不需要显式加载 Drmk.sys。

In Windows XP and later, the same set of functions is also exposed as methods in the IDrmPort and IDrmPort2 interfaces:

IDrmPort2::AddContentHandlers

IDrmPort::CreateContentMixed

IDrmPort::DestroyContent

IDrmPort2::ForwardContentToDeviceObject

IDrmPort::ForwardContentToFileObject

IDrmPort::ForwardContentToInterface

IDrmPort::GetContentRights

The IDrmPort and IDrmPort2 interfaces are declared in header file Portcls.h and are implemented in Portcls.sys. 这些方法只不过在 Drmk.sys中调用相应的函数。 A miniport driver obtains a reference to a IDrmPortx interface by querying its port driver for this interface. The advantage to using a IDrmPortx interface instead of the corresponding DrmXxx or PcXxx functions is that the driver can use this query to determine at run time whether the operating system version supports DRM or not. 这简化了编写单个驱动程序的任务,该驱动程序可在支持 DRM 的较新版本和不支持的较旧版本中运行。 IDrmPort2 is derived from IDrmPort and provides two additional methods.

The WaveCyclic and WavePci port drivers use the IDrmAudioStream interface if it is supported by the corresponding miniport driver. The port driver calls the IDrmAudioStream::SetContentId method to assign DRM protection to the digital content in an audio stream.

The DEFINE_DRMRIGHTS_DEFAULT macro, which is defined in header file Drmk.h, initializes the members of a DRMRIGHTS structure to their default values.