This function will generate standard/extended activation code and removal code for application protected with old PC Guard for Win32/.NET V5 products.

Definition and parameters

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

Parameter Description
site_code Pointer to Site code string value.
mid Pointer to Machine ID (MID) 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)
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)


site_code, mid and pid  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:


Full list of return codes is available here.