Re: Problem with Compress:Zlib

From: Sangqar (Sean Healy) <sangqar_at_hotmail.com>
Date: Sat, 16 Aug 2003 03:15:29 +0000
To: prima_at_prima.eu.org

> Sean> If I run the following code: use Prima; use Compress::Zlib;
>
> Sean> then no problem. However, if I run
>
> Sean> use Compress::Zlib; use Prima;
>
> Sean> then I get an error message - Can't locate ordinal 10 in
> Sean> compress.zlib.
>
> Sean> This is on Win2k (haven't tested it on any other machine yet - I
> Sean> also have RedHat8 machine and an old Win95 machine I can try this
> Sean> on.
>
> Sean> It looks like a Windows error message (i.e., comes up in an Windows
> Sean> message box) rather than a Perl error message.
>
>Until now this was just a theoretical case, never emerged in Prima,
>but in general the problem is known as "DLL hell", which stems when
>different pieces of software use different versions of same library.
>In our case, it is prigraph.dll, which, in turn,
>uses zlib.dll - and if another version of zlib.dll is to be used, there are
>problems. There is just one thing that might help - try to locate all
>zlib.dll
>you have and condense down to using just one; if the Prima's is outdated,
>copy the newer one over it.

Unfortunately, that didn't work - the Compress::Zlib version is made form an
XS file, and has all that stuff for translating perl data types (hv, sv, av,
etc) to regular C data types (int, etc), and so the two versions are
completely incompatible. However, here's what did work:

I popped open Prima's zlib.dll, went to the import table, changed 'zlib.dll'
to 'pzlb.dll', and then renamed zlib.dll accordingly. Worked like a charm.

I don't have the script I wrote (I did it on my Win2k machine, and I'm on my
brand-new WinXP machine right now, and I don't even have perl installed on
this one yet), but I believe the proper spot in the import table is at
offset 55E20. The script was something like this:

open DLL, '+<prigraph.dll' or die $!;
binmode DLL;
seek DLL, hex('55E20'), 0;
print DLL 'pzlb';
close DLL;

Of course, if anything except prigraph.dll is using that zlib.dll, I just
broke it, but I haven't run into any problems yet.

Would it be possible to make prigraph.dll use Compress::Zlib? (Then again,
not everyone will have that installed, so maybe that's not such a good
idea.)

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus
Received on Sat 16 Aug 2003 - 05:15:42 CEST

This archive was generated by hypermail 2.2.0 : Sat 19 Mar 2011 - 18:35:04 CET