Well this was a very fast hack once i got the infor off the web.

I made up a ZLIB.INC and ZLIB.LIB for compression of files.

I needed it cause Adobe PDF's use this compression as its default. (and im playing with PDF's today ;) )

Anywho. It seems to work, but i only did a very basic test. The structure is unverified ~ it was translated by hand, however im giving you all the needed info to use the lib and read the C++ function definitions.

Enjoy ;)

(( O ya, i have a test file in there too ))
Posted on 2003-01-15 00:41:15 by NaN
NaN: on my NT4SP6 test.exe starts 12 :grin: empty debug windows.

beside this, it works perfectly. but it was fun to see 12 eyes in taskbar ... hehe
thanks :alright:
Posted on 2003-01-15 01:06:30 by TBD
Nice job:alright:
NaN,you can use Hutch's inc2l tool to get the import library.



Posted on 2003-01-15 02:25:36 by Vortex
The stack does'nt seem to be restored correctly.
This does'nt show up in you're simple test because
you ExitProcess, but if you call it from another proc it crashes!

before compress ESP=12FFB4
upon return ESP=12FFA4

before uncompress ESP=12FFA4
upon return ESP=12FF94
Posted on 2003-01-15 07:08:27 by gfalen
Hi, All !

The stack does'nt seem to be restored correctly
becouse all function from ZLIB.DLL have C calling conversion...

look this
Posted on 2003-01-15 08:10:24 by Eviloid
Here is my attempt.Included zip file has zlibstat.lib and zlibstat.inc and one example.You can link zlib *statically* and use every function from it.Plus it has also basic zipping and unzipping support.In the example I used zipping capabilities of library.I didnt examined unzipping functions.I will appreciate if you guys make wrappers for zipping and unzipping.
Posted on 2003-01-15 16:05:26 by LaptoniC
opps forgot to attach file.
Posted on 2003-01-15 16:07:45 by LaptoniC
Thanx everyone.

I didnt realize the stack issue last night... Hmm thats what you get when you rush i guess ;)

As well i was not aware there was a static version kicking around. (Even better).

As for the debug on NT, well that VKIM's boat ;) . Must be something in how he does the exception handling or something..... ??

Posted on 2003-01-15 17:31:48 by NaN
Hello, NaN! Nice to meet you!;)
I cannot explain yet why debugging macros don't work on NT. I run your program on Win2k and it did the job very well.
Posted on 2003-01-15 21:15:31 by vkim

I finally got around to using (and verifying) your static lib. As far as i can tell, its linking to MSVCRT.LIB with in turn simply links to the run time .dll in your system directory. So unless im wrong here, your lib is the same thing with more linking between libraries. I discovered this, cause i dont have libc.lib, msvcrt.lib, & uuid.lib in my masm directory (but they are in the PSDK).

Posted on 2003-01-27 19:52:22 by NaN
I have removed all msvc libraries from source I guess.only gz functions have msvc libraries.In the example I provided I was using zipping functionality and it dont have any msvcrt import ??:confused:
Posted on 2003-01-28 18:00:19 by LaptoniC
Ok you are right I am not familiar with this visual c therefore I fucked up I guess.Anyway after some working I guess I have found and fixed problem.Please check it and letme know.
Posted on 2003-01-28 20:27:05 by LaptoniC
Why I allways forgot to attach :)
Posted on 2003-01-28 20:28:58 by LaptoniC
Pretty cool!

I failed to mention your example crashes on windows98se.. dont know why.

But i did copy your lib and include out and used it with my sample program and it worked perfectly (and better than my sloppy attemp, cause it preserves the stack as well ;) )

Thanks alot. But i have to ask, what was the mistake?
Posted on 2003-01-29 22:13:55 by NaN
In order to create local variables Visual C seems to use one function chkstk.I made lsting file and found that.After that I have assembled all asm files created by visual c and linked with chkstk.obj.You can find hisfile even in the masm distribution.That is the story :)
I dont know why it fails but in my win98se my example works dunno why
Posted on 2003-01-30 16:14:50 by LaptoniC
iirc, chkstk is used when you have more than 4k (or what you specified in the compile settings) of local variables. It's used to pre-touch the stack space, so you can have random (as opposed to linear) access to stack variables. Read up on stack and guard pages to see why :)
Posted on 2003-01-31 02:17:33 by f0dder