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
1f7d144f
Commit
1f7d144f
authored
Feb 04, 2017
by
Lauri Kenttä
Committed by
Alexandre Julliard
Feb 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cabinet: Make Extract fail on read-only files.
Signed-off-by:
Lauri Kenttä
<
lauri.kentta@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
af86bdc3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
41 deletions
+27
-41
cabinet_main.c
dlls/cabinet/cabinet_main.c
+1
-3
extract.c
dlls/cabinet/tests/extract.c
+26
-38
No files found.
dlls/cabinet/cabinet_main.c
View file @
1f7d144f
...
...
@@ -253,9 +253,7 @@ static INT_PTR CDECL fdi_notify_extract(FDINOTIFICATIONTYPE fdint, PFDINOTIFICAT
hFile
=
CreateFileA
(
szFullPath
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hFile
==
INVALID_HANDLE_VALUE
)
hFile
=
0
;
else
if
(
node
)
if
(
hFile
!=
INVALID_HANDLE_VALUE
&&
node
)
node
->
DoExtract
=
FALSE
;
}
...
...
dlls/cabinet/tests/extract.c
View file @
1f7d144f
...
...
@@ -642,18 +642,15 @@ static void test_Extract(void)
session
.
Operation
=
EXTRACT_FILLFILELIST
|
EXTRACT_EXTRACTFILES
;
res
=
pExtract
(
&
session
,
"extract.cab"
);
node
=
session
.
FileList
;
todo_wine
{
ok
(
res
==
HRESULT_FROM_WIN32
(
ERROR_ACCESS_DENIED
)
||
res
==
E_FAIL
,
"Expected HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED) or E_FAIL, got %08x
\n
"
,
res
);
ok
(
session
.
FileSize
==
6
,
"Expected 6, got %d
\n
"
,
session
.
FileSize
);
ok
(
session
.
Error
.
erfOper
==
FDIERROR_USER_ABORT
,
"Expected FDIERROR_USER_ABORT, got %d
\n
"
,
session
.
Error
.
erfOper
);
ok
(
session
.
Error
.
fError
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
session
.
Error
.
fError
);
ok
(
session
.
FileCount
==
1
,
"Expected 1, got %d
\n
"
,
session
.
FileCount
);
ok
(
!
lstrcmpA
(
session
.
CurrentFile
,
"dest
\\
a.txt"
),
"Expected dest
\\
a.txt, got %s
\n
"
,
session
.
CurrentFile
);
}
ok
(
res
==
HRESULT_FROM_WIN32
(
ERROR_ACCESS_DENIED
)
||
res
==
E_FAIL
,
"Expected HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED) or E_FAIL, got %08x
\n
"
,
res
);
ok
(
session
.
FileSize
==
6
,
"Expected 6, got %d
\n
"
,
session
.
FileSize
);
ok
(
session
.
Error
.
erfOper
==
FDIERROR_USER_ABORT
,
"Expected FDIERROR_USER_ABORT, got %d
\n
"
,
session
.
Error
.
erfOper
);
ok
(
session
.
Error
.
fError
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
session
.
Error
.
fError
);
ok
(
session
.
FileCount
==
1
,
"Expected 1, got %d
\n
"
,
session
.
FileCount
);
ok
(
!
lstrcmpA
(
session
.
CurrentFile
,
"dest
\\
a.txt"
),
"Expected dest
\\
a.txt, got %s
\n
"
,
session
.
CurrentFile
);
ok
(
session
.
Error
.
erfType
==
0
,
"Expected 0, got %d
\n
"
,
session
.
Error
.
erfType
);
ok
(
session
.
Operation
==
(
EXTRACT_FILLFILELIST
|
EXTRACT_EXTRACTFILES
),
"Expected EXTRACT_FILLFILELIST | EXTRACT_EXTRACTFILES, got %d
\n
"
,
session
.
Operation
);
...
...
@@ -662,15 +659,12 @@ static void test_Extract(void)
ok
(
!
session
.
FilterList
,
"Expected empty filter list
\n
"
);
ok
(
getFileSize
(
"dest
\\
a.txt"
)
==
11
,
"Expected dest
\\
a.txt to be 11 bytes
\n
"
);
ok
(
!
DeleteFileA
(
"dest
\\
a.txt"
),
"Expected dest
\\
a.txt to be read-only
\n
"
);
todo_wine
{
ok
(
!
DeleteFileA
(
"dest
\\
b.txt"
),
"Expected dest
\\
b.txt to not exist
\n
"
);
ok
(
!
DeleteFileA
(
"dest
\\
testdir
\\
c.txt"
),
"Expected dest
\\
testdir
\\
c.txt to not exist
\n
"
);
ok
(
!
DeleteFileA
(
"dest
\\
testdir
\\
d.txt"
),
"Expected dest
\\
testdir
\\
d.txt to not exist
\n
"
);
ok
(
!
check_list
(
&
node
,
"testdir
\\
d.txt"
,
FALSE
),
"list entry should not exist
\n
"
);
ok
(
!
check_list
(
&
node
,
"testdir
\\
c.txt"
,
FALSE
),
"list entry should not exist
\n
"
);
ok
(
!
check_list
(
&
node
,
"b.txt"
,
FALSE
),
"list entry should not exist
\n
"
);
}
ok
(
!
DeleteFileA
(
"dest
\\
b.txt"
),
"Expected dest
\\
b.txt to not exist
\n
"
);
ok
(
!
DeleteFileA
(
"dest
\\
testdir
\\
c.txt"
),
"Expected dest
\\
testdir
\\
c.txt to not exist
\n
"
);
ok
(
!
DeleteFileA
(
"dest
\\
testdir
\\
d.txt"
),
"Expected dest
\\
testdir
\\
d.txt to not exist
\n
"
);
ok
(
!
check_list
(
&
node
,
"testdir
\\
d.txt"
,
FALSE
),
"list entry should not exist
\n
"
);
ok
(
!
check_list
(
&
node
,
"testdir
\\
c.txt"
,
FALSE
),
"list entry should not exist
\n
"
);
ok
(
!
check_list
(
&
node
,
"b.txt"
,
FALSE
),
"list entry should not exist
\n
"
);
ok
(
!
check_list
(
&
node
,
"a.txt"
,
FALSE
),
"list entry should not exist
\n
"
);
free_file_list
(
&
session
);
...
...
@@ -686,18 +680,15 @@ static void test_Extract(void)
session
.
Operation
=
EXTRACT_FILLFILELIST
|
EXTRACT_EXTRACTFILES
;
res
=
pExtract
(
&
session
,
"extract.cab"
);
node
=
session
.
FileList
;
todo_wine
{
ok
(
res
==
HRESULT_FROM_WIN32
(
ERROR_ACCESS_DENIED
)
||
res
==
E_FAIL
,
"Expected HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED) or E_FAIL, got %08x
\n
"
,
res
);
ok
(
session
.
FileSize
==
26
,
"Expected 26, got %d
\n
"
,
session
.
FileSize
);
ok
(
session
.
Error
.
erfOper
==
FDIERROR_USER_ABORT
,
"Expected FDIERROR_USER_ABORT, got %d
\n
"
,
session
.
Error
.
erfOper
);
ok
(
session
.
Error
.
fError
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
session
.
Error
.
fError
);
ok
(
session
.
FileCount
==
3
,
"Expected 3, got %d
\n
"
,
session
.
FileCount
);
ok
(
!
lstrcmpA
(
session
.
CurrentFile
,
"dest
\\
testdir
\\
c.txt"
),
"Expected dest
\\
c.txt, got %s
\n
"
,
session
.
CurrentFile
);
}
ok
(
res
==
HRESULT_FROM_WIN32
(
ERROR_ACCESS_DENIED
)
||
res
==
E_FAIL
,
"Expected HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED) or E_FAIL, got %08x
\n
"
,
res
);
ok
(
session
.
FileSize
==
26
,
"Expected 26, got %d
\n
"
,
session
.
FileSize
);
ok
(
session
.
Error
.
erfOper
==
FDIERROR_USER_ABORT
,
"Expected FDIERROR_USER_ABORT, got %d
\n
"
,
session
.
Error
.
erfOper
);
ok
(
session
.
Error
.
fError
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
session
.
Error
.
fError
);
ok
(
session
.
FileCount
==
3
,
"Expected 3, got %d
\n
"
,
session
.
FileCount
);
ok
(
!
lstrcmpA
(
session
.
CurrentFile
,
"dest
\\
testdir
\\
c.txt"
),
"Expected dest
\\
c.txt, got %s
\n
"
,
session
.
CurrentFile
);
ok
(
session
.
Error
.
erfType
==
0
,
"Expected 0, got %d
\n
"
,
session
.
Error
.
erfType
);
ok
(
session
.
Operation
==
(
EXTRACT_FILLFILELIST
|
EXTRACT_EXTRACTFILES
),
"Expected EXTRACT_FILLFILELIST | EXTRACT_EXTRACTFILES, got %d
\n
"
,
session
.
Operation
);
...
...
@@ -708,11 +699,8 @@ static void test_Extract(void)
ok
(
DeleteFileA
(
"dest
\\
a.txt"
),
"Expected dest
\\
a.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"dest
\\
b.txt"
),
"Expected dest
\\
b.txt to exist
\n
"
);
ok
(
!
DeleteFileA
(
"dest
\\
testdir
\\
c.txt"
),
"Expected dest
\\
testdir
\\
c.txt to be read-only
\n
"
);
todo_wine
{
ok
(
!
DeleteFileA
(
"dest
\\
testdir
\\
d.txt"
),
"Expected dest
\\
testdir
\\
d.txt to not exist
\n
"
);
ok
(
!
check_list
(
&
node
,
"testdir
\\
d.txt"
,
FALSE
),
"list entry should not exist
\n
"
);
}
ok
(
!
DeleteFileA
(
"dest
\\
testdir
\\
d.txt"
),
"Expected dest
\\
testdir
\\
d.txt to not exist
\n
"
);
ok
(
!
check_list
(
&
node
,
"testdir
\\
d.txt"
,
FALSE
),
"list entry should not exist
\n
"
);
ok
(
!
check_list
(
&
node
,
"testdir
\\
c.txt"
,
FALSE
),
"list entry wrong
\n
"
);
ok
(
!
check_list
(
&
node
,
"b.txt"
,
FALSE
),
"list entry wrong
\n
"
);
ok
(
!
check_list
(
&
node
,
"a.txt"
,
TRUE
),
"list entry wrong
\n
"
);
...
...
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