[Lazarus] I have some custom components, can I convert Delphi -> Lazarus?

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Fri Jun 19 10:49:14 CEST 2015

Michael Schnell wrote:
> On 06/18/2015 06:01 PM, Bo Berglund wrote:
>> In the pas file referencing the obj file I have this:
>>     Windows;
>> { External functions }
>> FUNCTION RNBOsproFormatPacket( ApiPacket     : RB_SPRO_APIPACKET_PTR;
>>                                 thePacketSize : WORD ) : WORD; STDCALL;
> It uses e.g. "STDCALL", so supposedly it is an ANSI C based interface.
> If the obj file format is not GNU/FPC compatible and can't be used by 
> the linker in fpc, " Safenet" might be able to provide a GNU C version 
> of that file.

I can't safely comment on Windows-specific issues, we gave that up years 
ago (the hassle of accounting for every copy on various experimental 
machines etc. was more than it was worth).

Assuming standard linkage conventions the function should "just work", 
but the definition of RB_SPRO_APIPACKET_PTR might need checking.

> But being able to successfully link might not be enough. It might be 
> possible that the  Safenet thingy does some encryption with the exe 
> information file to allow only execution only if  the correct dongle is 
> found. That might or might not be compatible with fpc generated exes.

But as a cautionary tale, a colleague who didn't know x86 assembler once 
spent many lunchtimes stepping through AutoCAD to break their dongle 
lookup so that he could do something like running a slightly older (but 
more comprehensive) version than he'd got a formal license for. 
"Security by obscurity" doesn't work, particularly on an open system 
like a PC.

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the Lazarus mailing list