Compartilhar via


License Acquisition (Windows CE 5.0)

Send Feedback

License acquisition is the process of obtaining a license from a DRM license server to allow your device to play back DRM-protected content. Licenses are associated with the combination of a specific device and a specific piece of content.

Windows CE-based devices cannot act as DRM license servers.

The process of license acquisition can be either silent or nonsilent:

  • In a silent acquisition, the entire process of negotiating the request for, and acceptance of, the license takes place between the Windows CE-based device and the licensing server without any user input or interaction.
  • In a nonsilent license acquisition, the user will be asked for information and confirmation before the digital certificate is transferred. This process is facilitated by the license acquisition OCX.

A platform can support both silent and nonsilent license acquisition methods. The following diagram shows a typical method for integrating both methods into a single architecture.

ms923437.cxdrmlicenseacquisition(en-us,MSDN.10).gif

The license acquisition OCX can only be hosted inside of a Web page. It acts as the bridge between the Web-based interface that a content owner would use to gather information to generate licenses and the DRM license server. The license acquisition OCX is required to support nonsilent license acquisitions. This OCX is used exclusively by the DRM components in Windows CE.

Nonsilent License Acquisition

Nonsilent acquisition occurs when a piece of content is DRM-protected and the license server indicates that direct user interaction is required in order to acquire the license. This user interaction is initiated by the Windows Media splitter and results in a call to ShellExecuteEx to launch the browser and load a web page specified by the license server. This web page will in turn redirect the browser to a web page used by the content provider to manage the process of authorizing the user to receive the license.

After the interaction with the user is completed and the license has been authorized, the licensing server sends the license to the device. The browser then loads the license acquisition OCX (cedrm2.dll) and the OCX consumes the license and writes it to the license store. This completes the transaction for acquiring the license.

In this process, the user had to navigate away from the web page containing the content they were originally trying to play. The user will probably want to immediately return to the content once the license is acquired. Windows CE provides a way to notify the client that a DRM license acquisition process is complete. This allows your application to manage the user experience after the license is acquired. Your application could, for example, automatically redirect the browser to the original content if the license acquisition was successful.

Upon completing the license acquisition process, the license acquisition OCX makes an internal call to IDocHostUIHandler::GetExternal to obtain an IDispatch interface from the browser's host application. For information on IDocHostUIHandler see the Advanced Hosting Reference in the Internet Explorer Browser Control Host documentation.

Once the OCX obtains the IDispatch interface, it calls the LicenseAcquired method, which you must implement in your browser's host application. This function has one parameter, a BOOL where a value of TRUE indicates that a license has been acquired and FALSE otherwise.

You must make provision within your browser's host application to support the license acquisition OCX's internal calling sequence. The following code shows how to enable the GetExternal method inside your browser's host application so it can return the IDispatch interface to the OCX.

// IDocHostUIHandler methods
STDMETHOD(GetExternal)(IDispatch **ppDispatch) 
{
  *ppDispatch = (IDispatch *)this;
  return S_OK;
}

Your application can implement a separate object for IDispatch requests instead of using this in GetExternal.

When a license is acquired the OCX initiates a call to IDispatch::Invoke. This means that your implementation of IDispatch::Invoke requires a new dispatch ID. The following code shows how to create the dispatch ID.

#define DISPID_LICENSEACQUIRED    /* Provide your ID number here */

[id(DISPID_LICENSEACQUIRED), helpstring("Fired when License is
acquired."), helpcontext(0x0000)]

HRESULT LicenseAcquired([in] VARIANT_BOOL varResult );

The following code shows how you can modify your IDispatch::Invoke method.

case DISPID_LICENSEACQUIRED :
  VARIANT_BOOL fAcquired;
  fAcquired = pdparams->rgvarg[0].boolVal;
  LicenseAcquired( fAcquired ) ;
  break ;

The following code shows a possible definition for your LicenseAcquired method.

HRESULT   LicenseAcquired( VARIANT_BOOL varRestult )
{
  MessageBox(NULL, L"License", "Notification",MB_OK|MB_ICONSTOP);

  /* ... Handle the outcome of the license acquisition ... */

  return S_OK ;
}

At this point, your application has received notification on the status of the license. From here you can control the user experience of a successful or failed license acquisition.

See Also

DRM Application Development

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.