VLSsetLicensePrecedence
Client | Server | Static Library | DLL |
√ | √ | √ |
Sets the precedence value for a trial license.
Syntax
LS_STATUS_CODE VLSsetLicensePrecedence (
unsigned char *feature_name,
unsigned char *version,
unsigned char *license_hash,
int license_hash_len,
int precedence_level,
void *unused1,
int unused2);
Argument | Description |
feature_name |
Name of the feature |
version |
Version of the feature, must be unique |
license_hash |
The license hash for the license code (to identify a specific license) |
license_hash_len |
The length of the license hash |
precedence_level |
Used to specify the precedence level that needs to set for the trial license |
unused1 |
Unused variable |
unused2 |
Unused variable |
Description
The API sets the precedence level of a trial license. The precedence level passed as argument can be one of the following:
>0: license code is inactive and cannot be consumed.
>-1: license code is active and would take precedence over all the licenses, including permanent licenses. This is a special precedence level that makes a trial license most preferred license irrespective of license type.
>>= 1: Positive values decide preference order of a trial license, among trial licenses, for a given feature. Greater the positive value higher will be the preference for this trial license.
When a trial license is added to the licensing system for the first time, it has the default precedence of 1.
The following macros related to license precedence are defined in lserv.h header file:
>VLS_PRECEDENCE_TRIAL_OVERRIDE_NORMAL (-1)
>VLS_PRECEDENCE_DISABLE (0)
>VLS_PRECEDENCE_DEFAULT (1)
Returns
The status code LS_SUCCESS is returned if successful. Otherwise, it will return the following error codes:
Error Codes |
Description |
VLS_APP_UNNAMED |
When the feature_name OR version OR license_hash parameter is NULL. When the feature_name OR license_hash contain only the NULL character i.e "\0". |
VLS_CALLING_ERROR |
Argument specified is not correct, that is, one of the following reasons exist: If license_hash_len is less than -1 or exceeds the maximum limit i.e VLS_MAX_LICENSE_HASH_LEN. If feature_name or version buffer size exceeds the maximum size limit specified as VLS_MAXFEALEN and VLS_MAXVERLEN respectively. If precedence_level is less than -1. |
VLS_NO_SUCH_FEATURE |
The license with feature-version combination passed as an argument not found. |
VLS_NO_SUCH_LICENSE |
The license with feature-version-license hash combination passed as an argument not found. |
VLS_RESOURCE_LOCK_FAILURE |
Failed to obtain the API resource lock. On receiving this error, retry calling this API. |
VLS_NORESOURCES |
Error occurred in allocating resources needed by this API. |
VLS_SET_LICENSE_PRECEDENCE_FAILED |
Failed in setting the license precedence. |
VLS_TRIAL_LIC_DATA_INCONSISTENT |
Failed to set the precedence of a trial license due to the corrupted persistence. |
VLS_TRIAL_LIC_DATA_ACCESS_ERROR |
Recoverable error is occurred while setting the precedence of a trial license. |
VLS_MULTIPLE_VENDORID_FOUND |
This occurs when more than one licenses for the specified Feature/Version is available on the License Manager, but the Vendor ID for all these licenses is different from the licensing library's vendor ID. |
LS_NO_NETWORK |
Generic error indicating that the network is unavailable for servicing the license operation. |
VLS_NO_SERVER_RUNNING |
License Manager on specified host is not available for processing license operation requests. |
VLS_BAD_SERVER_MESSAGE |
Message from License Manager could not be understood. |
VLS_CAPACITY_MISMATCH |
The function is called for a capacity license. It can only be called for non-capacity licenses. |
For a complete list of the error codes, see Licensing Library Error and Result Codes.