Better wrapping for libz inflate

This commit is contained in:
ptitSeb 2021-11-02 22:08:43 +01:00
parent 323783bf49
commit 27cf5c81b2
4 changed files with 14 additions and 1 deletions

View File

@ -2936,6 +2936,8 @@ wrappedlibz:
- iFp:
- deflateEnd
- inflateEnd
- iFpi:
- inflate
- iFppi:
- inflateInit_
- iFpipi:

View File

@ -12,6 +12,7 @@
#endif
typedef int64_t (*iFp_t)(void*);
typedef int64_t (*iFpi_t)(void*, int64_t);
typedef int64_t (*iFppi_t)(void*, void*, int64_t);
typedef int64_t (*iFpipi_t)(void*, int64_t, void*, int64_t);
typedef int64_t (*iFpippi_t)(void*, int64_t, void*, void*, int64_t);
@ -20,6 +21,7 @@ typedef int64_t (*iFpiiiiipi_t)(void*, int64_t, int64_t, int64_t, int64_t, int64
#define SUPER() ADDED_FUNCTIONS() \
GO(deflateEnd, iFp_t) \
GO(inflateEnd, iFp_t) \
GO(inflate, iFpi_t) \
GO(inflateInit_, iFppi_t) \
GO(deflateInit_, iFpipi_t) \
GO(inflateInit2_, iFpipi_t) \

View File

@ -173,6 +173,15 @@ EXPORT int my_deflateEnd(x64emu_t* emu, void* str)
return r;
}
EXPORT int my_inflate(x64emu_t* emu, void* str, int flush)
{
libz_my_t *my = (libz_my_t *)emu->context->zlib->priv.w.p2;
wrapper_stream_z(emu, str);
return my->inflate(str, flush);
//TODO: should unwrap the stream
}
#define CUSTOM_INIT \
box64->zlib = lib; \

View File

@ -61,7 +61,7 @@ GO(gztell64, lFp)
GO(gzungetc, iFip)
//GO(gzvprintf, iFppA)
GO(gzwrite, iFppu)
GO(inflate, iFpi)
GOM(inflate, iFEpi)
//GO(inflateBack, iFp@p@p)
GO(inflateBackEnd, iFp)
GOM(inflateBackInit_, iFEpippi)