VLSsetPersistenceDevice

Syntax

int VLSsetPersistenceDevice(	 	 
VLScpdPersistenceDeviceT persistenceDevice,
VLScpdIfImpl	 	  *deviceIoImpl,
unsigned long	 	  *reserved1,
unsigned char	 	  *reserved2 );

Argument

Direction

Data Type

Description

persistenceDevice

IN

VLScpdPersistenceDeviceTĂ‚ 

Enable or disable custom persistence device feature.

Allowed values are:

> VLS_CPD_NO_DEVICE (Disabled)

>VLS_CPD_CUSTOM_DEVICE (Use custom persistence device)

deviceIoImp

IN

VLScpdIfImpl

Structure for passing pointers to the implementation of call back functions by the developer.

reserved1

 

unsigned long

Reserved for future use.

reserved2

 

unsigned char

Reserved for future use.

Description

This API is used for configuring the standalone/integrated library and license server for transferring the persistence data to external device.

NOTE   The CPD configuration is valid only for a session. See Usage scenarios for a detailed description.

Returns

The status code VLS_CPD_SUCCESS is returned if successful. Otherwise, a specific status code is returned indicating the reason for failure. For a list of error codes, see Licensing Library Error and Result Codes.

Code Snippet

See Implementing CPD for License Managers section.

Usage Scenarios

Case 1

VLSsetPersistenceDevice can be called multiple times before calling VLSinitialize. However, each subsequent call to VLSsetPersistenceDevice will override the previous call. Consider the following scenario:

>Call VLSsetPersistenceDevice - use CPD1 as the persistence device.

>Call VLSsetPersistenceDevice - use CPD2 as the persistence device.

>Call VLSsetPersistenceDevice - use CPD3 as the persistence device.

>Call VLSinitialize.

Call to VLSsetPersistenceDevice at step 3 will override the previous call and persistence device is set to CPD3.

Case 2

Do not call VLSsetPersistenceDevice after VLSinitialized, otherwise it will return an error. Consider the following scenario:

>Call VLSsetPersistenceDevice - use CPD1 as the persistence device.

>Call VLSinitialize

>Call VLSsetPersistenceDevice - use CPD2 as the persistence device.

Call to VLSsetPersistenceDevice at step 3 will result in the error VLS_LIBRARY_ALREADY_ INITIALIZED.

Case 3

VLScleanup will reset all persistence data storage settings and resources configured using VLSsetPersistenceDevice to default. Consider the following scenario:

>Call VLSsetPersistenceDevice - use CPD1 as the persistence device.

>Call VLSinitialize

>Call VLScleanup

>Call VLSinitialize

Call to VLScleanup at step 3 will reset the persistence data storage settings to default.

Steps to Perform

1.Include the custom persistence device header file lsCpdIf.h.

2.Define the implementation for Custom Persistence Device interface callback API.

3.Call the VLSsetPersistenceDevice API before calling any other Sentinel RMS API.

4.Build the application.