Windows Media Format SDK banner art
PreviousNext

Creating Digitally Encrypted Content

Users of applications that create digitally packaged content, such as a personal jukebox or CD ripper, should be asked if they want to digitally package the content they create. If a user chooses to create packaged content, then the application must use the IWMHeaderInfo::SetAttribute function to set the following values in the Windows Media file header:

The following example code shows how these values must be set:

BOOL fUseDRM= TRUE;
IWMDRMWriter *pWMDRMWriter;
IWMHeaderInfo *pWMHeaderInfo;
HRESULT hr;

// Initialize pWMDRMWriter appropriately
hr = pWMDRMWriter -> QueryInterface(IID_IWMHeaderInfo, (void**) &pWMHeaderInfo);

hr= pWMHeaderInfo-> SetAttribute(
            0,
            g_wszWMUse_DRM,
            WMT_TYPE_BOOL,
            (BYTE*)&fUseDRM, 
            sizeof(BOOL));
hr= pWMHeaderInfo-> SetAttribute(
            g_wszWMDRM_Flags, 
            WMT_TYPE_DWORD,
            WMT_RIGHT_PLAYBACK | WMT_RIGHT_COPY_TO_NON_SDMI_DEVICE | 
            WMT_RIGHT_COPY_TO_CD,
            sizeof(DWORD));
hr= pWMHeaderInfo-> SetAttribute(
            g_wszWMDRM_Level, 
            WMT_TYPE_DWORD,
            150,
            sizeof(DWORD));

See Also

PreviousNext


© 1999 Microsoft Corporation. All rights reserved.