[delphizip] Another bug in Unzdll.dll (ver160) and workaround

  • From: "Angus Johnson" <ajohnson@xxxxxxxxxx>
  • To: <delphizip@xxxxxxxxxxxxx>
  • Date: Thu, 7 Mar 2002 11:59:59 +1100

Unzdll.dll (ver160):

The enumeration type UnZipSkipTypes does not align with the constants
declared in the dll resulting in incorrect values being returned in the
callback function (ActionCode = 11):

The dll source (Extract.c) :

#define SKIPPED_ON_FRESHEN      0x0101
#define SKIPPED_NO_OVERWRITE     0x0102
#define SKIPPED_FILE_EXISTS     0x0103
#define SKIPPED_BAD_PASSWORD     0x0104
#define SKIPPED_NO_ENCRYPTION     0x0105
#define SKIPPED_COMPRESSION_UNKNOWN   0x0106
#define SKIPPED_UNKNOWN_ZIPHOST    0x0107
#define SKIPPED_FILEFORMAT_WRONG    0x0108
#define SKIPPED_EXTRACT_ERROR     0x0109

In ZipMstr.pas

type
  UnZipSkipTypes = ( stOnFreshen, stNoOverwrite, stFileExists,
stBadPassword, stNoEncryptionDLL, stCompressionUnknown, stUnknownZipHost,
stZipFileFormatWrong, stGeneralExtractError );


Suggested workaround - redeclare the UnZipSkipTypes enumeration:

  UnZipSkipTypes = ( stUnknown, stOnFreshen, stNoOverwrite, stFileExists,
    stBadPassword, stNoEncryptionDLL, stCompressionUnknown,
    stUnknownZipHost, stZipFileFormatWrong, stGeneralExtractError );

-------------------------------------------------

Other issues I've spotted with the vers160 dlls:

 1. when adding Foldernames to FileSpecList, a trailing slash is required
     to indicate they are folders.
  2. ??bug - if filenames are stored in OEM format the dll will extract but
     not delete them.
  3. cancelling an add/delete operation corrupts the zip file. A workaround
     requires saving a copy of the file before these operations.

Angus Johnson


Other related posts: