Contents - Index


4.3.1.1 Extended API - SlsLocalEx.dll

There are five functions available in the extended library, namely:

  1. SLS_GenerateLicenceKey
  2. SLS_GenerateRemovePassword
  3. SLS_VerifyTerminationCode
  4. SLS_VerifyStatusCode
  5. SLS_GetVersionEx

1. Generate Licence Key

int SLS_GenerateLicenceKey(
                                                LPCSTR lpszProductID,
                                                SLS_SECRET *ppSecretArray,
                                                int nSecretSize,
                                                LPCSTR lpszReferenceCode,
                                                SLS_LICENCE *pLicencePolicy,
                                                LPSTR lpszLicenceKey)

Parameters

lpszProductID

Points to a string that uniquely identifies the application's Product ID.

pSecretArray

Points to an array of product secrets.

nSecretSize

Size of the secret array, must be set to 4.

pszReferenceCode

Points to a string containing the user's Reference Code.

pLicencePolicy

Points to a SLS_LICENCE structure containing licence features that to be issued to the user.

lpszLicenceKey

Points to a buffer in which the Licence Key is to be placed. The minimum size of the buffer is 64 bytes.

Return value

Definition Value Meaning
SLSKEY_SUCCESS     0 Success
SLSKEY_ERROR     1 General error
SLSKEY_E_BAD_PRODUCT_ID     2 Bad product ID
SLSKEY_E_BAD_REFERENCE     3 Bad reference code
SLSKEY_E_BAD_PID_REF     4 Reference code does not match product ID
SLSKEY_E_BAD_LICENCE_TYPE     5 Bad licence type
SLSKEY_E_BAD_LICENCE_DATE     6 Bad licence date
SLSKEY_E_BAD_SECRET_SIZE   10 Bad secret size
SLSKEY_E_BAD_SECRET_1;   11 Bad secret 1
SLSKEY_E_BAD_SECRET_2   12 Bad secret 2
SLSKEY_E_BAD_SECRET_3   13 Bad secret 3
SLSKEY_E_BAD_SECRET_4   14 Bad secret 4

2. Generate Remove Password

int WINAPI SLS_GenerateRemovePassword(
                                                                       LPCSTR lpszProductID,
                                                                       SLS_SECRET *ppSecretArray,
                                                                       Int nSecretSize,
                                                                       LPCSTR RemoveReference,
                                                                       LPSTR lpszRemovePassword)

This function generates a password for removing licence files. The remove reference code must be provided in lpszRemoveReference, then the password will be returned in the buffer pointed by lpszRemovePassword.

SLS_SUCCESS is returned if the functions succeeds.

3. Verify Termination Code

int WINAPI SLS_VerifyTerminationCode(
                                                                const char *pszProductID,
                                                                const char *pszTerminationCode,
                                                                SLS_LICENCE *plicInfo);

This function is used to verify the termination code given by the user who wish to terminate his/her licence. The termination code is passed through pszTerminationCode, then the licence features before it was terminated is returned to the structure pointed by plicInfo.

SLS_SUCCESS is returned if the functions succeeds.

4. Verify Status Code

int WINAPI SLS_VerifyStatusCode(
                                                       const char *pszProductID,
                                                       const char *pszStatusCode,
                                                       SLS_LICENCE *plicInfo);

This function is used to verify the licence status code. The status code encrypts the current licence features. This function verifies whether the status code is valid and if so returns the licence features in the plicInfo structure. Software publishers can use this function to check the licence status at any time they wish, such as before the use's licence is to be renewed.

5. Get Version Numbers

HRESULT WINAPI SLS_GetVersionEx(
                                                            int *pnMajorVersion
                                                            int *pnMinorVersion);

This function returns the current version numbers of the API libraries.

The major version number is returned in the pnMajorVersion variable and the minor version number in the pnMinorVersion variable.