DRMGetUserRights 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 DRMGetUserRights function retrieves user/right pairs from an issuance license.


  [in]  DRMPUBHANDLE hIssuanceLicense,
  [in]  DRMPUBHANDLE hUser,
  [in]  UINT         uIndex,
  [out] DRMPUBHANDLE *phRight


[in] hIssuanceLicense

The handle of the issuance license to retrieve the user rights from.

[in] hUser

The handle of a user in the issuance license to retrieve the rights for.

[in] uIndex

The zero-based index that indicates which right to retrieve for the specified user. To enumerate all the rights assigned to a user in the issuance license, create a loop starting at zero and incrementing by one. When the function returns E_DRM_NO_MORE_DATA, there are no more rights assigned to that user.

[out] phRight

A pointer to a DRMPUBHANDLE value that receives the handle to the requested right. Call DRMClosePubHandle to close the handle.

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.


This function gets a right associated with a specific user. User rights are added by using the function DRMAddRightWithUser. To enumerate all rights assigned to a user, pass in a user handle and an index value of zero. Continue to call this function, incrementing the index number by one each time, until E_DRM_NO_MORE_DATA is returned.

Call DRMClosePubHandle to close the handle created by calling this function.


Target Platform Windows
Header msdrm.h
Library Msdrm.lib
DLL Msdrm.dll

See also

AD RMS Functions