From c12debcb441a2078c30372ba77cfcf6bdb219bfd Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Wed, 21 Apr 2010 13:01:53 +0000 Subject: Added beta indication when update More performance improvements git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@509 4f64403b-2f21-0410-a795-97e2b3489a10 --- updater/unzipfile.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'updater/unzipfile.cpp') diff --git a/updater/unzipfile.cpp b/updater/unzipfile.cpp index a449ceb..b14bf97 100644 --- a/updater/unzipfile.cpp +++ b/updater/unzipfile.cpp @@ -2,7 +2,8 @@ #include "utils.h" #include -#include + +extern "C" void fill_memory_filefunc (zlib_filefunc_def* pzlib_filefunc_def); bool extractCurrentFile(unzFile uf, TCHAR *path) { @@ -87,12 +88,15 @@ bool extractCurrentFile(unzFile uf, TCHAR *path) return true; } -void unzip_file(TCHAR* zipfile, TCHAR* dest) +void unzip_mem(char* buf, int len, TCHAR* dest) { - zlib_filefunc64_def ffunc; - fill_win32_filefunc64(&ffunc); + zlib_filefunc_def ffunc; + fill_memory_filefunc(&ffunc); + + char zipfile[128]; + mir_snprintf(zipfile, sizeof(zipfile), "%p+%x", buf, len); - unzFile uf = unzOpen2_64(zipfile, &ffunc); + unzFile uf = unzOpen2(zipfile, &ffunc); if (uf) { do { -- cgit v1.2.3