Share via


Creating the Client Session

All client scenarios begin with the call to DRMCreateClientSession. A client session is used to activate a computer and user, to enumerate the computer and user certificates, and to create a license storage session (which allows the user to store and retrieve licenses).

The first parameter supplied to this method is the address of a callback function used to handle status messages sent during processing of other methods such as DRMActivate, DRMGetSignedIssuanceLicense, and DRMAcquireLicense. Implementation examples are provided in this guide.

The call to DRMCreateClientSession is shown in the following code.

hr = DRMCreateClientSession (
    &OnStatus,
    0,
    // The type of ID.
    DRM_DEFAULTGROUPIDTYPE_WINDOWSAUTH, 
    // Replace with a verifiable NTLM or Passport ID.
    L"user@yourdomain.com",       
    &hClient);

Authentication type is indicated by the defined flag in the third parameter (DRM_DEFAULTGROUPIDTYPE_WINDOWSAUTH or DRM_DEFAULTGROUPIDTYPE_PASSPORT). The fourth parameter supplies a verifiable Windows logon name (if Windows authentication was specified) or Passport identity (if Passport authentication was specified).

If DRMCreateClientSession succeeds, it returns an HRESULT success code and a handle to the newly created client session in the final (out) parameter. Explanation of the handles to objects used in the AD RMS SDK can be found in the section AD RMS Handles and Sessions.

See Also

Initializing the AD RMS Environment
Methods Used by All Client Applications

Send comments about this topic to Microsoft

Build date: 3/13/2008