IWMDRMLicenseManagement::BackupLicenses method

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The BackupLicenses method creates a backup of the licenses in the local license store.

Syntax

HRESULT BackupLicenses(
  [in]  BSTR     bstrBackupDirectory,
  [in]  DWORD    dwFlags,
  [out] IUnknown **ppunkCancelationCookie
);

Parameters

bstrBackupDirectory [in]

UNC path of the location to which the licenses will be backed up.

dwFlags [in]

Flags specifying the backup options to use. The only flag currently supported is WMDRM_BACKUP_OVERWRITE, which configures the method to overwrite any existing backup files in the directory.

ppunkCancelationCookie [out]

Pointer that receives a pointer to the IUnknown interface of an object that identifies this asynchronous call. This interface pointer can be used to cancel the asynchronous call by calling the IWMDRMEventGenerator::CancelAsyncOperation method.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.

Remarks

This method executes asynchronously. It returns immediately after being called and then generates a series of MEWMDRMLicenseBackupProgress events followed by an MEWMDRMLicenseBackupCompleted event when processing is complete. The value of each of the MEWMDRMLicenseBackupProgress events obtained by calling IMFMediaEvent::GetValue is an IUnknown pointer. You can call the QueryInterface method of the retrieved IUnknown interface to get an instance of the IWMDRMLicenseBackupRestoreStatus interface.

For more information about using the asynchronous methods of the Windows Media DRM Client Extended APIs, see Using the Media Foundation Event Model.

Not all licenses are permitted to be backed up. This method only backs up licenses that allow it.

Requirements

Requirement Value
Header
Wmdrmsdk.h
Library
Wmdrmsdk.lib

See also

IWMDRMLicenseManagement Interface