Expand Minimize

DRMGetUnboundLicenseObject 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 DRMGetUnboundLicenseObject function retrieves an object of a specified type in an unbound license.

Syntax


HRESULT DRMGetUnboundLicenseObject(
  _In_   DRMQUERYHANDLE hQueryRoot,
  _In_   PWSTR wszSubObjectType,
  _In_   UINT iIndex,
  _Out_  DRMQUERYHANDLE *phSubQuery
);

Parameters

hQueryRoot [in]

A handle to a license or object in the license, created using DRMGetUnboundLicenseObject or DRMParseUnboundLicense.

wszSubObjectType [in]

Name of the object to find.

iIndex [in]

Zero-based index indicating which instance to retrieve, if more than one exists.

phSubQuery [out]

The retrieved object. Call DRMCloseHandle 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_BADGETINFOQUERY

The requested attribute cannot exist in the object specified.

E_DRM_NO_MORE_DATA

No license or certificate exists at the specified index.

E_DRM_QUERY_REPORTS_NO_RESULTS

No instances of the requested attribute exist.

 

Remarks

Each object can have several instances within a license. A license may contain many rights objects, for example. In this case, it may be necessary to iterate through all the objects in this class by first calling DRMGetUnboundLicenseObjectCount to get a count of existing objects, and then looping through all instances, starting at zero and incrementing the iWhich value by one. If a specific object is sought, each retrieved object can be queried for its attributes, such as its name.

This query will search only at the level immediately below the passed in object. So, for example, if the root license handle is passed in and the attribute to find is g_wszQUERY_OWNER, the query will find nothing because the OWNER object appears at the second level or deeper (counting the license root as level 0).

The wszSubObjectType parameter identifies an XrML node value as shown in the following example. Using g_wszQUERY_OBJECTTYPE in a query would return "Group Identity Licensor." The only object you can query for in an issuance license is g_wszQUERY_DISTRIBUTIONPOINT.


<PRINCIPAL internal-id="1">
  <OBJECT type="Group Identity Licensor">
  <ID type="Group Identity">someone@example.com</ID>
  <NAME>Pavel's Group Identity</NAME>
  </OBJECT>

Call DRMCloseQueryHandle to close the object 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

Querying Licenses
DRMGetUnboundLicenseAttribute
DRMGetUnboundLicenseAttributeCount
DRMGetUnboundLicenseObjectCount

 

 

Show:
© 2014 Microsoft