IWMDRMEditor::GetDRMProperty method (wmsdkidl.h)
[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.]
[GetDRMProperty is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use Microsoft PlayReady. ]
The GetDRMProperty method retrieves the specified DRM property.
Syntax
HRESULT GetDRMProperty(
[in] LPCWSTR pwstrName,
[out] WMT_ATTR_DATATYPE *pdwType,
[out] BYTE *pValue,
[out] WORD *pcbLength
);
Parameters
[in] pwstrName
Specifies the DRM file attribute to retrieve.
[out] pdwType
Pointer that receives the data type of the returned value.
[out] pValue
Pointer to the value requested in pwstrName.
[out] pcbLength
Length of pValue in bytes.
Return value
If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.
Remarks
This method retrieves only DRM properties listed below. The file must first be opened using IWMMetadataEditor::Open or IWMMetadataEditor2::OpenEx.
Also, before calling GetDRMProperty on an opened file, always call the helper function WMIsContentProtected to ensure that the file is protected with DRM. It is important to do this because in some cases this method might succeed when called on unprotected content.
The following properties are accessible from this method:
- DRM_IsDRM
- DRM_IsDRMCached
- DRM_BaseLicenseAcqURL
- DRM_Rights
- DRM_LicenseID
- DRM_ActionAllowed_Playback
- DRM_ActionAllowed_CopyToCD
- DRM_ActionAllowed_CopyToSDMIDevice
- DRM_ActionAllowed_CopyToNonSDMIDevice
- DRM_ActionAllowed_Backup
- DRM_DRMHeader_KeyID
- DRM_DRMHeader_LicenseAcqURL
- DRM_DRMHeader_ContentID
- DRM_DRMHeader_IndividualizedVersion
- DRM_DRMHeader_ContentDistributor
- DRM_DRMHeader_SubscriptionContentID
- DRM_LicenseState_Playback
- DRM_LicenseState_CopyToCD
- DRM_LicenseState_CopyToSDMIDevice
- DRM_LicenseState_CopyToNonSDMIDevice
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only],Windows Media Format 9 Series SDK, or later versions of the SDK |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | wmsdkidl.h (include Wmsdk.h) |
Library | Wmvcore.lib; WMStubDRM.lib (if you use DRM) |