IWMDRMLicenseManagement::RestoreLicenses 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 RestoreLicenses method restores licenses from a license backup that was created by calling the BackupLicenses method.

Syntax

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

Parameters

bstrBackupDirectory [in]

UNC path of the location from which the licenses will be restored.

dwFlags [in]

Flags specifying the restore options to use. The only flag currently supported is WMDRM_RESTORE_INDIVIDUALIZE, which configures the method to perform individualization as part of the restoration, if required.

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 MEWMDRMLicenseRestoreProgress events followed by an MEWMDRMLicenseRestoreCompleted event when processing is complete. The value of each of the MEWMDRMLicenseRestoreProgress 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.

The backup can be from the local machine or from a different machine.

Requirements

Requirement Value
Header
Wmdrmsdk.h
Library
Wmdrmsdk.lib

See also

IWMDRMLicenseManagement Interface