Expand Minimize

DRMGetUserRights function

[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.0, which leverages functionality exposed by the client in Msipc.dll.]

The DRMGetUserRights function retrieves user/right pairs from an issuance license.

Syntax


HRESULT DRMGetUserRights(
  _In_   DRMPUBHANDLE hIssuanceLicense,
  _In_   DRMPUBHANDLE hUser,
  _In_   UINT uIndex,
  _Out_  DRMPUBHANDLE *phRight
);

Parameters

hIssuanceLicense [in]

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

hUser [in]

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

uIndex [in]

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.

phRight [out]

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 table. For a list of common error codes, see Common HRESULT Values.

Return codeDescription
E_DRM_NO_MORE_DATA

The index number requested lies beyond the valid range.

 

Remarks

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.

Requirements

Product

Rights Management Services client 1.0 SP2 or later

Header

Msdrm.h

Library

Msdrm.lib

DLL

Msdrm.dll

See also

AD RMS Functions
DRMAddRightWithUser
DRMGetUsers

 

 

Show:
© 2014 Microsoft