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
5a3ff7cc
Commit
5a3ff7cc
authored
Jan 17, 2013
by
Charles Davis
Committed by
Alexandre Julliard
Jan 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Make CopyFile(Ex)() succeed even if the source file is delete-locked.
parent
e21c805f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
path.c
dlls/kernel32/path.c
+2
-1
file.c
dlls/kernel32/tests/file.c
+2
-2
No files found.
dlls/kernel32/path.c
View file @
5a3ff7cc
...
@@ -957,7 +957,8 @@ BOOL WINAPI CopyFileExW(LPCWSTR source, LPCWSTR dest,
...
@@ -957,7 +957,8 @@ BOOL WINAPI CopyFileExW(LPCWSTR source, LPCWSTR dest,
TRACE
(
"%s -> %s, %x
\n
"
,
debugstr_w
(
source
),
debugstr_w
(
dest
),
flags
);
TRACE
(
"%s -> %s, %x
\n
"
,
debugstr_w
(
source
),
debugstr_w
(
dest
),
flags
);
if
((
h1
=
CreateFileW
(
source
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
if
((
h1
=
CreateFileW
(
source
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
NULL
,
OPEN_EXISTING
,
0
,
0
))
==
INVALID_HANDLE_VALUE
)
NULL
,
OPEN_EXISTING
,
0
,
0
))
==
INVALID_HANDLE_VALUE
)
{
{
WARN
(
"Unable to open source %s
\n
"
,
debugstr_w
(
source
));
WARN
(
"Unable to open source %s
\n
"
,
debugstr_w
(
source
));
...
...
dlls/kernel32/tests/file.c
View file @
5a3ff7cc
...
@@ -652,11 +652,11 @@ static void test_CopyFileA(void)
...
@@ -652,11 +652,11 @@ static void test_CopyFileA(void)
"copying from an r+w opened and r shared file failed (ret=%d, err=%d)
\n
"
,
retok
,
GetLastError
());
"copying from an r+w opened and r shared file failed (ret=%d, err=%d)
\n
"
,
retok
,
GetLastError
());
CloseHandle
(
hfile
);
CloseHandle
(
hfile
);
/* copying from a delete-locked source
is unreliable
*/
/* copying from a delete-locked source
mostly succeeds
*/
hfile
=
CreateFileA
(
source
,
DELETE
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
hfile
=
CreateFileA
(
source
,
DELETE
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
ok
(
hfile
!=
INVALID_HANDLE_VALUE
,
"failed to open source file, error %d
\n
"
,
GetLastError
());
ok
(
hfile
!=
INVALID_HANDLE_VALUE
,
"failed to open source file, error %d
\n
"
,
GetLastError
());
retok
=
CopyFileA
(
source
,
dest
,
FALSE
);
retok
=
CopyFileA
(
source
,
dest
,
FALSE
);
ok
(
(
!
retok
&&
GetLastError
()
==
ERROR_SHARING_VIOLATION
)
||
broken
(
retok
)
/* 98, Vista, 2k8, 7
*/
,
ok
(
retok
||
broken
(
!
retok
&&
GetLastError
()
==
ERROR_SHARING_VIOLATION
)
/* NT, 2000, XP
*/
,
"copying from a delete-locked file failed (ret=%d, err=%d)
\n
"
,
retok
,
GetLastError
());
"copying from a delete-locked file failed (ret=%d, err=%d)
\n
"
,
retok
,
GetLastError
());
CloseHandle
(
hfile
);
CloseHandle
(
hfile
);
...
...
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