<< Click to Display Table of Contents >> Navigation: WinLicense > WinLicense SDK > Generators Functions > WLGenTrialExtensionFileKey |
The WLGenTrialExtensionFileKey function generates a trial extension key to extend the current trial period in a specific application. The generated trial extension key should be copied directly into a file, making it the trial extension file to extend the trial period in a specific application.
int WLGenTrialExtensionFileKey( char* pTrialHash, int Level, int NumDays, int NumExec, SYSTEMTIME* pNewDate, int GlobalTime, int Runtime, char* pBufferOut ); |
function WLGenTrialExtensionFileKey( pTrialHash:PAnsiChar; Level:Integer; NumDays:Integer; NumExec:Integer; var pNewDate:SYSTEMTIME; GlobalTime:Integer; Runtime:Integer; pBufferOut:PAnsiChar ):Integer; stdcall; |
Public Declare Function WLGenTrialExtensionFileKey Lib "WinLicenseSDK.dll"( ByVal pTrialHash As String, ByVal Level As Integer, ByVal NumDays As Integer, ByVal NumExec As Integer, pNewDate As Any, ByVal GlobalTime As Integer, ByVal Runtime As Integer, ByVal pBufferOut As String ) As Integer |
class WinlicenseSDK { [DllImport( "WinlicenseSDK.dll", EntryPoint="GenerateLicenseFileKey", CallingConvention = CallingConvention.StdCall )]
public static extern int WLGenTrialExtensionFileKey( string pTrialHash, int Level, int NumDays, int NumExec, ref SystemTime pNewDate, int GlobalMinutes, int Runtime, byte[] pBufferOut); } |
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 a date expiration restrictions.
The SYSTEMTIME struct is not supported by C#. You have to define it as follows:
|
GlobalTime
[in] Number of minutes to extend the Global time trial.
Runtime
[in] Number of runtime minutes to extend the trial.
pBufferOut
[out] Pointer to a buffer that will hold the generated trial extension key.
This buffer should be copied directly into a file, making it the extension key that will extend the trial in a specific application.
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