[fpc-pascal] Converting Delphi7 code to FreePascal with interfacing to protection key?
Michael Van Canneyt
michael at freepascal.org
Wed Mar 22 00:19:58 CET 2023
On Tue, 21 Mar 2023, Bo Berglund via fpc-pascal wrote:
> We have a number of old Delphi7 applications which are in need of porting over
> to FreePascal. I have successfully done a number of these ports in the last few
> years...
> But now I am up against a bit of a problem regarding software we have protected
> using an USB connected hardware key originally bought from Rainbow, a company
> that has been bought up in several steps and is now named THALES.
>
> Anyway, our software interfaces to the SuperPro protection keys is via a Windows
> driver from THALES and they have provided a software integration kit way back
> when we started using the keys.
> It consist of a Delphi unit basically containing a list of definitions of
> available API functions into the driver looking like this:
>
> Obviously being from the time when it was received the OBJ file SPROMEPS.OBJ to
> be linked in is a 32 bit type, so the ported programs need to be compiled/linked
> into a 32 bit exe file on Windows.
>
> Questions:
> ----------
>
> 1) How should I go about translating the above to current FreePascal syntax?
>
> This involves:
> { Force FAR calls }
> {$F+}
You can normally skip this.
>
> {$L SPROMEPS.OBJ} { LINK WITH THE SUPERPRO OBJECT FILE }
This can be problematical, since you need to know it is in the correct
format for the linker.
>
> 2) Is there a way to translate/convert the 32 bit Windows SPROMEPS.OBJ file into
> a 64 bit one such that it could be used for a 64 bit fpc compiler?
> It is the interface to the protection key driver on the Windows system...
I doubt this can be done.
>
> It does work for our 32 bit Delphi7 programs on Windows 10 x64, so there must be
> some 32<->64 bit handling in Windows maybe?
I do not think there is special handling. 64 bit windows simply runs 32-bit
windows programs.
Basically, due to the .OBJ file, I think you're stuck with
compiling 32-bit programs if you require that .obj file.
Maybe the THALES company has a 64-bit version of the .OBJ file.
Michael.
More information about the fpc-pascal
mailing list