Technical Exchange, DH explanation.
There are several functions in sysutils. Pas, which I have never seen before. I accidentally discovered when I read the source code today.
Function Gdal: longword; Type Tdvclal = Array [0 .. 3] Of Longword; pdvclal = ^ tdvclal; VaR P: pointer; a1, a2: longword; pal1s, pal2s: pdvclal; Alok: Boolean; Begin P: = ALR; // obtain from resource file If P <> Nil Then Begin A1: = al1 (P ^); A2: = Al (P ^); Result: = A1; pal1s: = @ al1s; pal2s: = @ al2s; Alok: = (a1 = pal1s [0]) And (A2 = pal2s [0]) Or (A1 = pal1s [1]) And (A2 = pal2s [1]) Or (A1 = pal1s [2]) And (A2 = pal2s [2]); freeresource (INTEGER (p )); If Not Alok Then ALV; // throw an exception saying application is not licensed to use this feature End Else Result: = al1s [3]; End ;
The full name of this function is get Delphi access licences. This function reads the access permission from the resource. If it is invalid, an exception is thrown. If it is legal, the decrypted al1 is returned. The following two functions are used:
Const Al1s: Array [0 .. 3] Of Longword = ($ fffffff0, $ ffffebf0, 0, $ ffffffff); al2s: Array [0 .. 3] Of Longword = ($ 42c3ecef, $20f7aeb6, $ d1c2f74e, $ 3f6574de ); Procedure ALV; Begin Raise exception. createres (@ SNL ); End ; Function ALR: pointer; VaR Libmodule: plibmodule; Begin If Maininstance <> 0 Then Result: = pointer (loadresource (maininstance, findresource (maininstance, 'dvclal', rt_rcdata ))) Else Begin Result: = Nil ; Libmodule: = libmodulelist; // This Is A linked list. If you want to learn the linked list, you can check it out. While Libmodule <> Nil Do // records Begin With Libmodule ^ Do Begin Result: = pointer (loadresource (instance, findresource (instance, 'dvclal', rt_rcdata ))); If Result <> Nil Then Break; End ; Libmodule: = libmodule. Next; End ; End ; End ;
Then there is a function that uses gdal, that is, gdal is not directly used:
Procedure RCS;VaR P: pointer; Alok: Boolean; Begin P: = ALR; If P <> Nil Then Begin Alok: = (al1 (P ^) = al1s [2]) And (Al2O3 (P ^) = al2s [2]); freeresource (INTEGER (p )); End Else Alok: = false; If Not Alok Then ALV; End ;Procedure RPR; VaR AL: longword; Begin AL: = gdal; If (Al <> al1s [1]) And (Al <> al1s [2]) Then ALV; End ;
Function RCS: checks whether a valid Delphi client server license is available. If the permission is invalid, an exception occurs.
Function RPR: Check whether a valid Delphi pro license is available. If the permission is invalid, an exception occurs.
From the above, we usually don't need these two functions. They are also in the built-in VCL. If you are interested, please take a look.
OK