Coding Custom Locking
Custom locking can provide stronger security when you need it. Refer to "Choosing the License Locking Criteria" for general description of locking and to Implementing Standard/Extended Custom Locking Criteria for more information about custom locking.
This section describes the prerequisites:
Include Libraries
Licensing library specific to your platform, including the dependent libraries specific to your environment.
Include Header File(s )
lserv.h
Declare Variables
VLSmachineID machineID; unsigned long lock_selector_in= VLS_LOCK_CUSTOMEX; unsigned long lock_selector_out=0; unsigned long lock_selector= VLS_LOCK_CUSTOMEX; char* lockCode; /*allocate char buffer of 20 length*/ int lockCodeLen=20; unsigned char *license_system; unsigned char *publisher_name; unsigned char *product_name; unsigned char *version; unsigned long units_reqd=1; unsigned char *log_comment; char *Server name; LS_CHALLENGE challenge; LS_HANDLE lshandle;
API Calls
Implement function with signature
>"long pmyGetCustExTableFunc(VLScustomEx* pCustomExTable, unsigned long* pulCount)"
>VLSsetCustomExFunc( pmyGetCustExTableFunc);
>VLSinitialize();
Generate the lock code against lock selector- VLS_LOCK_CUSTOMEX.
>VLSinitMachineID(&machineID);
>VLSgetMachineID(lock_selector_in, &machineID, &lock_selector_out);
>VLSmachineIDToLockCodeEx(machineID, lock_selector, lockCode, lockCodeLen, 0);
Request the client locked license against lock selector- VLS_LOCK_CUSTOMEX.
>VLSsetContactServer (Server name) or the LSFORCEHOST or LSHOST environment variables
>VLSdisableAutoTimer and VLSdisableLocalRenewal (if need to implement the update call)
>LSRequest(license_system, publisher_name, product_name, version,&units_reqd, log_comment, &challenge, &lshandle);