DRMCreateEnablingPrincipal 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 DRMCreateEnablingPrincipal function creates an enabling principal needed to bind to a license.

Syntax

DRMEXPORT HRESULT UDAPICALL DRMCreateEnablingPrincipal(
  [in]  DRMENVHANDLE hEnv,
  [in]  DRMHANDLE    hLibrary,
  [in]  PWSTR        wszObject,
  [in]  DRMID        *pidPrincipal,
  [in]  PWSTR        wszCredentials,
  [out] DRMHANDLE    *phEnablingPrincipal
);

Parameters

[in] hEnv

A handle to an environment created by DRMInitEnvironment.

[in] hLibrary

A handle to a library. Currently, the only valid library that can be used is the one passed out by DRMInitEnvironment.

[in] wszObject

A pointer to a null-terminated Unicode string that specifies the enabling principal type. An application can use the object constants specified in Msdrmgetinfo.h.

[in] pidPrincipal

A pointer to a DRMID structure that identifies the enabling principal. The DRMID members can be NULL to use the first principal in a license.

[in] wszCredentials

A pointer to a null-terminated Unicode string that contains the rights account certificate of the current user.

[out] phEnablingPrincipal

A pointer to a DRMHANDLE value that receives the created principal. 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 list. For a list of common error codes, see Common HRESULT Values.

Remarks

The enabling principal this function creates is used in the DRMBOUNDLICENSEPARAMS structure passed into DRMCreateBoundLicense. Call DRMCloseHandle to close the enabling principal handle created by calling this function.

Requirements

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

See also

AD RMS Functions