WM_GET_LICENSE_DATA structure
[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 WM_GET_LICENSE_DATA structure contains information about where to acquire a DRM license.
Syntax
typedef struct _WMGetLicenseData {
DWORD dwSize;
HRESULT hr;
WCHAR *wszURL;
WCHAR *wszLocalFilename;
BYTE *pbPostData;
DWORD dwPostDataSize;
} WM_GET_LICENSE_DATA;
Members
-
dwSize
-
DWORD containing the size of the WM_GET_LICENSE_DATA structure, in bytes.
-
hr
-
HRESULT return code.
-
wszURL
-
Wide-character null-terminated string containing the license acquisition URL. Use this string and the pbPostData string in non-silent license acquisition.
-
wszLocalFilename
-
Wide-character null-terminated string containing a local HTML page that is generated by the DRM component. When this string is loaded into a browser, it automatically redirects the HTTP request to the license acquisition URL, along with the necessary post data. Use of this local URL is now deprecated. The recommended approach is to use the wszURL and pbPostData strings.
-
pbPostData
-
Pointer to a byte array containing the data to be posted to the license acquisition URL. You must add the following string to the beginning of the pbPostData string: "nonsilent=1&challenge=". The resulting string should then be appended to wszURL when you form the HTTP request.
-
dwPostDataSize
-
DWORD that indicates the size of pbPostData without the "nonsilent=1&challenge=" string referred to in pbPostData.
Remarks
This filled-in structure is returned in the pValue parameter of the IWMStatusCallback::OnStatus method if WMT_STATUS equals WMT_NO_RIGHTS_EX or WMT_ACQUIRE_LICENSE. For WMT_NO_RIGHTS_EX events, the hr member will be NS_E_LICENSE_REQUIRED, NS_E_LICENSE_OUTOFDATE, or NS_E_LICENSE_INCORRECT_RIGHTS. Any of these errors indicates that a new license must be acquired by navigating to the URL in the wszURL member.
For WMT_ACQUIRE_LICENSE events, the hr member will pass the SUCCEEDED macro if a license was successfully acquired. If this event is received after an attempt at silent acquisition, and hr equals NS_E_DRM_LICENSE_NOTACQUIRED, it indicates that only non-silent acquisition is supported by the license server for this license.
The Audioplayer sample application demonstrates how to correctly use the information returned in this structure.
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows 2000 Professional [desktop apps only] |
Minimum supported server |
Windows 2000 Server [desktop apps only] |
Version |
Windows Media Format 7 SDK, or later versions of the SDK |
Header |
|