unrarsrc  6.1.7
About: unrar extracts, views and tests the contents of archives created with the RAR archiver.
  Fossies Dox: unrarsrc-6.1.7.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

dll.cpp
Go to the documentation of this file.
1#include "rar.hpp"
2
3static int RarErrorToDll(RAR_EXIT ErrCode);
4
5struct DataSet
6{
12
14};
15
16
17HANDLE PASCAL RAROpenArchive(struct RAROpenArchiveData *r)
18{
20 memset(&rx,0,sizeof(rx));
21 rx.ArcName=r->ArcName;
22 rx.OpenMode=r->OpenMode;
23 rx.CmtBuf=r->CmtBuf;
25 HANDLE hArc=RAROpenArchiveEx(&rx);
27 r->CmtSize=rx.CmtSize;
28 r->CmtState=rx.CmtState;
29 return hArc;
30}
31
32
33HANDLE PASCAL RAROpenArchiveEx(struct RAROpenArchiveDataEx *r)
34{
35 DataSet *Data=NULL;
36 try
37 {
39
40 r->OpenResult=0;
41 Data=new DataSet;
42 Data->Cmd.DllError=0;
43 Data->OpenMode=r->OpenMode;
44 Data->Cmd.FileArgs.AddString(L"*");
46
47 char AnsiArcName[NM];
48 *AnsiArcName=0;
49 if (r->ArcName!=NULL)
50 {
51 strncpyz(AnsiArcName,r->ArcName,ASIZE(AnsiArcName));
52#ifdef _WIN_ALL
53 if (!AreFileApisANSI())
54 {
55 OemToCharBuffA(r->ArcName,AnsiArcName,ASIZE(AnsiArcName));
56 AnsiArcName[ASIZE(AnsiArcName)-1]=0;
57 }
58#endif
59 }
60
61 wchar ArcName[NM];
62 GetWideName(AnsiArcName,r->ArcNameW,ArcName,ASIZE(ArcName));
63
64 Data->Cmd.AddArcName(ArcName);
66 Data->Cmd.VersionControl=1;
67
68 Data->Cmd.Callback=r->Callback;
69 Data->Cmd.UserData=r->UserData;
70
71 // Open shared mode is added by request of dll users, who need to
72 // browse and unpack archives while downloading.
73 Data->Cmd.OpenShared = true;
74 if (!Data->Arc.Open(ArcName,FMF_OPENSHARED))
75 {
77 delete Data;
78 return NULL;
79 }
80 if (!Data->Arc.IsArchive(true))
81 {
82 if (Data->Cmd.DllError!=0)
83 r->OpenResult=Data->Cmd.DllError;
84 else
85 {
87 if (ErrCode!=RARX_SUCCESS && ErrCode!=RARX_WARNING)
88 r->OpenResult=RarErrorToDll(ErrCode);
89 else
91 }
92 delete Data;
93 return NULL;
94 }
95 r->Flags=0;
96
97 if (Data->Arc.Volume)
99 if (Data->Arc.MainComment)
101 if (Data->Arc.Locked)
102 r->Flags|=ROADF_LOCK;
103 if (Data->Arc.Solid)
104 r->Flags|=ROADF_SOLID;
105 if (Data->Arc.NewNumbering)
107 if (Data->Arc.Signed)
109 if (Data->Arc.Protected)
111 if (Data->Arc.Encrypted)
113 if (Data->Arc.FirstVolume)
115
116 Array<wchar> CmtDataW;
117 if (r->CmtBufSize!=0 && Data->Arc.GetComment(&CmtDataW))
118 {
119 if (r->CmtBufW!=NULL)
120 {
121 CmtDataW.Push(0);
122 size_t Size=wcslen(&CmtDataW[0])+1;
123
124 r->CmtState=Size>r->CmtBufSize ? ERAR_SMALL_BUF:1;
125 r->CmtSize=(uint)Min(Size,r->CmtBufSize);
126 memcpy(r->CmtBufW,&CmtDataW[0],(r->CmtSize-1)*sizeof(*r->CmtBufW));
127 r->CmtBufW[r->CmtSize-1]=0;
128 }
129 else
130 if (r->CmtBuf!=NULL)
131 {
132 Array<char> CmtData(CmtDataW.Size()*4+1);
133 memset(&CmtData[0],0,CmtData.Size());
134 WideToChar(&CmtDataW[0],&CmtData[0],CmtData.Size()-1);
135 size_t Size=strlen(&CmtData[0])+1;
136
137 r->CmtState=Size>r->CmtBufSize ? ERAR_SMALL_BUF:1;
138 r->CmtSize=(uint)Min(Size,r->CmtBufSize);
139 memcpy(r->CmtBuf,&CmtData[0],r->CmtSize-1);
140 r->CmtBuf[r->CmtSize-1]=0;
141 }
142 }
143 else
144 r->CmtState=r->CmtSize=0;
145 Data->Extract.ExtractArchiveInit(Data->Arc);
146 return (HANDLE)Data;
147 }
148 catch (RAR_EXIT ErrCode)
149 {
150 if (Data!=NULL && Data->Cmd.DllError!=0)
151 r->OpenResult=Data->Cmd.DllError;
152 else
153 r->OpenResult=RarErrorToDll(ErrCode);
154 if (Data != NULL)
155 delete Data;
156 return NULL;
157 }
158 catch (std::bad_alloc&) // Catch 'new' exception.
159 {
161 if (Data != NULL)
162 delete Data;
163 }
164 return NULL; // To make compilers happy.
165}
166
167
168int PASCAL RARCloseArchive(HANDLE hArcData)
169{
170 DataSet *Data=(DataSet *)hArcData;
171 try
172 {
173 bool Success=Data==NULL ? false:Data->Arc.Close();
174 delete Data;
175 return Success ? ERAR_SUCCESS : ERAR_ECLOSE;
176 }
177 catch (RAR_EXIT ErrCode)
178 {
179 return Data->Cmd.DllError!=0 ? Data->Cmd.DllError : RarErrorToDll(ErrCode);
180 }
181}
182
183
184int PASCAL RARReadHeader(HANDLE hArcData,struct RARHeaderData *D)
185{
186 struct RARHeaderDataEx X;
187 memset(&X,0,sizeof(X));
188
189 int Code=RARReadHeaderEx(hArcData,&X);
190
193 D->Flags=X.Flags;
194 D->PackSize=X.PackSize;
195 D->UnpSize=X.UnpSize;
196 D->HostOS=X.HostOS;
197 D->FileCRC=X.FileCRC;
198 D->FileTime=X.FileTime;
199 D->UnpVer=X.UnpVer;
200 D->Method=X.Method;
201 D->FileAttr=X.FileAttr;
202 D->CmtSize=0;
203 D->CmtState=0;
204
205 return Code;
206}
207
208
209int PASCAL RARReadHeaderEx(HANDLE hArcData,struct RARHeaderDataEx *D)
210{
211 DataSet *Data=(DataSet *)hArcData;
212 try
213 {
214 if ((Data->HeaderSize=(int)Data->Arc.SearchBlock(HEAD_FILE))<=0)
215 {
216 if (Data->Arc.Volume && Data->Arc.GetHeaderType()==HEAD_ENDARC &&
218 if (MergeArchive(Data->Arc,NULL,false,'L'))
219 {
220 Data->Arc.Seek(Data->Arc.CurBlockPos,SEEK_SET);
221 return RARReadHeaderEx(hArcData,D);
222 }
223 else
224 return ERAR_EOPEN;
225
226 if (Data->Arc.BrokenHeader)
227 return ERAR_BAD_DATA;
228
229 // Might be necessary if RARSetPassword is still called instead of
230 // open callback for RAR5 archives and if password is invalid.
231 if (Data->Arc.FailedHeaderDecryption)
232 return ERAR_BAD_PASSWORD;
233
234 return ERAR_END_ARCHIVE;
235 }
236 FileHeader *hd=&Data->Arc.FileHead;
237 if (Data->OpenMode==RAR_OM_LIST && hd->SplitBefore)
238 {
239 int Code=RARProcessFile(hArcData,RAR_SKIP,NULL,NULL);
240 if (Code==0)
241 return RARReadHeaderEx(hArcData,D);
242 else
243 return Code;
244 }
245 wcsncpy(D->ArcNameW,Data->Arc.FileName,ASIZE(D->ArcNameW));
247
248 wcsncpy(D->FileNameW,hd->FileName,ASIZE(D->FileNameW));
250#ifdef _WIN_ALL
251 CharToOemA(D->FileName,D->FileName);
252#endif
253
254 D->Flags=0;
255 if (hd->SplitBefore)
257 if (hd->SplitAfter)
259 if (hd->Encrypted)
261 if (hd->Solid)
262 D->Flags|=RHDF_SOLID;
263 if (hd->Dir)
265
266 D->PackSize=uint(hd->PackSize & 0xffffffff);
267 D->PackSizeHigh=uint(hd->PackSize>>32);
268 D->UnpSize=uint(hd->UnpSize & 0xffffffff);
269 D->UnpSizeHigh=uint(hd->UnpSize>>32);
271 D->UnpVer=Data->Arc.FileHead.UnpVer;
272 D->FileCRC=hd->FileHash.CRC32;
273 D->FileTime=hd->mtime.GetDos();
274
275 uint64 MRaw=hd->mtime.GetWin();
276 D->MtimeLow=(uint)MRaw;
277 D->MtimeHigh=(uint)(MRaw>>32);
278 uint64 CRaw=hd->ctime.GetWin();
279 D->CtimeLow=(uint)CRaw;
280 D->CtimeHigh=(uint)(CRaw>>32);
281 uint64 ARaw=hd->atime.GetWin();
282 D->AtimeLow=(uint)ARaw;
283 D->AtimeHigh=(uint)(ARaw>>32);
284
285 D->Method=hd->Method+0x30;
286 D->FileAttr=hd->FileAttr;
287 D->CmtSize=0;
288 D->CmtState=0;
289
290 D->DictSize=uint(hd->WinSize/1024);
291
292 switch (hd->FileHash.Type)
293 {
294 case HASH_RAR14:
295 case HASH_CRC32:
297 break;
298 case HASH_BLAKE2:
300 memcpy(D->Hash,hd->FileHash.Digest,BLAKE2_DIGEST_SIZE);
301 break;
302 default:
304 break;
305 }
306
307 D->RedirType=hd->RedirType;
308 // RedirNameSize sanity check is useful in case some developer
309 // did not initialize Reserved area with 0 as required in docs.
310 // We have taken 'Redir*' fields from Reserved area. We may remove
311 // this RedirNameSize check sometimes later.
312 if (hd->RedirType!=FSREDIR_NONE && D->RedirName!=NULL &&
313 D->RedirNameSize>0 && D->RedirNameSize<100000)
315 D->DirTarget=hd->DirTarget;
316 }
317 catch (RAR_EXIT ErrCode)
318 {
319 return Data->Cmd.DllError!=0 ? Data->Cmd.DllError : RarErrorToDll(ErrCode);
320 }
321 return ERAR_SUCCESS;
322}
323
324
325int PASCAL ProcessFile(HANDLE hArcData,int Operation,char *DestPath,char *DestName,wchar *DestPathW,wchar *DestNameW)
326{
327 DataSet *Data=(DataSet *)hArcData;
328 try
329 {
330 Data->Cmd.DllError=0;
331 if (Data->OpenMode==RAR_OM_LIST || Data->OpenMode==RAR_OM_LIST_INCSPLIT ||
332 Operation==RAR_SKIP && !Data->Arc.Solid)
333 {
334 if (Data->Arc.Volume && Data->Arc.GetHeaderType()==HEAD_FILE &&
335 Data->Arc.FileHead.SplitAfter)
336 if (MergeArchive(Data->Arc,NULL,false,'L'))
337 {
338 Data->Arc.Seek(Data->Arc.CurBlockPos,SEEK_SET);
339 return ERAR_SUCCESS;
340 }
341 else
342 return ERAR_EOPEN;
343 Data->Arc.SeekToNext();
344 }
345 else
346 {
347 Data->Cmd.DllOpMode=Operation;
348
349 *Data->Cmd.ExtrPath=0;
350 *Data->Cmd.DllDestName=0;
351
352 if (DestPath!=NULL)
353 {
354 char ExtrPathA[NM];
355 strncpyz(ExtrPathA,DestPath,ASIZE(ExtrPathA)-2);
356#ifdef _WIN_ALL
357 // We must not apply OemToCharBuffA directly to DestPath,
358 // because we do not know DestPath length and OemToCharBuffA
359 // does not stop at 0.
360 OemToCharA(ExtrPathA,ExtrPathA);
361#endif
362 CharToWide(ExtrPathA,Data->Cmd.ExtrPath,ASIZE(Data->Cmd.ExtrPath));
364 }
365 if (DestName!=NULL)
366 {
367 char DestNameA[NM];
368 strncpyz(DestNameA,DestName,ASIZE(DestNameA)-2);
369#ifdef _WIN_ALL
370 // We must not apply OemToCharBuffA directly to DestName,
371 // because we do not know DestName length and OemToCharBuffA
372 // does not stop at 0.
373 OemToCharA(DestNameA,DestNameA);
374#endif
375 CharToWide(DestNameA,Data->Cmd.DllDestName,ASIZE(Data->Cmd.DllDestName));
376 }
377
378 if (DestPathW!=NULL)
379 {
380 wcsncpy(Data->Cmd.ExtrPath,DestPathW,ASIZE(Data->Cmd.ExtrPath));
382 }
383
384 if (DestNameW!=NULL)
385 wcsncpyz(Data->Cmd.DllDestName,DestNameW,ASIZE(Data->Cmd.DllDestName));
386
387 wcsncpyz(Data->Cmd.Command,Operation==RAR_EXTRACT ? L"X":L"T",ASIZE(Data->Cmd.Command));
388 Data->Cmd.Test=Operation!=RAR_EXTRACT;
389 bool Repeat=false;
390 Data->Extract.ExtractCurrentFile(Data->Arc,Data->HeaderSize,Repeat);
391
392 // Now we process extra file information if any.
393 //
394 // Archive can be closed if we process volumes, next volume is missing
395 // and current one is already removed or deleted. So we need to check
396 // if archive is still open to avoid calling file operations on
397 // the invalid file handle. Some of our file operations like Seek()
398 // process such invalid handle correctly, some not.
399 while (Data->Arc.IsOpened() && Data->Arc.ReadHeader()!=0 &&
401 {
402 Data->Extract.ExtractCurrentFile(Data->Arc,Data->HeaderSize,Repeat);
403 Data->Arc.SeekToNext();
404 }
405 Data->Arc.Seek(Data->Arc.CurBlockPos,SEEK_SET);
406 }
407 }
408 catch (std::bad_alloc&)
409 {
410 return ERAR_NO_MEMORY;
411 }
412 catch (RAR_EXIT ErrCode)
413 {
414 return Data->Cmd.DllError!=0 ? Data->Cmd.DllError : RarErrorToDll(ErrCode);
415 }
416 return Data->Cmd.DllError;
417}
418
419
420int PASCAL RARProcessFile(HANDLE hArcData,int Operation,char *DestPath,char *DestName)
421{
422 return ProcessFile(hArcData,Operation,DestPath,DestName,NULL,NULL);
423}
424
425
426int PASCAL RARProcessFileW(HANDLE hArcData,int Operation,wchar *DestPath,wchar *DestName)
427{
428 return ProcessFile(hArcData,Operation,NULL,NULL,DestPath,DestName);
429}
430
431
432void PASCAL RARSetChangeVolProc(HANDLE hArcData,CHANGEVOLPROC ChangeVolProc)
433{
434 DataSet *Data=(DataSet *)hArcData;
435 Data->Cmd.ChangeVolProc=ChangeVolProc;
436}
437
438
439void PASCAL RARSetCallback(HANDLE hArcData,UNRARCALLBACK Callback,LPARAM UserData)
440{
441 DataSet *Data=(DataSet *)hArcData;
442 Data->Cmd.Callback=Callback;
443 Data->Cmd.UserData=UserData;
444}
445
446
447void PASCAL RARSetProcessDataProc(HANDLE hArcData,PROCESSDATAPROC ProcessDataProc)
448{
449 DataSet *Data=(DataSet *)hArcData;
450 Data->Cmd.ProcessDataProc=ProcessDataProc;
451}
452
453
454void PASCAL RARSetPassword(HANDLE hArcData,char *Password)
455{
456#ifndef RAR_NOCRYPT
457 DataSet *Data=(DataSet *)hArcData;
458 wchar PasswordW[MAXPASSWORD];
459 GetWideName(Password,NULL,PasswordW,ASIZE(PasswordW));
460 Data->Cmd.Password.Set(PasswordW);
461 cleandata(PasswordW,sizeof(PasswordW));
462#endif
463}
464
465
467{
468 return RAR_DLL_VERSION;
469}
470
471
472static int RarErrorToDll(RAR_EXIT ErrCode)
473{
474 switch(ErrCode)
475 {
476 case RARX_FATAL:
477 case RARX_READ:
478 return ERAR_EREAD;
479 case RARX_CRC:
480 return ERAR_BAD_DATA;
481 case RARX_WRITE:
482 return ERAR_EWRITE;
483 case RARX_OPEN:
484 return ERAR_EOPEN;
485 case RARX_CREATE:
486 return ERAR_ECREATE;
487 case RARX_MEMORY:
488 return ERAR_NO_MEMORY;
489 case RARX_BADPWD:
490 return ERAR_BAD_PASSWORD;
491 case RARX_SUCCESS:
492 return ERAR_SUCCESS; // 0.
493 default:
494 return ERAR_UNKNOWN;
495 }
496}
ErrorHandler ErrHandler
#define BLAKE2_DIGEST_SIZE
Definition: blake2s.hpp:5
size_t ReadHeader()
Definition: arcread.cpp:3
bool Signed
Definition: archive.hpp:122
bool Encrypted
Definition: archive.hpp:126
bool BrokenHeader
Definition: archive.hpp:128
bool FirstVolume
Definition: archive.hpp:123
bool FailedHeaderDecryption
Definition: archive.hpp:129
HEADER_TYPE GetHeaderType()
Definition: archive.hpp:85
bool GetComment(Array< wchar > *CmtData)
Definition: arccmt.cpp:3
bool Protected
Definition: archive.hpp:125
bool IsArchive(bool EnableBroken)
Definition: archive.cpp:126
EndArcHeader EndArcHead
Definition: archive.hpp:105
bool Locked
Definition: archive.hpp:121
void SeekToNext()
Definition: archive.cpp:276
bool Solid
Definition: archive.hpp:118
FileHeader FileHead
Definition: archive.hpp:104
bool MainComment
Definition: archive.hpp:120
size_t SearchBlock(HEADER_TYPE HeaderType)
Definition: arcread.cpp:48
int64 CurBlockPos
Definition: archive.hpp:114
bool NewNumbering
Definition: archive.hpp:124
bool Volume
Definition: archive.hpp:119
size_t Size()
Definition: array.hpp:94
void Push(T Item)
Definition: array.hpp:177
bool ExtractCurrentFile(Archive &Arc, size_t HeaderSize, bool &Repeat)
Definition: extract.cpp:253
void ExtractArchiveInit(Archive &Arc)
Definition: extract.cpp:82
void AddArcName(const wchar *Name)
Definition: cmddata.cpp:1006
wchar Command[NM+16]
Definition: cmddata.hpp:59
StringList FileArgs
Definition: cmddata.hpp:63
RAR_EXIT GetErrorCode()
Definition: errhnd.hpp:58
void Clean()
Definition: errhnd.cpp:9
virtual void Seek(int64 Offset, int Method)
Definition: file.cpp:514
virtual bool IsOpened()
Definition: file.hpp:122
virtual bool Open(const wchar *Name, uint Mode=FMF_READ)
Definition: file.cpp:48
wchar FileName[NM]
Definition: file.hpp:88
virtual bool Close()
Definition: file.cpp:241
bool KeepBroken
Definition: options.hpp:163
wchar ExtrPath[NM]
Definition: options.hpp:112
SecPassword Password
Definition: options.hpp:121
uint VersionControl
Definition: options.hpp:193
bool Test
Definition: options.hpp:189
bool OpenShared
Definition: options.hpp:164
OVERWRITE_MODE Overwrite
Definition: options.hpp:130
uint GetDos()
Definition: timefn.cpp:201
uint64 GetWin()
Definition: timefn.cpp:151
void Set(const wchar *Psw)
void AddString(const wchar *Str)
Definition: strlist.cpp:26
int PASCAL RARGetDllVersion()
Definition: dll.cpp:466
HANDLE PASCAL RAROpenArchiveEx(struct RAROpenArchiveDataEx *r)
Definition: dll.cpp:33
int PASCAL RARProcessFile(HANDLE hArcData, int Operation, char *DestPath, char *DestName)
Definition: dll.cpp:420
int PASCAL RARCloseArchive(HANDLE hArcData)
Definition: dll.cpp:168
int PASCAL RARReadHeaderEx(HANDLE hArcData, struct RARHeaderDataEx *D)
Definition: dll.cpp:209
void PASCAL RARSetPassword(HANDLE hArcData, char *Password)
Definition: dll.cpp:454
int PASCAL RARProcessFileW(HANDLE hArcData, int Operation, wchar *DestPath, wchar *DestName)
Definition: dll.cpp:426
HANDLE PASCAL RAROpenArchive(struct RAROpenArchiveData *r)
Definition: dll.cpp:17
int PASCAL ProcessFile(HANDLE hArcData, int Operation, char *DestPath, char *DestName, wchar *DestPathW, wchar *DestNameW)
Definition: dll.cpp:325
void PASCAL RARSetProcessDataProc(HANDLE hArcData, PROCESSDATAPROC ProcessDataProc)
Definition: dll.cpp:447
int PASCAL RARReadHeader(HANDLE hArcData, struct RARHeaderData *D)
Definition: dll.cpp:184
void PASCAL RARSetChangeVolProc(HANDLE hArcData, CHANGEVOLPROC ChangeVolProc)
Definition: dll.cpp:432
void PASCAL RARSetCallback(HANDLE hArcData, UNRARCALLBACK Callback, LPARAM UserData)
Definition: dll.cpp:439
static int RarErrorToDll(RAR_EXIT ErrCode)
Definition: dll.cpp:472
#define ROADF_FIRSTVOLUME
Definition: dll.hpp:136
#define ERAR_BAD_DATA
Definition: dll.hpp:9
int(PASCAL * PROCESSDATAPROC)(unsigned char *Addr, int Size)
Definition: dll.hpp:164
#define ROADF_VOLUME
Definition: dll.hpp:128
#define ROADF_SIGNED
Definition: dll.hpp:133
#define ERAR_ECLOSE
Definition: dll.hpp:14
#define RAR_HASH_NONE
Definition: dll.hpp:36
#define ROADF_RECOVERY
Definition: dll.hpp:134
#define RAR_SKIP
Definition: dll.hpp:27
#define ROADF_COMMENT
Definition: dll.hpp:129
int(PASCAL * CHANGEVOLPROC)(char *ArcName, int Mode)
Definition: dll.hpp:163
#define ERAR_SUCCESS
Definition: dll.hpp:6
#define RAR_HASH_CRC32
Definition: dll.hpp:37
#define RHDF_SOLID
Definition: dll.hpp:53
#define ERAR_ECREATE
Definition: dll.hpp:13
#define RAR_OM_LIST_INCSPLIT
Definition: dll.hpp:25
#define RHDF_ENCRYPTED
Definition: dll.hpp:52
#define ROADF_LOCK
Definition: dll.hpp:130
#define RAR_OM_LIST
Definition: dll.hpp:23
int(CALLBACK * UNRARCALLBACK)(UINT msg, LPARAM UserData, LPARAM P1, LPARAM P2)
Definition: dll.hpp:126
#define RHDF_SPLITBEFORE
Definition: dll.hpp:50
#define ROADF_ENCHEADERS
Definition: dll.hpp:135
#define ROADOF_KEEPBROKEN
Definition: dll.hpp:138
#define ERAR_UNKNOWN
Definition: dll.hpp:18
#define ERAR_NO_MEMORY
Definition: dll.hpp:8
#define RAR_HASH_BLAKE2
Definition: dll.hpp:38
#define ERAR_END_ARCHIVE
Definition: dll.hpp:7
#define ROADF_NEWNUMBERING
Definition: dll.hpp:132
#define ERAR_BAD_PASSWORD
Definition: dll.hpp:21
#define RAR_EXTRACT
Definition: dll.hpp:29
#define ROADF_SOLID
Definition: dll.hpp:131
#define ERAR_EWRITE
Definition: dll.hpp:16
#define RAR_DLL_VERSION
Definition: dll.hpp:34
#define ERAR_EOPEN
Definition: dll.hpp:12
#define RHDF_SPLITAFTER
Definition: dll.hpp:51
#define ERAR_SMALL_BUF
Definition: dll.hpp:17
#define ERAR_BAD_ARCHIVE
Definition: dll.hpp:10
#define ERAR_EREAD
Definition: dll.hpp:15
#define RHDF_DIRECTORY
Definition: dll.hpp:54
RAR_EXIT
Definition: errhnd.hpp:5
@ RARX_MEMORY
Definition: errhnd.hpp:14
@ RARX_OPEN
Definition: errhnd.hpp:12
@ RARX_BADPWD
Definition: errhnd.hpp:17
@ RARX_READ
Definition: errhnd.hpp:18
@ RARX_CRC
Definition: errhnd.hpp:9
@ RARX_WRITE
Definition: errhnd.hpp:11
@ RARX_FATAL
Definition: errhnd.hpp:8
@ RARX_CREATE
Definition: errhnd.hpp:15
@ RARX_SUCCESS
Definition: errhnd.hpp:6
@ RARX_WARNING
Definition: errhnd.hpp:7
@ FMF_OPENSHARED
Definition: file.hpp:34
@ HASH_RAR14
Definition: hash.hpp:4
@ HASH_CRC32
Definition: hash.hpp:4
@ HASH_BLAKE2
Definition: hash.hpp:4
@ HSYS_WINDOWS
Definition: headers.hpp:103
@ FSREDIR_NONE
Definition: headers.hpp:109
@ HEAD_FILE
Definition: headers.hpp:76
@ HEAD_SERVICE
Definition: headers.hpp:76
@ HEAD_ENDARC
Definition: headers.hpp:77
@ HOST_UNIX
Definition: headers.hpp:97
@ HOST_WIN32
Definition: headers.hpp:97
@ OVERWRITE_ALL
Definition: options.hpp:42
wchar * GetWideName(const char *Name, const wchar *NameW, wchar *DestW, size_t DestSize)
Definition: pathfn.cpp:903
void AddEndSlash(wchar *Path, size_t MaxLength)
Definition: pathfn.cpp:170
#define Min(x, y)
Definition: rardefs.hpp:4
#define MAXPASSWORD
Definition: rardefs.hpp:14
#define ASIZE(x)
Definition: rardefs.hpp:10
wchar_t wchar
Definition: rartypes.hpp:13
unsigned int uint
Definition: rartypes.hpp:8
uint64_t uint64
Definition: rartypes.hpp:11
void cleandata(void *data, size_t size)
Definition: secpassword.cpp:80
void wcsncpyz(wchar *dest, const wchar *src, size_t maxlen)
Definition: strfn.cpp:275
void strncpyz(char *dest, const char *src, size_t maxlen)
Definition: strfn.cpp:263
Definition: dll.cpp:6
int OpenMode
Definition: dll.cpp:10
Archive Arc
Definition: dll.cpp:8
CmdExtract Extract
Definition: dll.cpp:9
DataSet()
Definition: dll.cpp:13
CommandData Cmd
Definition: dll.cpp:7
int HeaderSize
Definition: dll.cpp:11
bool NextVolume
Definition: headers.hpp:273
RarTime atime
Definition: headers.hpp:190
HashValue FileHash
Definition: headers.hpp:196
int64 UnpSize
Definition: headers.hpp:193
bool Solid
Definition: headers.hpp:222
wchar FileName[NM]
Definition: headers.hpp:184
size_t WinSize
Definition: headers.hpp:226
int64 PackSize
Definition: headers.hpp:192
RarTime ctime
Definition: headers.hpp:189
byte Method
Definition: headers.hpp:179
bool Encrypted
Definition: headers.hpp:205
uint UnpVer
Definition: headers.hpp:178
bool DirTarget
Definition: headers.hpp:240
bool Dir
Definition: headers.hpp:223
wchar RedirName[NM]
Definition: headers.hpp:239
RarTime mtime
Definition: headers.hpp:188
HOST_SYSTEM_TYPE HSType
Definition: headers.hpp:236
FILE_SYSTEM_REDIRECT RedirType
Definition: headers.hpp:238
bool SplitBefore
Definition: headers.hpp:200
bool SplitAfter
Definition: headers.hpp:201
uint FileAttr
Definition: headers.hpp:181
byte Digest[SHA256_DIGEST_SIZE]
Definition: hash.hpp:16
HASH_TYPE Type
Definition: hash.hpp:12
uint CRC32
Definition: hash.hpp:15
unsigned int UnpSize
Definition: dll.hpp:86
unsigned int MtimeHigh
Definition: dll.hpp:106
unsigned int CmtState
Definition: dll.hpp:97
char Hash[32]
Definition: dll.hpp:100
unsigned int CtimeLow
Definition: dll.hpp:107
unsigned int PackSizeHigh
Definition: dll.hpp:85
unsigned int HashType
Definition: dll.hpp:99
char ArcName[1024]
Definition: dll.hpp:79
wchar_t ArcNameW[1024]
Definition: dll.hpp:80
unsigned int UnpVer
Definition: dll.hpp:91
unsigned int PackSize
Definition: dll.hpp:84
unsigned int AtimeLow
Definition: dll.hpp:109
unsigned int AtimeHigh
Definition: dll.hpp:110
unsigned int CmtSize
Definition: dll.hpp:96
unsigned int FileCRC
Definition: dll.hpp:89
unsigned int CtimeHigh
Definition: dll.hpp:108
wchar_t FileNameW[1024]
Definition: dll.hpp:82
unsigned int Method
Definition: dll.hpp:92
unsigned int RedirType
Definition: dll.hpp:101
unsigned int Flags
Definition: dll.hpp:83
unsigned int DirTarget
Definition: dll.hpp:104
unsigned int UnpSizeHigh
Definition: dll.hpp:87
unsigned int FileAttr
Definition: dll.hpp:93
wchar_t * RedirName
Definition: dll.hpp:102
unsigned int MtimeLow
Definition: dll.hpp:105
unsigned int HostOS
Definition: dll.hpp:88
char FileName[1024]
Definition: dll.hpp:81
unsigned int RedirNameSize
Definition: dll.hpp:103
unsigned int FileTime
Definition: dll.hpp:90
unsigned int DictSize
Definition: dll.hpp:98
unsigned int CmtState
Definition: dll.hpp:73
unsigned int FileTime
Definition: dll.hpp:66
unsigned int PackSize
Definition: dll.hpp:62
unsigned int UnpSize
Definition: dll.hpp:63
unsigned int CmtSize
Definition: dll.hpp:72
unsigned int UnpVer
Definition: dll.hpp:67
char ArcName[260]
Definition: dll.hpp:59
unsigned int FileAttr
Definition: dll.hpp:69
unsigned int FileCRC
Definition: dll.hpp:65
unsigned int HostOS
Definition: dll.hpp:64
char FileName[260]
Definition: dll.hpp:60
unsigned int Method
Definition: dll.hpp:68
unsigned int Flags
Definition: dll.hpp:61
unsigned int CmtSize
Definition: dll.hpp:148
UNRARCALLBACK Callback
Definition: dll.hpp:151
unsigned int CmtBufSize
Definition: dll.hpp:147
unsigned int CmtState
Definition: dll.hpp:149
wchar_t * CmtBufW
Definition: dll.hpp:154
unsigned int OpenResult
Definition: dll.hpp:145
unsigned int OpFlags
Definition: dll.hpp:153
unsigned int OpenMode
Definition: dll.hpp:144
wchar_t * ArcNameW
Definition: dll.hpp:143
unsigned int Flags
Definition: dll.hpp:150
unsigned int CmtBufSize
Definition: dll.hpp:121
unsigned int CmtSize
Definition: dll.hpp:122
char * ArcName
Definition: dll.hpp:117
unsigned int OpenResult
Definition: dll.hpp:119
unsigned int CmtState
Definition: dll.hpp:123
unsigned int OpenMode
Definition: dll.hpp:118
char * CmtBuf
Definition: dll.hpp:120
bool WideToChar(const wchar *Src, char *Dest, size_t DestSize)
Definition: unicode.cpp:20
bool CharToWide(const char *Src, wchar *Dest, size_t DestSize)
Definition: unicode.cpp:85
bool MergeArchive(Archive &Arc, ComprDataIO *DataIO, bool ShowFileName, wchar Command)
Definition: volume.cpp:10