208{
209
210
214 {
217 }
218 else
219 {
222 }
223
225 {
228 }
229
231 for (
INT iItem = 0; iItem <
m_items.GetSize(); ++iItem)
232 {
234 }
235
236 if (files.GetSize() <= 0)
237 {
238 DPRINT1(
"files.GetSize() <= 0\n");
239
244
246 }
247
251
253 if (zf == 0)
254 {
256
258
263
265 }
266
267
269
270
274
275
280 {
283
284
288 {
291 break;
292 }
293
294
296
297
300 {
304 break;
305 }
306
307 unsigned long crc = 0;
309 {
310
311 }
312
313
317 {
319 strNameInZip = strTargetDir + strNameInZip;
320
322 strNameInZipUTF8 = strTargetDirUTF8 + strNameInZipUTF8;
323 }
324
325
327 if (nCodePage !=
CP_UTF8 && strNameInZip != strNameInZipUTF8)
328 {
329
331 extraField.Add(headerID & 0xFF);
332 extraField.Add((headerID >> 8) & 0xFF);
334 extraField.Add((
dataSize >> 8) & 0xFF);
335 extraField.Add(1);
336
337
339 extraField.Add(nameCRC & 0xFF);
340 extraField.Add((nameCRC >> 8) & 0xFF);
341 extraField.Add((nameCRC >> 16) & 0xFF);
342 extraField.Add((nameCRC >> 24) & 0xFF);
343
344
345 for (
INT ich = 0; ich < strNameInZipUTF8.
GetLength(); ++ich)
346 extraField.Add(strNameInZipUTF8[ich]);
347 }
348
349
351 (extraField.GetSize() ? extraField.GetData() :
NULL),
358 {
359 DPRINT1(
"zipOpenNewFileInZip3_64\n");
360 break;
361 }
362
364 {
365
367 if (!hMapping)
368 {
369 DPRINT1(
"Cannot create file mapping\n");
372 break;
373 }
374
375
379 {
381 dwMapSize = (
DWORD)
min(dwChunkSize, dwDelta);
384 dwMapSize);
386 {
387 DPRINT1(
"Cannot map the view\n");
389 break;
390 }
391
394 }
395
397 }
398
400
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 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
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MAKEINTRESOURCEW(i)
CSimpleArray< CStringW > m_items
DWORD dwAllocationGranularity
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
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