DRMGetInfo 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 DRMGetInfo function retrieves information about encrypting or decrypting objects.
DRMEXPORT HRESULT UDAPICALL DRMGetInfo(
[in] DRMHANDLE handle,
[in] PWSTR wszAttribute,
[out] DRMENCODINGTYPE *peEncoding,
[in, out] UINT *pcBuffer,
[out] BYTE *pbBuffer
);
[in] handle
Specifies the handle to query. This can be created by using one of the following functions:
[in] wszAttribute
The attribute of the handle to query for. The supported attributes are g_wszQUERY_BLOCKSIZE, to determine the block size, and g_wszQUERY_SYMMETRICKEY_TYPE, to determine whether the cipher mode is AES ECB or AES CBC 4K.
[out] peEncoding
Pointer to a DRMENCODINGTYPE enumeration that identifies the type of encoding to be applied to the information retrieved.
[in, out] pcBuffer
A pointer to a UINT value that, on input, contains the size of the buffer pointed to by the pbBuffer parameter. The size of the buffer is expressed as the number of Unicode characters, including the terminating null character. On output, the value contains the number of characters copied to the buffer. The number copied includes the terminating null character.
[out] pbBuffer
A pointer to a null-terminated Unicode string that receives the value associated with the attribute specified by the wszAttribute parameter. The size of this buffer is specified by the pcBuffer parameter. The size is expressed as the number of Unicode characters, including the terminating null character.
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.
Memory allocation and deallocation are handled by the caller. To create a buffer and retrieve information, call this function twice.
- Set pbBuffer to NULL and call DRMGetInfo. The function returns the required number of Unicode characters, including the terminating NULL character, in the pcBuffer parameter.
- Allocate memory for the buffer. Remember that a Unicode character is two bytes long.
- Call DRMGetInfo again with pbBuffer equal to the pointer you created when allocating the buffer.
- Free the allocated memory when you are finished using it.
To retrieve information about the secure environment, you can call the DRMGetEnvironmentInfo function.
Requirement | Value |
---|---|
Target Platform | Windows |
Header | msdrm.h |
Library | Msdrm.lib |
DLL | Msdrm.dll |