Subject Re: [firebird-support] Which differences from gds32.dll and fbclient.dll?
Author Olivier Mascia
Dear,

On Mon, 03 Nov 2003 16:52:58 -0000,
medicusit wrote :

> I've installed FB 1.5RC6 and I've seen that my .exe use both
> gds32.dll and fbclient.dll, are there differences if I use only
> fbclient.dll? Which? Thanks in advance.

Functionnally : none.
GDS32.DLL is a stub DLL.
It just relays your calls to GDS32.DLL entry-points to FBLIENT.DLL
entry-points. The new client library for Firebird is FBCLIENT.DLL.

Please note, that between RC6 and the next RC (or the final release) a
significant installation scheme change has been decided. Here it is
(summary) :

The FBCLIENT.DLL won't be installed anymore in the Windows system
directory. Only the new GDS32.DLL will be copied there, if not
conflicting with some other GDS32.DLL (from InterBase or Firebird 1.0
for instance).

To load the new FBCLIENT.DLL correctly (that will be installed to the
bin subdir of your target directory), you are now expected (with >RC6)
to check the registry key :

HKML\SOFTWARE\Firebird Projects\Firebird Server\Instances

From this key, read the REG_SZ value named "DefaultInstance". That
value is the root path of your default Firebird installation. Append
"\\bin\fbclient.dll" and you have got the full path to use for your
LoadLibrary() system call.

In essence do something along these lines to get compatibility with
other versions (including InterBase) :

// Let's load the FBCLIENT.DLL or GDS32.DLL.

#define REG_KEY_ROOT_INSTANCES "SOFTWARE\\Firebird Project\\Firebird Server\\Instances"
#define FB_DEFAULT_INSTANCE "DefaultInstance"

char fbdll[MAX_PATH];
HKEY hkey_instances;

// Try to locate FBCLIENT.DLL the correct way for Firebird Server 1.5.
// We have to lookup the registry to find the installation root path
// of the 'DefaultInstance'.

mHandle = 0;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_KEY_ROOT_INSTANCES, 0,
KEY_READ, &hkey_instances) == ERROR_SUCCESS)
{
DWORD keytype;
DWORD buflen = sizeof(fbdll);
if (RegQueryValueEx(hkey_instances, FB_DEFAULT_INSTANCE, 0,
&keytype, reinterpret_cast<UCHAR*>(fbdll),
&buflen) == ERROR_SUCCESS && keytype == REG_SZ)
{
lstrcat(fbdll, "bin\\fbclient.dll");
mHandle = LoadLibrary(fbdll);
}
RegCloseKey(hkey_instances);
}

if (mHandle == 0)
{
// FBCLIENT was not loaded. Let's try GDS32.DLL.
mHandle = LoadLibrary("GDS32.DLL");
if (mHandle == 0)
throw ExceptionImpl("GDS::Call()", "Can't find/load FBCLIENT.DLL nor GDS32.DLL");
}


--
Best Regards,
Olivier Mascia
http://www.ibpp.org