IWMDRMProfile::get_V1LicenseAcquisitionURL
![]() |
The get_V1LicenseAcquisitionURL method retrieves the URL for acquiring version 1 licenses.
Syntax
HRESULT get_V1LicenseAcquisitionURL(
BSTR* pbstrLAINFO
);
Parameters
pbstrLAINFO
[out] Pointer to a BSTR containing the URL for acquiring version 1 licenses.
Return Values
If the method succeeds, it returns S_OK. If it fails, it supports the IErrorInfo interface and returns an HRESULT error code.
| Return code | Number | Description |
| E_POINTER | 0x80004003 | The pointer to the URL is NULL. |
Remarks
Players that support only Windows Media Rights Manager 1 require version 1 licenses, so you need to specify a license acquisition URL where version 1 licenses are issued. If your license provider does not issue version 1 licenses, you can supply a URL that points to a page where users can upgrade to a player that supports Windows Media Rights Manager 7 or later. For example, use https://go.microsoft.com/fwlink/?LinkId=10141 for the put_V1LicenseAcquisitionURL method.
Example Code
// Include libraries.
#include <windows.h>
#include <atlbase.h>
#include <comdef.h>
#include "C:\WMSDK\WMEncSDK9\include\wmencode.h"
#include "C:\WMSDK\WMEncSDK9\include\wmdrmprf.h" // for DRM features
HRESULT hr;
IWMEncoder2* pEncoder;
IWMDRMContentAuthor* pDRM;
IWMDRMProfileCollection* pDRMProColl;
IWMDRMProfile* pDRMPro;
IWMDRMAttributes* pProAttr;
// Initialize the COM library and retrieve a pointer
// to an IWMEncoder interface.
hr = CoInitialize(NULL);
if ( SUCCEEDED( hr ) )
{
hr = CoCreateInstance(CLSID_WMEncoder,
NULL,
CLSCTX_INPROC_SERVER,
IID_IWMEncoder2,
(void**) &pEncoder);
}
// Create an IWMDRMContentAuthor object.
if ( SUCCEEDED( hr ) )
{
hr = pEncoder->get_EncoderDRMContentAuthor(&pDRM);
}
// Retrieve the collection of DRM profiles.
if ( SUCCEEDED( hr ) )
{
hr = pDRM->get_DRMProfileCollection(&pDRMProColl);
}
// Create an IWMDRMProfile object and retrieve a profile.
CComVariant vIndex(0);
if ( SUCCEEDED( hr ) )
{
hr = pDRMProColl->Item(vIndex, &pDRMPro);
}
// Retrieve the properties for the DRM profile.
CComBSTR sDesc;
CComBSTR sLAURL;
CComBSTR sName;
CComBSTR sV1LAURL;
if ( SUCCEEDED( hr ) )
{
hr = pDRMPro->get_Description(&sDesc);
}
if ( SUCCEEDED( hr ) )
{
hr = pDRMPro->get_LicenseAcquisitionURL(&sLAURL);
}
if ( SUCCEEDED( hr ) )
{
hr = pDRMPro->get_Name(&sName);
}
if ( SUCCEEDED( hr ) )
{
hr = pDRMPro->get_V1LicenseAcquisitionURL(&sV1LAURL);
}
// Release pointers.
if ( pDRM )
{
pDRM->Release();
pDRM = NULL;
}
if ( pDRMProColl )
{
pDRMProColl->Release();
pDRMProColl = NULL;
}
if ( pDRMPro )
{
pDRMPro->Release();
pDRMPro = NULL;
}
if ( pProAttr )
{
pProAttr->Release();
pProAttr = NULL;
}
if ( pEncoder )
{
pEncoder->Release();
pEncoder = NULL;
}
Requirements
Header: wmdrmprf.h
Library: wmenc.exe
See Also
.gif)