210{
211
212
216 {
219 }
220 else
221 {
224 }
225
227 {
230 }
231
233 for (
INT iItem = 0; iItem <
m_items.GetSize(); ++iItem)
234 {
236 }
237
238 if (files.GetSize() <= 0)
239 {
240 DPRINT1(
"files.GetSize() <= 0\n");
241
246
248 }
249
253
255 if (zf == 0)
256 {
258
260
265
267 }
268
269
271
272
276
277
282 {
285
286
290 {
293 break;
294 }
295
296
298
299
302 {
306 break;
307 }
308
309 unsigned long crc = 0;
311 {
312
313 }
314
315
319 {
321 strNameInZip = strTargetDir + strNameInZip;
322
324 strNameInZipUTF8 = strTargetDirUTF8 + strNameInZipUTF8;
325 }
326
327
329 if (nCodePage !=
CP_UTF8 && strNameInZip != strNameInZipUTF8)
330 {
331
333 extraField.Add(headerID & 0xFF);
334 extraField.Add((headerID >> 8) & 0xFF);
336 extraField.Add((
dataSize >> 8) & 0xFF);
337 extraField.Add(1);
338
339
341 extraField.Add(nameCRC & 0xFF);
342 extraField.Add((nameCRC >> 8) & 0xFF);
343 extraField.Add((nameCRC >> 16) & 0xFF);
344 extraField.Add((nameCRC >> 24) & 0xFF);
345
346
347 for (
INT ich = 0; ich < strNameInZipUTF8.
GetLength(); ++ich)
348 extraField.Add(strNameInZipUTF8[ich]);
349 }
350
351
353 (extraField.GetSize() ? extraField.GetData() :
NULL),
360 {
361 DPRINT1(
"zipOpenNewFileInZip3_64\n");
362 break;
363 }
364
366 {
367
369 if (!hMapping)
370 {
371 DPRINT1(
"Cannot create file mapping\n");
374 break;
375 }
376
377
381 {
383 dwMapSize = (
DWORD)
min(dwChunkSize, dwDelta);
386 dwMapSize);
388 {
389 DPRINT1(
"Cannot map the view\n");
391 break;
392 }
393
396 }
397
399 }
400
402
404 }
405
407
409 {
412
414
418 else
420
422 }
423 else
424 {
427
430 else
432 }
433
435}
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 DoGetFileTimeInfo(HANDLE hFile, 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 INVALID_HANDLE_VALUE
#define CreateFileMappingW(a, b, c, d, e, f)
#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 WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
void fill_win32_filefunc64W(zlib_filefunc64_def *pzlib_filefunc_def)
#define FILE_FLAG_SEQUENTIAL_SCAN
CSimpleArray< CStringW > m_items
DWORD dwAllocationGranularity
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
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