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
5b62c846
Commit
5b62c846
authored
Aug 22, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Aug 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advpack: Formalize the SESSION struct.
parent
832e3069
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
40 deletions
+42
-40
files.c
dlls/advpack/files.c
+42
-40
No files found.
dlls/advpack/files.c
View file @
5b62c846
...
...
@@ -29,6 +29,7 @@
#include "winternl.h"
#include "setupapi.h"
#include "advpub.h"
#include "fdi.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "advpack_private.h"
...
...
@@ -515,28 +516,29 @@ HRESULT WINAPI DelNodeRunDLL32W(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, INT
/* The following defintions were copied from dlls/cabinet/cabinet.h */
/*
EXTRACTdest flags
*/
/*
SESSION Operation
*/
#define EXTRACT_FILLFILELIST 0x00000001
#define EXTRACT_EXTRACTFILES 0x00000002
struct
ExtractFileList
{
LPSTR
filen
ame
;
struct
ExtractFileList
*
next
;
BOOL
unknown
;
/* always 1L */
}
;
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
[
0x104
];
/* 0x01c */
char
lastfile
[
0x20c
];
/* 0x120 */
}
EXTRACTdest
;
static
HRESULT
(
WINAPI
*
pExtract
)(
EXTRACTdest
*
,
LPCSTR
);
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
;
static
HRESULT
(
WINAPI
*
pExtract
)(
SESSION
*
,
LPCSTR
);
/* removes legal characters before and after file list, and
* converts the file list to a NULL-separated list
...
...
@@ -591,9 +593,9 @@ static LPSTR convert_file_list(LPCSTR FileList, DWORD *dwNumFiles)
return
szConvertedList
;
}
static
void
free_file_node
(
struct
ExtractFileList
*
pNode
)
static
void
free_file_node
(
struct
FILELIST
*
pNode
)
{
HeapFree
(
GetProcessHeap
(),
0
,
pNode
->
filen
ame
);
HeapFree
(
GetProcessHeap
(),
0
,
pNode
->
FileN
ame
);
HeapFree
(
GetProcessHeap
(),
0
,
pNode
);
}
...
...
@@ -622,23 +624,23 @@ static BOOL file_in_list(LPCSTR szFile, LPCSTR szFileList)
/* removes nodes from the linked list that aren't specified in szFileList
* returns the number of files that are in both the linked list and szFileList
*/
static
DWORD
fill_file_list
(
EXTRACTdest
*
extractDest
,
LPCSTR
szCabName
,
LPCSTR
szFileList
)
static
DWORD
fill_file_list
(
SESSION
*
session
,
LPCSTR
szCabName
,
LPCSTR
szFileList
)
{
DWORD
dwNumFound
=
0
;
struct
ExtractFileList
*
pNode
;
struct
ExtractFileList
*
prev
=
NULL
;
struct
FILELIST
*
pNode
;
struct
FILELIST
*
prev
=
NULL
;
extractDest
->
flags
|=
EXTRACT_FILLFILELIST
;
if
(
pExtract
(
extractDest
,
szCabName
))
session
->
Operation
|=
EXTRACT_FILLFILELIST
;
if
(
pExtract
(
session
,
szCabName
))
{
extractDest
->
flags
&=
~
EXTRACT_FILLFILELIST
;
session
->
Operation
&=
~
EXTRACT_FILLFILELIST
;
return
-
1
;
}
pNode
=
extractDest
->
filel
ist
;
pNode
=
session
->
FileL
ist
;
while
(
pNode
)
{
if
(
file_in_list
(
pNode
->
filen
ame
,
szFileList
))
if
(
file_in_list
(
pNode
->
FileN
ame
,
szFileList
))
{
prev
=
pNode
;
pNode
=
pNode
->
next
;
...
...
@@ -652,13 +654,13 @@ static DWORD fill_file_list(EXTRACTdest *extractDest, LPCSTR szCabName, LPCSTR s
}
else
{
extractDest
->
filel
ist
=
pNode
->
next
;
session
->
FileL
ist
=
pNode
->
next
;
free_file_node
(
pNode
);
pNode
=
extractDest
->
filel
ist
;
pNode
=
session
->
FileL
ist
;
}
}
extractDest
->
flags
&=
~
EXTRACT_FILLFILELIST
;
session
->
Operation
&=
~
EXTRACT_FILLFILELIST
;
return
dwNumFound
;
}
...
...
@@ -690,7 +692,7 @@ static DWORD fill_file_list(EXTRACTdest *extractDest, LPCSTR szCabName, LPCSTR s
HRESULT
WINAPI
ExtractFilesA
(
LPCSTR
CabName
,
LPCSTR
ExpandDir
,
DWORD
Flags
,
LPCSTR
FileList
,
LPVOID
LReserved
,
DWORD
Reserved
)
{
EXTRACTdest
extractDest
;
SESSION
session
;
HMODULE
hCabinet
;
HRESULT
res
=
S_OK
;
DWORD
dwFileCount
=
0
;
...
...
@@ -717,8 +719,8 @@ HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags,
goto
done
;
}
ZeroMemory
(
&
extractDest
,
sizeof
(
EXTRACTdest
));
lstrcpyA
(
extractDest
.
directory
,
ExpandDir
);
ZeroMemory
(
&
session
,
sizeof
(
SESSION
));
lstrcpyA
(
session
.
Destination
,
ExpandDir
);
if
(
FileList
)
{
...
...
@@ -729,7 +731,7 @@ HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags,
goto
done
;
}
dwFilesFound
=
fill_file_list
(
&
extractDest
,
CabName
,
szConvertedList
);
dwFilesFound
=
fill_file_list
(
&
session
,
CabName
,
szConvertedList
);
if
(
dwFilesFound
!=
dwFileCount
)
{
res
=
E_FAIL
;
...
...
@@ -737,15 +739,15 @@ HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags,
}
}
else
extractDest
.
flags
|=
EXTRACT_FILLFILELIST
;
session
.
Operation
|=
EXTRACT_FILLFILELIST
;
extractDest
.
flags
|=
EXTRACT_EXTRACTFILES
;
res
=
pExtract
(
&
extractDest
,
CabName
);
session
.
Operation
|=
EXTRACT_EXTRACTFILES
;
res
=
pExtract
(
&
session
,
CabName
);
if
(
extractDest
.
filel
ist
)
if
(
session
.
FileL
ist
)
{
struct
ExtractFileList
*
curr
=
extractDest
.
filel
ist
;
struct
ExtractFileList
*
next
;
struct
FILELIST
*
curr
=
session
.
FileL
ist
;
struct
FILELIST
*
next
;
while
(
curr
)
{
...
...
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