Expand Minimize

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

Syntax


HRESULT DRMCreateLicenseStorageSession(
  _In_   DRMENVHANDLE hEnv,
  _In_   DRMHANDLE hDefaultLibrary,
  _In_   DRMHSESSION hClient,
  _In_   UINT uFlags,
  _In_   PWSTR wszIssuanceLicense,
  _Out_  DRMHSESSION *phLicenseStorage
);

Parameters

hEnv [in]

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

hDefaultLibrary [in]

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

hClient [in]

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

uFlags [in]

This parameter is reserved and must be set to zero.

wszIssuanceLicense [in]

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.

phLicenseStorage [out]

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

Product

Rights Management Services client 1.0 SP2 or later

Header

Msdrm.h

Library

Msdrm.lib

DLL

Msdrm.dll

See also

AD RMS Functions
Decryption_GetBoundLicense.cpp
DRMCloseHandle
DRMCreateClientSession
DRMInitEnvironment

 

 

Show:
© 2014 Microsoft