Share via


FDRM Sample

4/8/2010

The Windows Mobile Software Developer's Kit (SDK) ship with a code sample application named DrmFile that demonstrates how to use the FDRM API, which allow applications to use Digital Rights Management (DRM) protected content. The application displays DRM protected JPEG images.

The code sample demonstrates the standard method for using FDRM content, which involves:

  1. Initially verifying that you will be able to use the content before attempting to open it. The routine CimageView::OpenImageFile demonstrates this step using FileDrmVerifyRights.
  2. Using the FDRM method of opening the file. The routine CimageView::OpenImageFile demonstrates this step using FileDrmCreateFile. This method is used instead of the Win32 CreateFile function.
  3. Specify the right used for the content. The routine CimageView::Draw demonstrates this step using FileDrmCommitRights. For this application, rights to this content are based on the number of times that the content can be used. For this reason, this API is not invoked until after the content opens successfully.

The code sample demonstrates the use of the FileDrmGetMetric function to determine how frequently rights to the protected image need to be re-verified. In addition, it shows how to use the FileDrmIsDRM and FileDrmShowLicenseInfo functions to show the protection status for the JPEG image.

Software Requirements

You must have an FDRM engine installed on your Windows Mobile device.

For your development environment, you must use Visual Studio 2005 or 2008.

Sample Location

To run the code sample, you must install the Windows Mobile 6.5.3 DTK. The solution files are copied to the following folder:

Windows Mobile 6.5.3 DTK\Samples\CPP\Win32\Filedrm\FileDRM.sln

Note

This sample application is not intended for production use.

See Also

Concepts

FDRM Application Development

Other Resources