Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
832e3069
Commit
832e3069
authored
Aug 22, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Aug 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cabinet: Formalize the SESSION struct.
parent
d13541f8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
48 deletions
+49
-48
cabinet.h
dlls/cabinet/cabinet.h
+16
-18
cabinet_main.c
dlls/cabinet/cabinet_main.c
+33
-30
No files found.
dlls/cabinet/cabinet.h
View file @
832e3069
...
...
@@ -631,29 +631,27 @@ static const cab_UWORD Zipmask[17] = {
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff \
}
/*
EXTRACTdest flags
*/
/*
SESSION Operation
*/
#define EXTRACT_FILLFILELIST 0x00000001
#define EXTRACT_EXTRACTFILES 0x00000002
struct
ExtractFileList
{
LPSTR
filen
ame
;
struct
ExtractFileList
*
next
;
BOOL
flag
;
}
;
struct
FILELIST
{
LPSTR
FileN
ame
;
struct
FILELIST
*
next
;
BOOL
Extracted
;
};
/* the first parameter of the function extract */
typedef
struct
{
long
result1
;
/* 0x000 */
long
unknown1
[
3
];
/* 0x004 */
struct
ExtractFileList
*
filelist
;
/* 0x010 */
long
filecount
;
/* 0x014 */
DWORD
flags
;
/* 0x018 */
char
directory
[
MAX_PATH
];
/* 0x01c */
char
lastfile
[
MAX_PATH
];
/* 0x120 */
char
unknown2
[
MAX_PATH
];
/* 0x224 */
struct
ExtractFileList
*
filterlist
;
/* 0x328 */
}
EXTRACTdest
;
INT
FileSize
;
ERF
Error
;
struct
FILELIST
*
FileList
;
INT
FileCount
;
INT
Operation
;
CHAR
Destination
[
MAX_PATH
];
CHAR
CurrentFile
[
MAX_PATH
];
CHAR
Reserved
[
MAX_PATH
];
struct
FILELIST
*
FilterList
;
}
SESSION
;
/* from fdi.c */
void
QTMupdatemodel
(
struct
QTMmodel
*
model
,
int
sym
);
...
...
dlls/cabinet/cabinet_main.c
View file @
832e3069
...
...
@@ -154,20 +154,20 @@ static long fdi_seek(INT_PTR hf, long dist, int seektype)
return
SetFilePointer
(
handle
,
dist
,
NULL
,
seektype
);
}
static
void
fill_file_node
(
struct
ExtractFileList
*
pNode
,
LPCSTR
szFilename
)
static
void
fill_file_node
(
struct
FILELIST
*
pNode
,
LPCSTR
szFilename
)
{
pNode
->
next
=
NULL
;
pNode
->
flag
=
FALSE
;
pNode
->
Extracted
=
FALSE
;
pNode
->
filen
ame
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
szFilename
)
+
1
);
lstrcpyA
(
pNode
->
filen
ame
,
szFilename
);
pNode
->
FileN
ame
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
szFilename
)
+
1
);
lstrcpyA
(
pNode
->
FileN
ame
,
szFilename
);
}
static
BOOL
file_in_list
(
const
struct
ExtractFileList
*
pNode
,
LPCSTR
szFilename
)
static
BOOL
file_in_list
(
const
struct
FILELIST
*
pNode
,
LPCSTR
szFilename
)
{
while
(
pNode
)
{
if
(
!
lstrcmpiA
(
pNode
->
filen
ame
,
szFilename
))
if
(
!
lstrcmpiA
(
pNode
->
FileN
ame
,
szFilename
))
return
TRUE
;
pNode
=
pNode
->
next
;
...
...
@@ -182,17 +182,17 @@ static INT_PTR fdi_notify_extract(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pf
{
case
fdintCOPY_FILE
:
{
struct
ExtractFileList
**
fileList
;
EXTRACTdest
*
pDestination
=
pfdin
->
pv
;
struct
FILELIST
**
fileList
;
SESSION
*
pDestination
=
pfdin
->
pv
;
LPSTR
szFullPath
,
szDirectory
;
HANDLE
hFile
=
0
;
DWORD
dwSize
;
dwSize
=
lstrlenA
(
pDestination
->
directory
)
+
dwSize
=
lstrlenA
(
pDestination
->
Destination
)
+
lstrlenA
(
"
\\
"
)
+
lstrlenA
(
pfdin
->
psz1
)
+
1
;
szFullPath
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwSize
);
lstrcpyA
(
szFullPath
,
pDestination
->
directory
);
lstrcpyA
(
szFullPath
,
pDestination
->
Destination
);
lstrcatA
(
szFullPath
,
"
\\
"
);
lstrcatA
(
szFullPath
,
pfdin
->
psz1
);
...
...
@@ -201,26 +201,26 @@ static INT_PTR fdi_notify_extract(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pf
szDirectory
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwSize
);
lstrcpynA
(
szDirectory
,
szFullPath
,
dwSize
);
if
(
pDestination
->
flags
&
EXTRACT_FILLFILELIST
)
if
(
pDestination
->
Operation
&
EXTRACT_FILLFILELIST
)
{
fileList
=
&
pDestination
->
filel
ist
;
fileList
=
&
pDestination
->
FileL
ist
;
while
(
*
fileList
)
fileList
=
&
((
*
fileList
)
->
next
);
*
fileList
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
ExtractFileList
));
sizeof
(
struct
FILELIST
));
fill_file_node
(
*
fileList
,
pfdin
->
psz1
);
lstrcpyA
(
pDestination
->
lastf
ile
,
szFullPath
);
pDestination
->
filec
ount
++
;
lstrcpyA
(
pDestination
->
CurrentF
ile
,
szFullPath
);
pDestination
->
FileC
ount
++
;
}
if
((
pDestination
->
flags
&
EXTRACT_EXTRACTFILES
)
||
file_in_list
(
pDestination
->
filterl
ist
,
pfdin
->
psz1
))
if
((
pDestination
->
Operation
&
EXTRACT_EXTRACTFILES
)
||
file_in_list
(
pDestination
->
FilterL
ist
,
pfdin
->
psz1
))
{
/* skip this file if it is not in the file list */
if
(
!
file_in_list
(
pDestination
->
filel
ist
,
pfdin
->
psz1
))
if
(
!
file_in_list
(
pDestination
->
FileL
ist
,
pfdin
->
psz1
))
return
0
;
/* create the destination directory if it doesn't exist */
...
...
@@ -281,25 +281,28 @@ static INT_PTR fdi_notify_extract(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pf
* NOTES
* The following members of the dest struct control the operation
* of Extract:
* filelist [I] A linked list of filenames. Extract only extracts
* FileSize [O] The size of all files extracted up to CurrentFile.
* Error [O] The error in case the extract operation fails.
* FileList [I] A linked list of filenames. Extract only extracts
* files from the cabinet that are in this list.
*
filecount [O] Contains the number of files in filel
ist on
*
FileCount [O] Contains the number of files in FileL
ist on
* completion.
* flags [I] See Operation.
* directory [I] The destination directory.
* lastfile [O] The last file extracted.
* Operation [I] See Operation.
* Destination [I] The destination directory.
* CurrentFile [O] The last file extracted.
* FilterList [I] A linked list of files that should not be extracted.
*
* Operation
* If
flags contains EXTRACT_FILLFILELIST, then filel
ist will be
* filled with all the files in the cabinet. If
flags
contains
* EXTRACT_EXTRACTFILES, then only the files in the
filel
ist will
* If
Operation contains EXTRACT_FILLFILELIST, then FileL
ist will be
* filled with all the files in the cabinet. If
Operation
contains
* EXTRACT_EXTRACTFILES, then only the files in the
FileL
ist will
* be extracted from the cabinet. EXTRACT_FILLFILELIST can be called
* by itself, but EXTRACT_EXTRACTFILES must have a valid
filel
ist
* in order to succeed. If
flags
contains both EXTRACT_FILLFILELIST
* by itself, but EXTRACT_EXTRACTFILES must have a valid
FileL
ist
* in order to succeed. If
Operation
contains both EXTRACT_FILLFILELIST
* and EXTRACT_EXTRACTFILES, then all the files in the cabinet
* will be extracted.
*/
HRESULT
WINAPI
Extract
(
EXTRACTdest
*
dest
,
LPCSTR
szCabName
)
HRESULT
WINAPI
Extract
(
SESSION
*
dest
,
LPCSTR
szCabName
)
{
HRESULT
res
=
S_OK
;
HFDI
hfdi
;
...
...
@@ -321,7 +324,7 @@ HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR szCabName)
if
(
!
hfdi
)
return
E_FAIL
;
if
(
GetFileAttributesA
(
dest
->
directory
)
==
INVALID_FILE_ATTRIBUTES
)
if
(
GetFileAttributesA
(
dest
->
Destination
)
==
INVALID_FILE_ATTRIBUTES
)
return
S_OK
;
/* split the cabinet name into path + name */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment