244{
245
246
250 {
253 }
254 else
255 {
258 }
259
261 {
264 }
265
267 for (
INT iItem = 0; iItem <
m_items.GetSize(); ++iItem)
268 {
270 }
271
272 if (files.GetSize() <= 0)
273 {
274 DPRINT1(
"files.GetSize() <= 0\n");
275
280
282 }
283
287
289 if (zf == 0)
290 {
292
294
299
301 }
302
303
305 int zip64 = 1;
307
312 {
314
317 {
318 DPRINT1(
"DoReadAllOfFile failed\n");
320 strTarget = strFile;
321 break;
322 }
323
324 unsigned long crc = 0;
326 {
327
328 }
329
333 {
335 strNameInZip = strTargetDir + strNameInZip;
336
338 strNameInZipUTF8 = strTargetDirUTF8 + strNameInZipUTF8;
339 }
340
342 if (nCodePage !=
CP_UTF8 && strNameInZip != strNameInZipUTF8)
343 {
344
346 extraField.Add(headerID & 0xFF);
347 extraField.Add((headerID >> 8) & 0xFF);
349 extraField.Add((
dataSize >> 8) & 0xFF);
350 extraField.Add(1);
351
352
354 extraField.Add(nameCRC & 0xFF);
355 extraField.Add((nameCRC >> 8) & 0xFF);
356 extraField.Add((nameCRC >> 16) & 0xFF);
357 extraField.Add((nameCRC >> 24) & 0xFF);
358
359
360 for (
INT ich = 0; ich < strNameInZipUTF8.
GetLength(); ++ich)
361 extraField.Add(strNameInZipUTF8[ich]);
362 }
363
365 strNameInZip,
366 &zi,
367 (extraField.GetSize() > 0 ? extraField.GetData() :
NULL),
368 extraField.GetSize(),
370 0,
374 0,
379 crc,
382 zip64);
384 {
385 DPRINT1(
"zipOpenNewFileInZip3_64\n");
386 break;
387 }
388
391 {
392 DPRINT1(
"zipWriteInFileInZip\n");
393 break;
394 }
395
398 {
399 DPRINT1(
"zipCloseFileInZip\n");
400 break;
401 }
402 }
403
405
407 {
410
412
416 else
418
420 }
421 else
422 {
425
428 else
430 }
431
433}
static CStringW DoGetZipName(PCWSTR filename)
static CStringA DoGetNameInZip(const CStringW &basename, const CStringW &filename, UINT nCodePage)
static void DoAddFilesFromItem(CSimpleArray< CStringW > &files, PCWSTR item)
static CStringW DoGetBaseName(PCWSTR filename)
static DWORD CalculateNameCRC32(PCSTR name)
static BOOL DoReadAllOfFile(PCWSTR filename, CSimpleArray< BYTE > &contents, zip_fileinfo *pzi)
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
bool IsEmpty() const noexcept
int GetLength() const noexcept
void __cdecl Format(UINT nFormatID,...)
#define MINIZIP_COMPATIBLE_VERSION
UINT GetZipCodePage(BOOL bUnZip)
#define MINIZIP_UTF8_FLAG
#define IDS_CANTCREATEZIP
#define Z_DEFAULT_STRATEGY
#define Z_DEFAULT_COMPRESSION
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
void fill_win32_filefunc64W(zlib_filefunc64_def *pzlib_filefunc_def)
static const char * contents
CSimpleArray< CStringW > m_items
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MAKEINTRESOURCEW(i)
int ZEXPORT zipClose(zipFile file, const char *global_comment)
int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char *filename, const zip_fileinfo *zipfi, const void *extrafield_local, uInt size_extrafield_local, const void *extrafield_global, uInt size_extrafield_global, const char *comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char *password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase, int zip64)
zipFile ZEXPORT zipOpen2_64(const void *pathname, int append, zipcharpc *globalcomment, zlib_filefunc64_def *pzlib_filefunc_def)
int ZEXPORT zipWriteInFileInZip(zipFile file, const void *buf, unsigned int len)
int ZEXPORT zipCloseFileInZip(zipFile file)
#define APPEND_STATUS_ADDINZIP
#define APPEND_STATUS_CREATE