Previous Next

DRM Functions

This section describes the DRM functions, which support Digital Rights Management of kernel-streaming audio content in Windows Me, and Microsoft® Windows® XP and later.

The following DRM functions are described:

DrmAddContentHandlers

DrmCreateContentMixed

DrmDestroyContent

DrmForwardContentToDeviceObject

DrmForwardContentToFileObject

DrmForwardContentToInterface

DrmGetContentRights

The functions in this list are declared in header file drmk.h. The kernel-mode DRMK system driver, drmk.sys, exports the entry points for these functions. The DrmAddContentHandlers and DrmForwardContentToDeviceInterface functions are supported only in Windows XP and later. The other functions in the list are supported in both Windows Me, and Windows XP and later.

In Windows XP and later, the PortCls system driver, portcls.sys, exports a different set of entry points for the same set of DRM functions. The names of the PortCls functions are similar to those in the previous list, except that they use the prefix Pc instead of Drm:

PcAddContentHandlers

PcCreateContentMixed

PcDestroyContent

PcForwardContentToDeviceObject

PcForwardContentToFileObject

PcForwardContentToInterface

PcGetContentRights

These function names are declared in header file portcls.h. The entry points in portcls.sys do nothing more than call the corresponding functions in drmk.sys. The PortCls entry points are provided simply for convenience so that an audio driver that is already connected to portcls.sys does not need to explicitly load 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 IDrmPortx interfaces are declared in header file portcls.h and are implemented in portcls.sys. These methods do nothing more than call the corresponding functions in 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. This simplifies the task of writing a single driver that can run both in newer versions of Windows that support DRM and in older versions that do not. IDrmPort2 is derived from IDrmPort and provides two additional methods.

In addition to the DrmXxx functions mentioned previously, this section also describes the DEFINE_DRMRIGHTS_DEFAULT macro.