WLGenTrialExtensionRegistryKey

<< Click to Display Table of Contents >>

Navigation:  WinLicense > WinLicense SDK > Generators Functions >

WLGenTrialExtensionRegistryKey

The WLGenTrialExtensionRegistryKey function generates a trial extension key to extend the current trial period in a specific application. The generated extension key should be directly copied into a .reg file. When a user clicks on the .reg file, the trial extension information will be inserted in a custom registry key to register an specific application.

Click to expand/collapseShow C/C++ function definition
Click to expand/collapseShow Delphi function definition
Click to expand/collapseShow Visual Basic function definition
Click to expand/collapseShow C# (.NET) function definition

 

Parameters

 

pTrialHash

[in] Pointer to a null-terminated string that specifies the unique Trial hash to generate specific trial extension keys for an application.

 

Level

[in] Trial extension key level.

 

The trial is extended by levels to allow developers a full control of the extended keys that they generate. When a user asks for an extension key, the first level should be zero. If the same user asks again for an extension key, only extension keys with levels greater than zero will work. In general, to allow a trial period extension, only extended keys with a Level greater than a previous one will work. This will avoid being cheated by users re-asking for a trial extension key.

 

NumDays

[in] Number of days to extend the trial period.

 

NumExec

[in] Number of executions to extend the trial period.

 

pNewDate

[in] Pointer to a SYSTEMTIME struct that holds the new trial expiration date.

 

If this parameter is zero, the generated license key will not have date expiration restrictions.

Click to expand/collapseNote for C# developers

GlobalTime

[in] Number of minutes to extend the Global time trial.

 

Runtime

[in] Number of runtime minutes to extend the trial.

 

pKeyName

[in] Pointer to a string that holds the registry key name where the trial extension key is stored.

 

pKeyValueName

[in] Pointer to a string that holds the registry key value name where the trial extension key is stored.

 

pBufferOut

[out] Pointer to a buffer that will hold the generated trial extension key.

 

This buffer should be copied directly into a .reg file, making it the extension key that will extend the trial when a user clicks on this .reg file.

 

 

Return Values

 

If the function succeeds, the return value is the number of bytes in the generated trial extension key.

 

If the function fails, the return value is 0.

 

 

Remarks

 

Only the trial restriction fields that were included in the protection time can be extended. For example, if an application has a trial restriction of 21 days, ONLY the number of expiration days can be extended. Any attempt to extend any other trial restriction not included in the protection time will be ignored.

 

 

See Also

 

WLTrialGetExtensionStatus