IWMDRMLicenseQuery::QueryLicenseState 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 QueryLicenseState method queries the local license store for license information that applies to a Key ID for one or more specific rights.

Syntax

HRESULT QueryLicenseState(
  [in]  BSTR                   bstrKID,
  [in]  DWORD                  cActionsToQuery,
  [in]  BSTR                   rgbstrActionsToQuery[],
  [out] DRM_LICENSE_STATE_DATA rgResultStateData[]
);

Parameters

bstrKID [in]

Key ID for which to query. Only licenses that apply to this Key ID will be evaluated.

cActionsToQuery [in]

The number of actions for which to query. This value must be set to the number of elements in the arrays passed for the rgbstrActionsToQuery and rgResultStateData parameters.

rgbstrActionsToQuery[] [in]

Array of one or more rights for which to query. This array must contain as many elements as specified by cActionsToQuery. Each element must be set to one of the following constants.

Constant Description
g_wszWMDRM_LicenseState_Backup Include to query for the details about the right to back up and restore the license.
g_wszWMDRM_LicenseState_CollaborativePlay Include to query for the details about the right to share the content with a group of users as part of a collaborative playback scenario.
g_wszWMDRM_LicenseState_Copy Include to query for the details about the right to copy the content to external devices or media.
g_wszWMDRM_LicenseState_CopyToCD Include to query for the details about the right to copy the content to CD.
g_wszWMDRM_LicenseState_CopyToNonSDMIDevice Include to query for the details about the right to copy the content to a device that does not support the secure digital media initiative (SDMI).
g_wszWMDRM_LicenseState_CopyToSDMIDevice Include to query for the details about the right to copy the content to a device that supports the SDMI.
g_wszWMDRM_LicenseState_CreateThumbnailImage Include to query for the details about the right to create a thumbnail image from the content.
g_wszWMDRM_LicenseState_Playback Include to query for the details about the right to play the content.
g_wszWMDRM_LicenseState_PlaylistBurn Include to query for the details about the right to copy the content to CD as part of a playlist.

rgResultStateData[] [out]

Array of one or more DRM_LICENSE_STATE_DATA structures that receive the license state information that applies to the right in the corresponding element of the rgbstrActionsToQuery parameter.

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

All licenses that apply to the specified Key ID will be searched and evaluated. The results are aggregated, so each DRM_LICENSE_STATE_DATA structure may contain information from multiple licenses.

Requirements

Requirement Value
Header
Wmdrmsdk.h
Library
Wmdrmsdk.lib

See also

IWMDRMLicenseQuery Interface