Description

This function will generate standard/extended activation code and removal code for application protected with any PC Guard V6 family product.

NOTE: For applications protected with old PC Guard for Win32/.NET V5 please use V5_GenerateActivationCode method.

Definition and parameters

extern "C" __declspec(dllexport) int __stdcall \
V6_GenerateActivationCode(char* site_code, char* mid, char* app_sign, char* pid, DWORD features, PEXTENDED_ACTIVATION_DATA ead, char* activation_code, char* removal_code);

Parameter Description
(IN)  
site_code Pointer to Site code string value.
mid Pointer to Machine ID (MID) string value.
app_sign Pointer to application signature string value.
pid Pointer to Program ID string value.
features Custom features value (0 - not required)
ead Pointer to extended activation data structure (ignored if NULL)
(OUT)  
activation_code pointer to buffer for activation code (should be at least 200 character long)
removal_code pointer to buffer for removal code (should be at least 10 character long)

Usage

site_code, mid, pid and app_sign parameters are mandatory for both standard and extended activation codes.

Custom feature value is a DWORD (32bit value) where each bit represents one feature. Set bits accordingly to the following information:

Bit 0-15 represents custom features 1-16.

Bit 16 - Disable limited license (if set, protection code will disable limited license feature and unlock application for unlimited period of time)

Bit 17 - Extend evaluation period (if set, protection code will extend evaluation period instead of unlocking protected application)

Bit 19 - License extension flag (if set, generated activation code can be used for license extension only)

Pointer to extended activation data structure (ead) is ignored if set to NULL. 

If ead is valid pointer and if any of extend activation flags (UpdateDemo, UpdateLimitedLicense, UpdateMaxAppInstances, UpdateCustomCounters) is set, function will return extended activation code. Standard activation code will be generated otherwise.

Be sure to set appropriate extended activation limitations (options) if you are generating extended activation code. 

For example, if you are updating limited license limitations you need to set both UpdateLimitedLicense flag and appropriate limitations. 

If you are updating custom counters you need to set both UpdateCustomCounters and custom counter values (Counter01 - 10) and so on.

Return values

If the function succeeds, activation and removal code buffers are filled and return value is STATUS_OK

If the function fails, return value is on of the following error codes:

STATUS_BAD_SITE_CODE
STATUS_BAD_MID_CODE
STATUS_BAD_SITEMID
STATUS_BAD_PROGRAMID
STATUS_BAD_APPSIGN

Full list of return codes is available here.