DRMGetRightExtendedInfo function (msdrm.h)
[The AD RMS SDK leveraging functionality exposed by
the client in Msdrm.dll is available for use in Windows Server 2008, Windows Vista, Windows Server 2008 R2, Windows 7, Windows Server 2012, and Windows 8. It may be altered or
unavailable in subsequent versions. Instead, use Active Directory Rights Management Services SDK 2.1,
which leverages functionality exposed by the client in Msipc.dll.]
The DRMGetRightExtendedInfo function retrieves custom name-value pairs attached to a right.
Syntax
DRMEXPORT HRESULT UDAPICALL DRMGetRightExtendedInfo(
[in] DRMPUBHANDLE hRight,
[in] UINT uIndex,
[in, out] UINT *puExtendedInfoNameLength,
[out] PWSTR wszExtendedInfoName,
[in, out] UINT *puExtendedInfoValueLength,
[out] PWSTR wszExtendedInfoValue
);
Parameters
[in] hRight
The handle of the right to retrieve information from.
[in] uIndex
The zero-based index of the name-value pair to retrieve.
[in, out] puExtendedInfoNameLength
A pointer to a UINT value that, on entry, contains the length, in characters, of the wszExtendedInfoName buffer. This length must include the terminating null character.
After the function returns, this value contains the number of characters, including the terminating null character, that were copied to the wszExtendedInfoName buffer.
[out] wszExtendedInfoName
A pointer to a null-terminated Unicode string that receives the name of the item. The size of this buffer is specified by the puExtendedInfoNameLength parameter.
To determine the required size of this buffer, pass NULL for this parameter. The function will place the size, in characters, including the terminating null character, in the puExtendedInfoNameLength value.
[in, out] puExtendedInfoValueLength
A pointer to a UINT value that, on entry, contains the length, in characters, of the wszExtendedInfoValue buffer. This length must include the terminating null character.
After the function returns, this value contains the number of characters, including the terminating null character, that were copied to the wszExtendedInfoValue buffer.
[out] wszExtendedInfoValue
A pointer to a null-terminated Unicode string that receives the value associated with the name. The size of this buffer is specified by the puExtendedInfoValueLength parameter.
To determine the required size of this buffer, pass NULL for this parameter. The function will place the size, in characters, including the terminating null character, in the puExtendedInfoValueLength value.
Return value
If the function succeeds, the function returns S_OK.
If the function fails, it returns an HRESULT value that indicates the error. Possible values include, but are not limited to, those in the following list. For a list of common error codes, see Common HRESULT Values.
Remarks
The DRMGetRightExtendedInfo method allows a user to add or retrieve arbitrary strings for a right. Applications can use this string to create generic conditions or add any other information associated with a right. These name-value pairs are added in DRMCreateRight as parallel arrays.
To enumerate the existing extended data values, iterate through the index numbers, starting at zero, until the function returns E_DRM_NO_MORE_DATA.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | msdrm.h |
Library | Msdrm.lib |
DLL | Msdrm.dll |