"SfR Fresh" - the SfR Freeware/Shareware Archive 
Member "windll.txt" of archive zip232dN.zip:
As a special service "SfR Fresh" has tried to format the requested source page into HTML format using source code syntax highlighting with prefixed line numbers.
Alternatively you can here view or download the uninterpreted source code file.
That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
1 The code set out below is not intended to be compiled, but is only intended as
2 a very simplistic pointer to how to load and call the dll. You will have to
3 look in the files referenced below for actual, working code.
4
5 There are two entry points that use the structure shown below:
6
7 BOOL WINAPI ZpSetOptions(ZPOPT) and
8 ZPOPT WINAPI ZpGetOptions(void)
9
10 typedef struct {
11 LPSTR Date; /* Date to include after */
12 LPSTR szRootDir; /* Directory to use as base for zipping */
13 LPSTR szTempDir; /* Temporary directory used during zipping */
14 BOOL fTemp; /* Use temporary directory '-b' during zipping */
15 BOOL fSuffix; /* include suffixes (not implemented in WiZ) */
16 BOOL fEncrypt; /* encrypt files */
17 BOOL fSystem; /* include system and hidden files */
18 BOOL fVolume; /* Include volume label */
19 BOOL fExtra; /* Exclude extra attributes */
20 BOOL fNoDirEntries; /* Do not add directory entries */
21 BOOL fExcludeDate; /* Exclude files earlier than specified date */
22 BOOL fIncludeDate; /* Include only files earlier than specified date */
23 BOOL fVerbose; /* Mention oddities in zip file structure */
24 BOOL fQuiet; /* Quiet operation */
25 BOOL fCRLF_LF; /* Translate CR/LF to LF */
26 BOOL fLF_CRLF; /* Translate LF to CR/LF */
27 BOOL fJunkDir; /* Junk directory names */
28 BOOL fGrow; /* Allow appending to a zip file */
29 BOOL fForce; /* Make entries using DOS names (k for Katz) */
30 BOOL fMove; /* Delete files added or updated in zip file */
31 BOOL fDeleteEntries; /* Delete files from zip file */
32 BOOL fUpdate; /* Update zip file--overwrite only if newer */
33 BOOL fFreshen; /* Freshen zip file--overwrite only */
34 BOOL fJunkSFX; /* Junk SFX prefix */
35 BOOL fLatestTime; /* Set zip file time to time of latest file in it */
36 BOOL fComment; /* Put comment in zip file */
37 BOOL fOffsets; /* Update archive offsets for SFX files */
38 BOOL fPrivilege; /* Use privileges (WIN32 only) */
39 BOOL fEncryption; /* TRUE if encryption supported, else FALSE.
40 this is a read-only flag */
41 int fRecurse; /* Recurse into subdirectories. 1 => -r, 2 => -R */
42 int fRepair; /* Repair archive. 1 => -F, 2 => -FF */
43 char fLevel; /* Compression level (0 - 9) */
44 } ZPOPT, _far *LPZPOPT;
45
46 BOOL WINAPI ZpSetOptions(ZPOPT);
47
48 This call will simply set the options in the zip dll until such time as
49 another call to this function is made. This must be made before the initial
50 call to make or update an archive.
51
52 ZPOPT WINAPI ZpGetOptions(void);
53
54 The call will return the above structure from the dll, with the fEncryption
55 flag set to the appropriate value based on whether encryption is supported
56 in this dll or not. It is currently used in WiZ only to determine if
57 encryption is actually supported.
58
59 The main entry point is ZpArchive(ZCL) where the structure shown below
60 is passed to the DLL when it is called.
61
62 typedef struct {
63 int argc; = Count of files to zip
64 LPSTR lpszZipFN; = Archive file name
65 char **FNV; = file names to zip up. Think of this an argv
66 } ZCL, _far *LPZCL;
67
68
69 For examples of how the actual calls to the dll were set up in WiZ, look in
70 the file makezip.c in the WiZ source directory.
71
72 For examples of how the actual loading and unloading of the dll's themselves
73 was done, look in wizmain.c in the WiZ source directory. Note that WiZ looks
74 specifically for a particular version number of the dll, and also expects to
75 find the company name to be Info-ZIP. This is to protect from getting different
76 versions of the dll loaded, with resulting unknown behavior.
77
78 There is a very simplistic example of how to load and call into the dll in
79 example.c and example.h. Note that this example does not implement any
80 command line switches at all, and is merely intended as a guide for those
81 brave enough to enter a new world.
82
83 There are four additional (at the moment) entry points:
84
85 ZpInit, defined as
86
87 int WINAPI ZpInit(ZIPUSERFUNCTIONS far * lpZipUserFunc);
88
89 where ZIPUSERFUNCTIONS is defined as below.
90
91 ZpVersion, defined as
92
93 ZpVer * ZpVersion(void);
94
95 where ZpVer is defined as:
96
97 typedef struct _ZpVer {
98 ulg structlen; /* length of the struct being passed */
99 ulg flag; /* bit 0: is_beta bit 1: uses_zlib */
100 char *betalevel; /* e.g., "g BETA" or "" */
101 char *date; /* e.g., "4 Sep 95" (beta) or "4 September 1995" */
102 char *zlib_version; /* e.g., "0.95" or NULL */
103 _zip_version_type zip;
104 _zip_version_type os2dll;
105 _zip_version_type windll;
106 } ZpVer;
107
108 See api.c for exactly what ZpVersion does, but the short version of
109 what it does is return the zip and dll versions in the ZpVer structure.
110 The structure typedef's are in api.h
111
112 The typedef's for the function pointers in the structure ZIPUSERFUNCTIONS
113 are shown immediately below.
114
115 typedef int (WINAPI DLLPRNT) (LPSTR, unsigned long);
116 typedef int (WINAPI DLLPASSWORD) (LPSTR, int, LPCSTR, LPCSTR);
117 typedef int (WINAPI DLLSERVICE) (LPCSTR, unsigned long);
118 typedef int (WINAPI DLLCOMMENT) (LPSTR);
119
120 typedef struct {
121 DLLPRNT *print; = pointer to application's print function.
122 DLLCOMMENT *comment; = pointer to application's function for processing
123 comments.
124 DLLPASSWORD *password; = pointer to application's function for processing
125 passwords.
126 DLLSERVICE *ServiceApplication; = Optional callback function for processing
127 messages, relaying information.
128 } ZIPUSERFUNCTIONS, far * LPZIPUSERFUNCTIONS;
129
130 Last revised January 5, 1999.
131
132 Mike White