-
Notifications
You must be signed in to change notification settings - Fork 3
/
SBZipUtils.pas
658 lines (570 loc) · 21.6 KB
/
SBZipUtils.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
unit SBZipUtils;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Printers, StdCtrls, ComCtrls, ExtCtrls, ImgList, ToolWin, Zip32, UnZip32;
procedure Set_UserFunctions(var Z:TUserFunctions);
procedure SetDummyInitFunctions(var Z : TZipUserFunctions);
function DllPrnt(Buffer: PChar; Size: ULONG): integer; stdcall;
function DllPassword(P: PChar; N: Integer; M, Name: PChar): integer; stdcall;
function DllService(CurFile: PChar; Size: ULONG): integer; stdcall;
function DllReplace(FileNam: PChar): integer; stdcall;
procedure DllMessage(UnCompSize : ULONG;
CompSize : ULONG;
Factor : UINT;
Month : UINT;
Day : UINT;
Year : UINT;
Hour : UINT;
Minute : UINT;
C : Char;
FileNam : PChar;
MethBuf : PChar;
CRC : ULONG;
Crypt : Char); stdcall;
function DummyPrint(Buffer : PChar; Size: ULONG) : integer; stdcall;
function DummyPassword(P : PChar; N : Integer; M,Name : PChar) : integer; stdcall;
function DummyComment(Buffer : PChar): Pchar; stdcall;
function DummyService(Buffer : PChar; size : ULong) : integer; stdcall;
function ListItemCallback(CurFile : PChar; Size : ULOng) : integer; stdcall;
procedure ExtractFileFromZip(ZipFile : string; FileName : string; XPath : string);
procedure ExtractFilesFromZip( ZipFile : string; Files : TStringList; XPath : string);
procedure AddFileToZip(St : string; ZipFile : string; moveFile : boolean);
procedure AddFilesToZip( hFiles : TStringList; ZipFile : string; moveFile : boolean);
procedure DeleteFileFromZIP(ZIPFile : String; Name : String);
function GetFileDataFromZip(ZipFile, FileName: string; var FileData : string; bSB : boolean ) : boolean;
// function GetDataFromZip(ZipFile, FileName: string; var lpData : PChar; var uiLen : integer ) : boolean;
function ListZipEntries(ZipFile : string; FilePath : string; XPath : string) : TStringList;
implementation
var UF : TUserFunctions;
var hFileList : TStringList;
procedure AddFileToZip(St : string; ZipFile : string; moveFile : boolean);
var ZO : TZPOPt;
ZUF : TZipUserFunctions;
ZipRec : TZCL;
i : integer;
FNVStart : PCharArray;
FileNam : string;
FileList : TStrings;
begin
// This function adds the specified filename to the zip file specified
// by OHPFile... This is a bit rough, and shouldn't be in this unit.
// V3!
ZO:=ZpGetOptions;
ZO.fGrow:=true;
ZO.fUpdate:=true;
ZO.fJunkDir:=true;
ZO.fNoDirEntries:=true;
ZO.fMove:=moveFile;
ZO.fLevel:='9';
ZO.fDeleteEntries:=false;
ZpSetOptions(ZO);
SetDummyInitFunctions(ZUF);
FileNam:=ZipFile;
FileList:=TStringList.create;
FileList.Add(St);
{ precaution }
if Trim(FileNam) = '' then Exit;
if FileList.Count <= 0 then Exit;
{ initialize the dll with dummy functions }
SetDummyInitFunctions(ZUF);
{ number of files to zip }
ZipRec.argc := FileList.Count;
{ name of zip file - allocate room for null terminated string }
GetMem(ZipRec.lpszZipFN, Length(FileNam) + 1 );
ZipRec.lpszZipFN := StrPCopy( ZipRec.lpszZipFN, FileNam);
try
{ dynamic array allocation }
GetMem(ZipRec.FNV, ZipRec.argc * SizeOf(PChar));
FNVStart := ZipRec.FNV;
try
{ copy the file names from FileList to ZipRec.FNV dynamic array }
for i := 0 to ZipRec.argc - 1 do
begin
GetMem(ZipRec.FNV^[i], Length(FileList[i]) + 1 );
StrPCopy(ZipRec.FNV^[i], FileList[i]);
end;
try
{ send the data to the dll }
ZpArchive(ZipRec);
finally
{ release the memory for the file list }
ZipRec.FNV := FNVStart;
for i := (ZipRec.argc - 1) downto 0 do
FreeMem(ZipRec.FNV^[i], Length(FileList[i]) + 1 );
end;
finally
{ release the memory for the ZipRec.FNV dynamic array }
ZipRec.FNV := FNVStart;
FreeMem(ZipRec.FNV, ZipRec.argc * SizeOf(PChar));
end;
finally
{ release the memory for the FileName }
FreeMem(ZipRec.lpszZipFN, Length(FileNam) + 1 );
end;
FileList.Free;
end;
procedure AddFilesToZip( hFiles : TStringList; ZipFile : string; moveFile : boolean);
var ZO : TZPOPt;
ZUF : TZipUserFunctions;
ZipRec : TZCL;
i : integer;
FNVStart : PCharArray;
FileNam : string;
begin
// This function adds the specified filename to the zip file specified
// by OHPFile... This is a bit rough, and shouldn't be in this unit.
// V3!
FNVStart := nil;
ZO:=ZpGetOptions;
ZO.fGrow:=true;
ZO.fUpdate:=false;
ZO.fJunkDir:=true;
ZO.fNoDirEntries:=true;
ZO.fMove:=moveFile;
ZO.fLevel:='9';
ZO.fDeleteEntries:=false;
ZpSetOptions(ZO);
SetDummyInitFunctions(ZUF);
FileNam := ZipFile;
//----------------------------------------------------------------------------
// NOTE: We turn "Range checking" off at several points here, as Delphi
// is unswerving in its assertion that FNV is always a 0 length array,
// and we just allocate enough space for what we need instead in its place.
//----------------------------------------------------------------------------
{ FileList:=TStringList.create;
for i := 0 to length(aSt)-1 do begin
FileList.Add(aSt[i]);
end;}
{ precaution }
if Trim(FileNam) = '' then Exit;
if hFiles.Count <= 0 then Exit;
{ initialize the dll with dummy functions }
SetDummyInitFunctions(ZUF);
{ number of files to zip }
ZipRec.argc := hFiles.Count;
{ name of zip file - allocate room for null terminated string }
try
GetMem(ZipRec.lpszZipFN, Length(FileNam) + 1 );
ZipRec.lpszZipFN := StrPCopy( ZipRec.lpszZipFN, FileNam );
try
{ dynamic array allocation }
GetMem(ZipRec.FNV, ZipRec.argc * SizeOf(PChar));
// ZipRec.FNV^ := FNV;
FNVStart := ZipRec.FNV;
// try
{ copy the file names from FileList to ZipRec.FNV dynamic array }
{$R-}
for i := 0 to ZipRec.argc - 1 do
begin
GetMem( ZipRec.FNV^[i], Length(hFiles[i]) + 1 );
StrPCopy(ZipRec.FNV^[i], hFiles[i]);
end;
{$R+}
try
{ send the data to the dll }
ZpArchive(ZipRec);
finally
{ release the memory for the file list }
{$R-}
ZipRec.FNV := FNVStart;
for i := (ZipRec.argc - 1) downto 0 do
FreeMem(ZipRec.FNV[i], Length(hFiles[i]) + 1 );
{$R+}
end;
finally
// release the memory for the ZipRec.FNV dynamic array
ZipRec.FNV := FNVStart;
FreeMem(ZipRec.FNV, ZipRec.argc * SizeOf(PChar));
end;
finally
{ release the memory for the FileName }
ZipRec.FNV := FNVStart;
FreeMem(ZipRec.lpszZipFN, Length(FileNam) + 1 );
end;
// FileList.Free;
end;
procedure DeleteFileFromZIP(ZIPFile : String; Name : String);
var ZO : TZPOPt;
ZUF : TZipUserFunctions;
ZipRec : TZCL;
i : integer;
FNVStart : PCharArray;
FileList : TStrings;
begin
ZO:=ZpGetOptions;
ZO.fGrow:=false;
ZO.fUpdate:=false;
ZO.fMove:=false;
ZO.fDeleteEntries:=true;
ZpSetOptions(ZO);
SetDummyInitFunctions(ZUF);
FileList:=TStringList.create;
FileList.Add(Name);
{ precaution }
if Trim(Name) = '' then Exit;
if FileList.Count <= 0 then Exit;
{ initialize the dll with dummy functions }
SetDummyInitFunctions(ZUF);
{ number of files to zip }
ZipRec.argc := FileList.Count;
{ name of zip file - allocate room for null terminated string }
GetMem(ZipRec.lpszZipFN, Length(ZipFile) + 1 );
ZipRec.lpszZipFN := StrPCopy( ZipRec.lpszZipFN, ZipFile);
try
{ dynamic array allocation }
GetMem(ZipRec.FNV, ZipRec.argc * SizeOf(PChar));
FNVStart := ZipRec.FNV;
try
{ copy the file names from FileList to ZipRec.FNV dynamic array }
for i := 0 to ZipRec.argc - 1 do
begin
GetMem(ZipRec.FNV^[i], Length(FileList[i]) + 1 );
StrPCopy(ZipRec.FNV^[i], FileList[i]);
end;
try
{ send the data to the dll }
ZpArchive(ZipRec);
finally
{ release the memory for the file list }
ZipRec.FNV := FNVStart;
for i := (ZipRec.argc - 1) downto 0 do
FreeMem(ZipRec.FNV^[i], Length(FileList[i]) + 1 );
end;
finally
{ release the memory for the ZipRec.FNV dynamic array }
ZipRec.FNV := FNVStart;
FreeMem(ZipRec.FNV, ZipRec.argc * SizeOf(PChar));
end;
finally
{ release the memory for the FileName }
FreeMem(ZipRec.lpszZipFN, Length(ZipFile) + 1 );
end;
FileList.Free;
end;
procedure ExtractFileFromZip(ZipFile : string; FileName : string; XPath : string);
var
Opt : TDCL;
i : integer;
SelectedList : TstringList;
FNV : array[0..999] of PChar;
argc : integer;
S1,S2 : string;
begin
{ precautions }
Set_UserFunctions(UF);
SelectedList:=TStringList.Create;
SelectedList.Clear;
with Opt do
begin
ExtractOnlyNewer := Integer(False); { true if you are to extract only newer }
SpaceToUnderscore := Integer(False); { true if convert space to underscore }
PromptToOverwrite := Integer(False); { true if prompt to overwrite is wanted }
fQuiet := 2; { quiet flag. 1 = few messages, 2 = no messages, 0 = all messages }
nCFlag := Integer(False); { write to stdout if true }
nTFlag := Integer(False); { test zip file }
nVFlag := Integer(False); { verbose listing }
nUFlag := Integer(False); { "update" (extract only newer/new files) }
nZFlag := Integer(False); { display zip file comment }
nDFlag := Integer(True); { all args are files/dir to be extracted }
nOFlag := Integer(True); { true if you are to always over-write files, false if not }
nAFlag := Integer(False); { do end-of-line translation }
nZIFlag := Integer(False); { get zip info if true }
C_flag := Integer(True); { be case insensitive if TRUE }
fPrivilege := 1; { 1 => restore Acl's, 2 => Use privileges }
S1:=XPath;
while S1[length(S1)]<>'\' do S1:=copy(S1,1,length(S1)-1);
S1:=copy(S1,1,length(S1)-1);
S2:=ZipFile;
lpszExtractDir := PChar(S1); { zip file name }
lpszZipFN := PChar(S2); { Directory to extract to. NULL for the current directory }
end;
{ get the selected files }
SelectedList.Add(FileName);
{ if there are any selected files }
if SelectedList.Count > 0 then
begin
{ copy the file names from SelectedList to FNV dynamic array }
for i := 0 to SelectedList.Count - 1 do
begin
GetMem(FNV[i], Length(SelectedList[i]) + 1 );
StrPCopy(FNV[i], SelectedList[i]);
end;
argc := SelectedList.Count;
{ unzip }
Wiz_SingleEntryUnzip(argc, { number of file names being passed }
@FNV, { file names to be unarchived }
0, { number of "file names to be excluded from processing" being passed }
nil, { file names to be excluded from the unarchiving process }
Opt, { pointer to a structure with the flags for setting the various options }
UF); { pointer to a structure that contains pointers to user functions }
{ release the memory }
for i := (SelectedList.Count - 1) downto 0 do
FreeMem(FNV[i], Length(SelectedList[i]) + 1 );
end;
SelectedList.Free;
end;
procedure ExtractFilesFromZip( ZipFile:string; Files:TStringList; XPath:string );
var
Opt : TDCL;
i : integer;
FNV : array[0..999] of PChar;
argc : integer;
S1,S2 : string;
begin
{ precautions }
Set_UserFunctions(UF);
with Opt do
begin
ExtractOnlyNewer := Integer(False); { true if you are to extract only newer }
SpaceToUnderscore := Integer(False); { true if convert space to underscore }
PromptToOverwrite := Integer(False); { true if prompt to overwrite is wanted }
fQuiet := 2; { quiet flag. 1 = few messages, 2 = no messages, 0 = all messages }
nCFlag := Integer(False); { write to stdout if true }
nTFlag := Integer(False); { test zip file }
nVFlag := Integer(False); { verbose listing }
nUFlag := Integer(False); { "update" (extract only newer/new files) }
nZFlag := Integer(False); { display zip file comment }
nDFlag := Integer(True); { all args are files/dir to be extracted }
nOFlag := Integer(True); { true if you are to always over-write files, false if not }
nAFlag := Integer(False); { do end-of-line translation }
nZIFlag := Integer(False); { get zip info if true }
C_flag := Integer(True); { be case insensitive if TRUE }
fPrivilege := 1; { 1 => restore Acl's, 2 => Use privileges }
S1:=XPath;
while S1[length(S1)]<>'\' do S1:=copy(S1,1,length(S1)-1);
S1:=copy(S1,1,length(S1)-1);
S2:=ZipFile;
lpszExtractDir := PChar(S1); { zip file name }
lpszZipFN := PChar(S2); { Directory to extract to. NULL for the current directory }
end;
{ if there are any selected files }
if Files.Count > 0 then
begin
{ copy the file names from SelectedList to FNV dynamic array }
for i := 0 to Files.Count - 1 do
begin
GetMem(FNV[i], Length(Files[i]) + 1 );
StrPCopy(FNV[i], Files[i]);
end;
argc := Files.Count;
{ unzip }
Wiz_SingleEntryUnzip(argc, { number of file names being passed }
@FNV, { file names to be unarchived }
0, { number of "file names to be excluded from processing" being passed }
nil, { file names to be excluded from the unarchiving process }
Opt, { pointer to a structure with the flags for setting the various options }
UF); { pointer to a structure that contains pointers to user functions }
{ release the memory }
for i := (Files.Count - 1) downto 0 do begin
FreeMem(FNV[i], Length(Files[i]) + 1 );
end;
end;
end;
function ListZipEntries(ZipFile : string; FilePath : string; XPath : string) : TStringList;
var
Opt : TDCL;
i : integer;
SelectedList : TstringList;
FNV : array[0..999] of PChar;
argc : integer;
S1,S2 : string;
begin
{ precautions }
Set_UserFunctions(UF);
@UF.ServCallBk := @ListItemCallback;
SelectedList:=TStringList.Create;
SelectedList.Clear;
hFileList := TStringList.Create;
hFileList.Clear;
with Opt do
begin
ExtractOnlyNewer := Integer(False); { true if you are to extract only newer }
SpaceToUnderscore := Integer(False); { true if convert space to underscore }
PromptToOverwrite := Integer(False); { true if prompt to overwrite is wanted }
fQuiet := 2; { quiet flag. 1 = few messages, 2 = no messages, 0 = all messages }
nCFlag := Integer(True); { write to stdout if true }
nTFlag := Integer(False); { test zip file }
nVFlag := Integer(True); { verbose listing }
nUFlag := Integer(False); { "update" (extract only newer/new files) }
nZFlag := Integer(False); { display zip file comment }
nDFlag := Integer(True); { all args are files/dir to be extracted }
nOFlag := Integer(True); { true if you are to always over-write files, false if not }
nAFlag := Integer(False); { do end-of-line translation }
nZIFlag := Integer(False); { get zip info if true }
C_flag := Integer(True); { be case insensitive if TRUE }
fPrivilege := 1; { 1 => restore Acl's, 2 => Use privileges }
S1:=XPath;
while S1[length(S1)]<>'\' do S1:=copy(S1,1,length(S1)-1);
S1:=copy(S1,1,length(S1)-1);
S2:=ZipFile;
lpszExtractDir := PChar(S1); { zip file name }
lpszExtractDir := nil;
lpszZipFN := PChar(S2); { Directory to extract to. NULL for the current directory }
end;
{ get the selected files }
SelectedList.Add(FilePath);
{ if there are any selected files }
if SelectedList.Count > 0 then
begin
{ copy the file names from SelectedList to FNV dynamic array }
for i := 0 to SelectedList.Count - 1 do
begin
GetMem(FNV[i], Length(SelectedList[i]) + 1 );
StrPCopy(FNV[i], SelectedList[i]);
end;
argc := SelectedList.Count;
{ unzip }
Wiz_SingleEntryUnzip(argc, { number of file names being passed }
@FNV, { file names to be unarchived }
0, { number of "file names to be excluded from processing" being passed }
nil, { file names to be excluded from the unarchiving process }
Opt, { pointer to a structure with the flags for setting the various options }
UF); { pointer to a structure that contains pointers to user functions }
{ release the memory }
for i := (SelectedList.Count - 1) downto 0 do
FreeMem(FNV[i], Length(SelectedList[i]) + 1 );
end;
SelectedList.Free;
Result := hFileList;
end;
{
Unzips a file from the ZIP file straight into memory
and returns a string handle to the contents.
} {
function GetDataFromZip(ZipFile, FileName: string; var lpData : PChar; var uiLen : integer ) : boolean;
var
Buffer : TUzpBuffer;
lpszZipFile : PChar;
lpszFilename : PChar;
lpszResult : PChar;
begin
// precautions - set up the User Functions list
Set_UserFunctions(UF);
GetDataFromZip := false;
// convert arguments to PChars
lpszZipFile := PChar(ZipFile); // zip file name
lpszFilename := PChar(FileName); // filename from zip to extract
// unzip it! - it will allocate a buffer
if 0 = Wiz_UnzipToMemory( lpszZipFile, lpszFilename, UF, Buffer ) then begin
Exit;
end;
// release the allocated buffer. IMPROVE: Just point at the data!!
//UzpFreeMemBuffer( Buffer );
lpData := Buffer.StrPtr;
uiLen := Buffer.StrLength;
GetDataFromZip := true;
end;
}
{
Unzips a file from the ZIP file straight into memory
and returns a string handle to the contents.
}
function GetFileDataFromZip(ZipFile, FileName: string; var FileData : string; bSB : boolean ) : boolean;
var
Buffer : TUzpBuffer;
lpszZipFile : PChar;
lpszFilename : PChar;
sResult : string;
lpszResult : PChar;
begin
{ precautions - set up the User Functions list}
Set_UserFunctions(UF);
GetFileDataFromZip := false;
{ convert arguments to PChars }
lpszZipFile := PChar(ZipFile); { zip file name }
lpszFilename := PChar(FileName); { filename from zip to extract }
{ unzip it! - it will allocate a buffer }
if 0 = Wiz_UnzipToMemory( lpszZipFile, lpszFilename, UF, Buffer ) then begin
Exit;
end;
// OK, this is wrong, bad, bad-wrong, badong, but I'm going to do it here
// anyway, because it's quicker like that...
{-------------- SONGBASE 2.0 FILE FORMAT SPECFIC BIT ----------------}
lpszResult := Buffer.StrPtr;
if bSB then begin
if (Buffer.StrLength < 4) or
( (0 <> AnsiStrLComp( Buffer.StrPtr, '!SB!', 4 )) and
(0 <> AnsiStrLComp( Buffer.StrPtr, 'SDB2', 4 )) ) then begin
messagedlg('The file '+FileName+' did not contain a valid version string',mtError,[mbOk],0);
Exit;
end;
// Skip the version line...
while Ord(lpszResult[0]) > 20 do inc(lpszResult);
while Ord(lpszResult[0]) < 20 do inc(lpszResult);
end;
{------------ END OF SONGBASE 2.0 FILE FORMAT SPECFIC BIT -------------}
{ convert the buffer to a Delphi string }
SetString( sResult, lpszResult, Buffer.StrLength - ( lpszResult - Buffer.StrPtr ) );
{ release the allocated buffer. IMPROVE: Just point at the data!! }
UzpFreeMemBuffer( Buffer );
FileData := sResult;
GetFileDataFromZip := true;
end;
procedure Set_UserFunctions(var Z:TUserFunctions);
begin
{ prepare TUserFunctions structure }
with Z do
begin
@Print := @DllPrnt;
@Sound := nil;
@Replace := @DllReplace;
@Password := @DllPassword;
@SendApplicationMessage := @DllMessage;
@ServCallBk := @DllService;
end;
end;
procedure SetDummyInitFunctions(var Z : TZipUserFunctions);
begin
with Z do begin
@Print := @DummyPrint;
@Comment := @DummyComment;
@Password := @DummyPassword;
@Service := @DummyService;
end;
ZpInit(Z);
end;
function DummyPrint(Buffer : PChar; Size: ULONG) : integer;
begin
Result:=size;
end;
function DummyPassword(P : PChar; N : INteger; M, Name : Pchar) : integer;
begin
result:=1;
end;
function DummyComment(Buffer : PChar) : PChar;
begin
result:=Buffer;
end;
function DummyService(Buffer : PChar; Size : ULONG) : integer;
begin
result:=0;
end;
procedure DllMessage(UnCompSize,Compsize : Ulong; Factor,Month,Day,Year,Hour,Minute : UInt;
C : Char; FileNam,MethBuf : PChar; CRC : ULong; Crypt : Char);
begin
{}
end;
function DllPassword(P : PChar; N : Integer; M,Name : PChar): integer;
begin
Result:=1;
end;
function DllService(CurFile : PChar; Size : ULOng) : integer;
begin
result:=0;
end;
function DllReplace(FileNam : PChar) : integer;
begin
result:=1;
end;
function DllPrnt(Buffer: PChar; Size : ULong) : integer;
begin
Result:=size;
end;
function ListItemCallback(CurFile : PChar; Size : ULOng) : integer;
var sResult : string;
begin
sResult := CurFile;
hFileList.Add( sResult );
result:=0;
end;
end.