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
4ddb9f69
Commit
4ddb9f69
authored
Dec 25, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Dec 31, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cabinet: Read CAB size from the file header instead of calling FDI seek callback with SEEK_END.
SEEK_END is not supported by some callback implementations.
parent
3cb5b93d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
22 deletions
+6
-22
fdi.c
dlls/cabinet/fdi.c
+5
-18
fdi.c
dlls/cabinet/tests/fdi.c
+1
-4
No files found.
dlls/cabinet/fdi.c
View file @
4ddb9f69
...
...
@@ -536,7 +536,7 @@ static BOOL FDI_read_entries(
PMORE_ISCAB_INFO
pmii
)
{
int
num_folders
,
num_files
,
header_resv
,
folder_resv
=
0
;
LONG
base_offset
,
cabsize
;
LONG
cabsize
;
USHORT
setid
,
cabidx
,
flags
;
cab_UBYTE
buf
[
64
],
block_resv
;
char
*
prevname
=
NULL
,
*
previnfo
=
NULL
,
*
nextname
=
NULL
,
*
nextinfo
=
NULL
;
...
...
@@ -573,34 +573,21 @@ static BOOL FDI_read_entries(
* -gmt
*/
/* get basic offset & size info */
base_offset
=
FDI_getoffset
(
fdi
,
hf
);
if
(
fdi
->
seek
(
hf
,
0
,
SEEK_END
)
==
-
1
)
{
if
(
pmii
)
set_error
(
fdi
,
FDIERROR_NOT_A_CABINET
,
0
);
return
FALSE
;
}
cabsize
=
FDI_getoffset
(
fdi
,
hf
);
if
((
cabsize
==
-
1
)
||
(
base_offset
==
-
1
)
||
(
fdi
->
seek
(
hf
,
base_offset
,
SEEK_SET
)
==
-
1
))
{
if
(
pmii
)
set_error
(
fdi
,
FDIERROR_NOT_A_CABINET
,
0
);
return
FALSE
;
}
/* read in the CFHEADER */
if
(
fdi
->
read
(
hf
,
buf
,
cfhead_SIZEOF
)
!=
cfhead_SIZEOF
)
{
if
(
pmii
)
set_error
(
fdi
,
FDIERROR_NOT_A_CABINET
,
0
);
return
FALSE
;
}
/* check basic MSCF signature */
if
(
EndGetI32
(
buf
+
cfhead_Signature
)
!=
0x4643534d
)
{
if
(
pmii
)
set_error
(
fdi
,
FDIERROR_NOT_A_CABINET
,
0
);
return
FALSE
;
}
/* get the cabinet size */
cabsize
=
EndGetI32
(
buf
+
cfhead_CabinetSize
);
/* get the number of folders */
num_folders
=
EndGetI16
(
buf
+
cfhead_NumFolders
);
...
...
dlls/cabinet/tests/fdi.c
View file @
4ddb9f69
...
...
@@ -762,7 +762,6 @@ static LONG CDECL fdi_mem_seek(INT_PTR hf, LONG dist, int seektype)
case
SEEK_END
:
default:
todo_wine
ok
(
0
,
"seek: not expected type %d
\n
"
,
seektype
);
return
-
1
;
}
...
...
@@ -879,18 +878,16 @@ static void test_FDICopy(void)
memset
(
&
info
,
0
,
sizeof
(
info
));
ret
=
FDIIsCabinet
(
hfdi
,
fd
,
&
info
);
todo_wine
{
ok
(
ret
,
"FDIIsCabinet error %d
\n
"
,
erf
.
erfOper
);
ok
(
info
.
cbCabinet
==
0x59
,
"expected 0x59, got %#x
\n
"
,
info
.
cbCabinet
);
ok
(
info
.
cFiles
==
1
,
"expected 1, got %d
\n
"
,
info
.
cFiles
);
ok
(
info
.
cFolders
==
1
,
"expected 1, got %d
\n
"
,
info
.
cFolders
);
ok
(
info
.
setID
==
0x1225
,
"expected 0x1225, got %#x
\n
"
,
info
.
setID
);
ok
(
info
.
iCabinet
==
0x2013
,
"expected 0x2013, got %#x
\n
"
,
info
.
iCabinet
);
}
fdi_mem_close
(
fd
);
ret
=
FDICopy
(
hfdi
,
block
,
memory
,
0
,
fdi_mem_notify
,
NULL
,
0
);
todo_wine
ok
(
ret
,
"FDICopy error %d
\n
"
,
erf
.
erfOper
);
FDIDestroy
(
hfdi
);
...
...
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