DRMCreateLicenseStorageSession 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 DRMCreateLicenseStorageSession function creates a license storage session, which is needed to acquire or manipulate a license.

Syntax

DRMEXPORT HRESULT UDAPICALL DRMCreateLicenseStorageSession(
  [in]  DRMENVHANDLE hEnv,
  [in]  DRMHANDLE    hDefaultLibrary,
  [in]  DRMHSESSION  hClient,
  [in]  UINT         uFlags,
  [in]  PWSTR        wszIssuanceLicense,
  [out] DRMHSESSION  *phLicenseStorage
);

Parameters

[in] hEnv

A handle to the AD RMS environment. This handle is obtained by using the DRMInitEnvironment function.

[in] hDefaultLibrary

A handle to the default library. This handle is obtained by using the DRMInitEnvironment function.

[in] hClient

A handle to a client session. This handle is obtained by using the DRMCreateClientSession function.

[in] uFlags

This parameter is reserved and must be set to zero.

[in] wszIssuanceLicense

A pointer to a null-terminated Unicode string that contains a signed issuance license. The created license storage session is associated with this issuance license.

[out] phLicenseStorage

A pointer to a handle that receives the license storage session handle. This handle must be passed to the DRMCloseSession function when the license storage session is no longer needed.

Return value

If the function succeeds, the function returns S_OK.

If the function fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.

Remarks

A license storage session is used for acquiring, deleting, and enumerating licenses, among other uses. To actually bind to a license and exercise its rights, an application must use DRMCreateBoundLicense.

The environment handle and default library handle are created by using DRMInitEnvironment.

The handle returned in the phLicenseStorage parameter must be passed to the DRMCloseSession function when the license storage session is no longer needed.

Requirements

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

See also

AD RMS Functions

DRMCloseHandle

DRMCreateClientSession

DRMInitEnvironment

Decryption_GetBoundLicense.cpp