IWMDRMLicenseQuery::QueryActionAllowed 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 QueryActionAllowed method performs a query on the local license store to retrieve the license status for one or more DRM actions that apply to a specified Key ID.

Syntax

HRESULT QueryActionAllowed(
  [in]  BSTR  bstrKID,
  [in]  BSTR  bstrMinReqIndivVersion,
  [in]  DWORD cActionsToQuery,
  [in]  BSTR  rgbstrActionsToQuery[],
  [out] DWORD rgdwQueryResult[]
);

Parameters

bstrKID [in]

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

bstrMinReqIndivVersion [in]

The minimum security version specified in the header of the ASF file. This parameter is optional. Pass NULL to perform the query without this information.

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 rgdwQueryResult 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_ActionAllowed_Playback Include to query for the right to play the content.
g_wszWMDRM_ActionAllowed_Copy Include to query for the right to copy the content to external devices or media.
g_wszWMDRM_ActionAllowed_PlaylistBurn Include to query for the right to copy the content to CD as part of a playlist.
g_wszWMDRM_ActionAllowed_CreateThumbnailImage Include to query for the right to create a thumbnail image from the content.
g_wszWMDRM_ActionAllowed_CopyToCD Include to query for the right to copy the content to CD.

rgdwQueryResult[] [out]

Array of one or more DWORD variables that receive the results of the query for the rights specified by rgbstrActionsToQuery. If an action is allowed, the corresponding element is set to zero. If an action is not allowed, the element is set to one or more values of the DRM_ACTION_ALLOWED_QUERY_RESULTS enumeration combined by using the bitwise OR operation. This array must contain as many elements as specified by cActionsToQuery.

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

When querying for play and copy rights, you will get more accurate results by first setting environmental parameters. Use the SetActionAllowedQueryParams method to set the environmental parameters. The results of queries for the burn right are unaffected by the environmental parameters; you can safely use the defaults.

The results returned by the QueryActionAllowed method are aggregated from zero or more licenses in the local license store. The method may not search all of the licenses that apply to the Key ID if it encounters an enabled result.

Requirements

Requirement Value
Header
Wmdrmsdk.h
Library
Wmdrmsdk.lib

See also

IWMDRMLicenseQuery Interface

Querying for Simple Rights Information