Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a0d658ae
Commit
a0d658ae
authored
Dec 30, 2003
by
Stefan Leichter
Committed by
Alexandre Julliard
Dec 30, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make use of/handle the first parameter of the function Extract.
parent
1a620f29
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
38 deletions
+64
-38
cabextract.c
dlls/cabinet/cabextract.c
+10
-2
cabinet.h
dlls/cabinet/cabinet.h
+13
-1
cabinet_main.c
dlls/cabinet/cabinet_main.c
+41
-35
No files found.
dlls/cabinet/cabextract.c
View file @
a0d658ae
...
...
@@ -29,6 +29,7 @@
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "windef.h"
...
...
@@ -2553,12 +2554,13 @@ void print_fileinfo(struct cab_file *fi) {
* dir [I] directory to extract to
* fix [I] attempt to process broken cabinets
* lower [I] ? (lower case something or other?)
* dest [O]
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
BOOL
process_cabinet
(
LPCSTR
cabname
,
LPCSTR
dir
,
BOOL
fix
,
BOOL
lower
)
BOOL
process_cabinet
(
LPCSTR
cabname
,
LPCSTR
dir
,
BOOL
fix
,
BOOL
lower
,
EXTRACTdest
*
dest
)
{
struct
cabinet
*
basecab
,
*
cab
,
*
cab1
,
*
cab2
;
struct
cab_file
*
filelist
,
*
fi
;
...
...
@@ -2618,12 +2620,18 @@ BOOL process_cabinet(LPCSTR cabname, LPCSTR dir, BOOL fix, BOOL lower)
TRACE
(
"----------+---------------------+-------------
\n
"
);
viewhdr
=
1
;
}
for
(
fi
=
filelist
;
fi
;
fi
=
fi
->
next
)
for
(
fi
=
filelist
;
fi
;
fi
=
fi
->
next
)
{
print_fileinfo
(
fi
);
dest
->
filecount
++
;
}
TRACE
(
"Beginning Extraction...
\n
"
);
for
(
fi
=
filelist
;
fi
;
fi
=
fi
->
next
)
{
TRACE
(
" extracting: %s
\n
"
,
debugstr_a
(
fi
->
filename
));
extract_file
(
fi
,
lower
,
fix
,
dir
,
decomp_state
);
sprintf
(
dest
->
lastfile
,
"%s%s%s"
,
strlen
(
dest
->
directory
)
?
dest
->
directory
:
""
,
strlen
(
dest
->
directory
)
?
"
\\
"
:
""
,
fi
->
filename
);
}
}
...
...
dlls/cabinet/cabinet.h
View file @
a0d658ae
...
...
@@ -553,8 +553,20 @@ static const cab_UWORD Zipmask[17] = {
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff \
}
/* the first parameter of the function extract */
typedef
struct
{
long
result1
;
/* 0x000 */
long
unknown1
[
3
];
/* 0x004 */
long
result2
;
/* 0x010 */
long
filecount
;
/* 0x014 */
long
unknown2
;
/* 0x018 */
char
directory
[
0x104
];
/* 0x01c */
char
lastfile
[
0x20c
];
/* 0x120 */
}
EXTRACTdest
;
/* from cabextract.c */
BOOL
process_cabinet
(
LPCSTR
cabname
,
LPCSTR
dir
,
BOOL
fix
,
BOOL
lower
);
BOOL
process_cabinet
(
LPCSTR
cabname
,
LPCSTR
dir
,
BOOL
fix
,
BOOL
lower
,
EXTRACTdest
*
dest
);
void
QTMupdatemodel
(
struct
QTMmodel
*
model
,
int
sym
);
int
make_decode_table
(
cab_ULONG
nsyms
,
cab_ULONG
nbits
,
cab_UBYTE
*
length
,
cab_UWORD
*
table
);
cab_ULONG
checksum
(
cab_UBYTE
*
data
,
cab_UWORD
bytes
,
cab_ULONG
csum
);
...
...
dlls/cabinet/cabinet_main.c
View file @
a0d658ae
...
...
@@ -73,60 +73,66 @@ HRESULT WINAPI CABINET_DllGetVersion (DLLVERSIONINFO *pdvi)
* to somewhere...
*
* PARAMS
* unknown [IO] unknown pointer
* dest pointer to a buffer of 0x32c bytes containing
* [I] - number with value 1 at index 0x18
* - the dest path starting at index 0x1c
* [O] - the number of files inside the CAB file at index 0x14
* - the name of the last file with dest path at idx 0x12
* what [I] char* describing what to uncompress, I guess.
*
* RETURNS
* Success: S_OK
* Failure: E_OUTOFMEMORY (?)
*/
HRESULT
WINAPI
Extract
(
DWORD
unknown
,
LPCSTR
what
)
HRESULT
WINAPI
Extract
(
EXTRACTdest
*
dest
,
LPCSTR
what
)
{
LPCSTR
whatx
;
LPSTR
dir
,
dirx
,
lastoption
,
x
;
BOOL
updatelastoption
;
#define DUMPC(idx) idx >= sizeof(EXTRACTdest) ? ' ' : \
ptr[idx] >= 0x20 ? ptr[idx] : '.'
TRACE
(
"(unknown == %0lx, what == %s)
\n
"
,
unknown
,
debugstr_a
(
what
));
#define DUMPH(idx) idx >= sizeof(EXTRACTdest) ? 0x55 : ptr[idx]
dir
=
LocalAlloc
(
LPTR
,
strlen
(
what
));
if
(
!
dir
)
return
E_OUTOFMEMORY
;
LPSTR
dir
;
unsigned
char
*
ptr
=
(
unsigned
char
*
)
dest
;
int
i
;
/* copy the filename up to the last pathsep to construct the dirname */
whatx
=
what
;
dirx
=
dir
;
lastoption
=
NULL
;
while
(
*
whatx
)
{
if
((
*
whatx
==
'\\'
)
||
(
*
whatx
==
'/'
))
{
/* unless all chars between *dirx and lastoption are pathsep's, we
remember our location in dir as lastoption */
if
(
lastoption
)
{
updatelastoption
=
FALSE
;
for
(
x
=
lastoption
;
x
<
dirx
;
x
++
)
if
((
*
dirx
!=
'\\'
)
&&
(
*
dirx
!=
'/'
))
{
updatelastoption
=
TRUE
;
break
;
}
if
(
updatelastoption
)
lastoption
=
dirx
;
}
else
lastoption
=
dirx
;
}
*
dirx
++
=
*
whatx
++
;
}
TRACE
(
"(dest == %0lx, what == %s)
\n
"
,
(
long
)
dest
,
debugstr_a
(
what
));
if
(
!
lastoption
)
{
/* FIXME: I guess use the cwd or something? */
assert
(
FALSE
);
}
else
{
*
lastoption
=
'\0'
;
if
(
!
dest
)
{
/* win2k will crash here */
FIXME
(
"called without valid parameter dest!
\n
"
);
return
E_OUTOFMEMORY
;
}
for
(
i
=
0
;
i
<
sizeof
(
EXTRACTdest
);
i
+=
8
)
TRACE
(
"dest[%04x]:%02x %02x %02x %02x %02x %02x %02x %02x %c%c%c%c%c%c%c%c
\n
"
,
i
,
DUMPH
(
i
+
0
),
DUMPH
(
i
+
1
),
DUMPH
(
i
+
2
),
DUMPH
(
i
+
3
),
DUMPH
(
i
+
4
),
DUMPH
(
i
+
5
),
DUMPH
(
i
+
6
),
DUMPH
(
i
+
7
),
DUMPC
(
i
+
0
),
DUMPC
(
i
+
1
),
DUMPC
(
i
+
2
),
DUMPC
(
i
+
3
),
DUMPC
(
i
+
4
),
DUMPC
(
i
+
5
),
DUMPC
(
i
+
6
),
DUMPC
(
i
+
7
));
dir
=
LocalAlloc
(
LPTR
,
strlen
(
dest
->
directory
)
+
1
);
if
(
!
dir
)
return
E_OUTOFMEMORY
;
lstrcpyA
(
dir
,
dest
->
directory
);
dest
->
filecount
=
0
;
TRACE
(
"extracting to dir: %s
\n
"
,
debugstr_a
(
dir
));
/* FIXME: what to do on failure? */
if
(
!
process_cabinet
(
what
,
dir
,
FALSE
,
FALSE
))
if
(
!
process_cabinet
(
what
,
dir
,
FALSE
,
FALSE
,
dest
))
return
E_OUTOFMEMORY
;
/* the magic 13 is returned by all cab files tested so far:
* DXDDEX.CAB, DXMINI.CAB, SWFLASH.CAB on win2k
* but it crashes the ie5.5 installer :-( . The native dll does not return
* the four zeros. The value depends on the combination of the cab file and
* the destination path
*/
dest
->
result2
=
0x130000
;
LocalFree
(
dir
);
TRACE
(
"filecount %08lx,lastfile %s
\n
"
,
dest
->
filecount
,
debugstr_a
(
dest
->
lastfile
));
return
S_OK
;
}
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