IWMDRMLicenseManagement::CleanLicenseStore 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 CleanLicenseStore method removes unusable licenses from the temporary license store and defragments the local license store to improve performance.

Syntax

HRESULT CleanLicenseStore(
  [in]  DWORD    dwFlags,
  [out] IUnknown **ppunkCancelationCookie
);

Parameters

dwFlags [in]

Flags specifying the license store cleaning options to use. Set to one of the constants in the following table.

Constant Description
WMDRM_CLEAN_LICENSE_STORE_SYNC The clean operation will be performed synchronously. This method will not return until the operation is complete.
WMDRM_CLEAN_LICENSE_STORE_ASYNC The clean operation will be performed asynchronously. This method will return immediately. When the operation is complete, the media event MELicenseStoreCleaned will be sent.

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.
DRM_E_LICENSENOTFOUND
There is no temporary license store on the client computer.

Remarks

This method executes asynchronously. It returns immediately after being called and then generates an MEWMDRMLicenseStoreCleaned event when processing is complete.

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

Requirements

Requirement Value
Header
Wmdrmsdk.h
Library
Wmdrmsdk.lib

See also

IWMDRMLicenseManagement Interface