Subject Client Library Issues
Author Geoff Worboys
Hi All - but in particular Jason,

I am in the process of rebuilding my DBak application and
realised that I have been (so far) always distributing it to
use only gds32.dll. For an application that is intended
primarily for Firebird this seems a bit odd. OTOH I dont
want to stop it working with older versions of FB and IB.

I do know about changing/selecting a new session unit when
building apps but that does not achieve what I want.

IOW: I would like it to work both ways, rather than forcing
users to go through the client installation issues involved.

So I had a thought...

In IB_Session.pas there is the AcquireOriginalHooks proc that
is used to load the library. By inserting an attempt to load
the fbclient dll, and if that fails try the gds32 dll then we
can get applications to work with old or new. eg:

procedure AcquireOriginalHooks;
SaveCW: word;
if FGDS_Handle < 32 then
asm fstcw [SaveCW] end;
FGDS_Handle := LoadLibrary( pchar(IB_FBCLIENT_DLL) );
asm fldcw [SaveCW] end;
if FGDS_Handle < 32 then
asm fstcw [SaveCW] end;
FGDS_Handle := LoadLibrary( pchar(IB_GDS32) );
asm fldcw [SaveCW] end;
if FGDS_Handle < 32 then Exit;
asm fstcw [SaveCW] end;

The main downside I can see to this is where users may have a
gds32 installed for accessing old server instances AND a new
fbclient installed for a new server instance. I am not sure
just how much of a problem this is, since such an installation
is probably vulnerable anyway.

Note: This has partly come about because I have also been doing
another development that is entirely FB 1.5, so I did not want
to clutter that installation with gds32 instances - but I still
wanted to use DBak, and I would rather not have separate builds
for each client library.

Other possibilities do exist - some sort of command line params
to choose between client libraries - but it all gets fairly
messy. This auto-selection seems appropriate to me.

What do others think?

Jason, did you have anything in mind for this requirement?

Geoff Worboys
Telesis Computing