You've already forked lazarus-ccr
InvalidCount for days code
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@923 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -1,2 +1,3 @@
|
|||||||
[Keys]
|
[Keys]
|
||||||
OnGuard demo=$E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4
|
OnGuard demo=$E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4
|
||||||
|
Ck-Etykiety=$C0,$0A,$27,$C2,$93,$7B,$06,$0D,$24,$84,$DF,$A1,$1E,$B9,$0D,$AF
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="exrgregu"/>
|
<UnitName Value="exrgregu"/>
|
||||||
<CursorPos X="59" Y="108"/>
|
<CursorPos X="59" Y="108"/>
|
||||||
<TopLine Value="67"/>
|
<TopLine Value="80"/>
|
||||||
<EditorIndex Value="1"/>
|
<EditorIndex Value="1"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
|
@@ -7,7 +7,8 @@ Table of contents
|
|||||||
2. Package names
|
2. Package names
|
||||||
3. Installation
|
3. Installation
|
||||||
4. Version history
|
4. Version history
|
||||||
4.1 Release 1.13
|
4.1 Release 1.13
|
||||||
|
|
||||||
|
|
||||||
==============================================
|
==============================================
|
||||||
|
|
||||||
@@ -40,6 +41,12 @@ To install TurboPower OnGuard into your IDE, take the following steps:
|
|||||||
|
|
||||||
4. Version history
|
4. Version history
|
||||||
|
|
||||||
|
4.3 July 27, 2009
|
||||||
|
Initial addition of features:
|
||||||
|
- InvalidCount which allow limited count of valid code even if trial period is expired
|
||||||
|
(useful due to user mistakes causing incorect system date sometimes)
|
||||||
|
- instead of logical volume serial number , hardware hdd ide disk serial number is no used if available
|
||||||
|
- compilation with newest Lazarus SVN problems fixed
|
||||||
|
|
||||||
4.3 July 28 2009
|
4.3 July 28 2009
|
||||||
- initial support for InvalidCount value allowing 'breaking the rules' limited , for example run program a few times if trial period expired
|
- initial support for InvalidCount value allowing 'breaking the rules' limited , for example run program a few times if trial period expired
|
||||||
|
@@ -1989,20 +1989,26 @@ begin
|
|||||||
MixBlock(T128bit(Key), Work, False);
|
MixBlock(T128bit(Key), Work, False);
|
||||||
Result := (Work.CheckValue = DaysCheckCode) and
|
Result := (Work.CheckValue = DaysCheckCode) and
|
||||||
(ExpandDate(Work.LastAccess) <= Date);
|
(ExpandDate(Work.LastAccess) <= Date);
|
||||||
|
if (not Result) and (Work.InvalidCount >0) then Result := true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DecDaysCode(const Key : TKey; var Code : TCode);
|
procedure DecDaysCode(const Key : TKey; var Code : TCode);
|
||||||
var
|
var
|
||||||
X : LongInt;
|
X : LongInt;
|
||||||
|
Valid : Boolean;
|
||||||
begin
|
begin
|
||||||
if not IsDaysCodeValid(Key,Code) then DecInvalidCountCode(Key,Code);
|
|
||||||
MixBlock(T128bit(Key), Code, False);
|
MixBlock(T128bit(Key), Code, False);
|
||||||
|
Valid := (Code.CheckValue = DaysCheckCode) and
|
||||||
|
(ExpandDate(Code.LastAccess) <= Date);
|
||||||
|
|
||||||
X := ShrinkDate(Date);
|
X := ShrinkDate(Date);
|
||||||
if (Code.LastAccess <> X) then begin
|
if (Code.LastAccess <> X) then begin
|
||||||
if Code.Days > 0 then {!!.02}
|
if Code.Days > 0 then {!!.02}
|
||||||
Code.Days := Max(0, Code.Days - 1); {!!.02}
|
Code.Days := Max(0, Code.Days - 1); {!!.02}
|
||||||
Code.LastAccess := X;
|
Code.LastAccess := X;
|
||||||
end;
|
end;
|
||||||
|
if (not Valid) and (Code.InvalidCount>0) then
|
||||||
|
Code.InvalidCount := Code.InvalidCount-1;
|
||||||
MixBlock(T128bit(Key), Code, True);
|
MixBlock(T128bit(Key), Code, True);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -2016,7 +2022,10 @@ begin
|
|||||||
(ExpandDate(Work.LastAccess) <= Date) then
|
(ExpandDate(Work.LastAccess) <= Date) then
|
||||||
Result := Work.Days
|
Result := Work.Days
|
||||||
else
|
else
|
||||||
|
begin
|
||||||
Result := 0;
|
Result := 0;
|
||||||
|
if Work.InvalidCount>0 then Result := Work.Days;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user