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
7edfcd63
Commit
7edfcd63
authored
Oct 14, 2018
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: MoveFile(source, source) should succeed.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b1d878fd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
10 deletions
+15
-10
path.c
dlls/kernel32/path.c
+10
-5
file.c
dlls/kernel32/tests/file.c
+1
-1
msvcp120.c
dlls/msvcp120/tests/msvcp120.c
+1
-1
msvcp140.c
dlls/msvcp140/tests/msvcp140.c
+1
-1
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+2
-2
No files found.
dlls/kernel32/path.c
View file @
7edfcd63
...
@@ -1281,7 +1281,7 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
...
@@ -1281,7 +1281,7 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
OBJECT_ATTRIBUTES
attr
;
OBJECT_ATTRIBUTES
attr
;
IO_STATUS_BLOCK
io
;
IO_STATUS_BLOCK
io
;
NTSTATUS
status
;
NTSTATUS
status
;
HANDLE
source_handle
=
0
,
dest_handle
;
HANDLE
source_handle
=
0
,
dest_handle
=
0
;
ANSI_STRING
source_unix
,
dest_unix
;
ANSI_STRING
source_unix
,
dest_unix
;
DWORD
options
;
DWORD
options
;
...
@@ -1341,18 +1341,22 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
...
@@ -1341,18 +1341,22 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
status
=
NtOpenFile
(
&
dest_handle
,
GENERIC_READ
|
GENERIC_WRITE
|
SYNCHRONIZE
,
&
attr
,
&
io
,
0
,
options
);
status
=
NtOpenFile
(
&
dest_handle
,
GENERIC_READ
|
GENERIC_WRITE
|
SYNCHRONIZE
,
&
attr
,
&
io
,
0
,
options
);
if
(
status
==
STATUS_SUCCESS
)
/* destination exists */
if
(
status
==
STATUS_SUCCESS
)
/* destination exists */
{
{
NtClose
(
dest_handle
);
if
(
!
(
flag
&
MOVEFILE_REPLACE_EXISTING
))
if
(
!
(
flag
&
MOVEFILE_REPLACE_EXISTING
))
{
{
SetLastError
(
ERROR_ALREADY_EXISTS
);
if
(
!
is_same_file
(
source_handle
,
dest_handle
))
RtlFreeUnicodeString
(
&
nt_name
);
{
goto
error
;
SetLastError
(
ERROR_ALREADY_EXISTS
);
RtlFreeUnicodeString
(
&
nt_name
);
goto
error
;
}
}
}
else
if
(
info
.
FileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
/* cannot replace directory */
else
if
(
info
.
FileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
/* cannot replace directory */
{
{
SetLastError
(
ERROR_ACCESS_DENIED
);
SetLastError
(
ERROR_ACCESS_DENIED
);
goto
error
;
goto
error
;
}
}
NtClose
(
dest_handle
);
}
}
else
if
(
status
!=
STATUS_OBJECT_NAME_NOT_FOUND
)
else
if
(
status
!=
STATUS_OBJECT_NAME_NOT_FOUND
)
{
{
...
@@ -1412,6 +1416,7 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
...
@@ -1412,6 +1416,7 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
error:
error:
if
(
source_handle
)
NtClose
(
source_handle
);
if
(
source_handle
)
NtClose
(
source_handle
);
if
(
dest_handle
)
NtClose
(
dest_handle
);
RtlFreeAnsiString
(
&
source_unix
);
RtlFreeAnsiString
(
&
source_unix
);
RtlFreeAnsiString
(
&
dest_unix
);
RtlFreeAnsiString
(
&
dest_unix
);
return
FALSE
;
return
FALSE
;
...
...
dlls/kernel32/tests/file.c
View file @
7edfcd63
...
@@ -1894,7 +1894,7 @@ static void test_MoveFileA(void)
...
@@ -1894,7 +1894,7 @@ static void test_MoveFileA(void)
ok
(
ret
!=
0
,
"GetTempFileNameA error %d
\n
"
,
GetLastError
());
ok
(
ret
!=
0
,
"GetTempFileNameA error %d
\n
"
,
GetLastError
());
ret
=
MoveFileA
(
source
,
source
);
ret
=
MoveFileA
(
source
,
source
);
todo_wine
ok
(
ret
,
"MoveFileA: failed, error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"MoveFileA: failed, error %d
\n
"
,
GetLastError
());
ret
=
MoveFileA
(
source
,
dest
);
ret
=
MoveFileA
(
source
,
dest
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_ALREADY_EXISTS
,
ok
(
!
ret
&&
GetLastError
()
==
ERROR_ALREADY_EXISTS
,
...
...
dlls/msvcp120/tests/msvcp120.c
View file @
7edfcd63
...
@@ -1529,7 +1529,7 @@ static void test_tr2_sys__Rename(void)
...
@@ -1529,7 +1529,7 @@ static void test_tr2_sys__Rename(void)
CloseHandle
(
file
);
CloseHandle
(
file
);
ret
=
p_tr2_sys__Rename
(
"tr2_test_dir
\\
f1"
,
"tr2_test_dir
\\
f1"
);
ret
=
p_tr2_sys__Rename
(
"tr2_test_dir
\\
f1"
,
"tr2_test_dir
\\
f1"
);
todo_wine
ok
(
ERROR_SUCCESS
==
ret
,
"test_tr2_sys__Rename(): expect: ERROR_SUCCESS, got %d
\n
"
,
ret
);
ok
(
ERROR_SUCCESS
==
ret
,
"test_tr2_sys__Rename(): expect: ERROR_SUCCESS, got %d
\n
"
,
ret
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
);
i
++
)
{
errno
=
0xdeadbeef
;
errno
=
0xdeadbeef
;
if
(
tests
[
i
].
val
==
ERROR_SUCCESS
)
{
if
(
tests
[
i
].
val
==
ERROR_SUCCESS
)
{
...
...
dlls/msvcp140/tests/msvcp140.c
View file @
7edfcd63
...
@@ -1148,7 +1148,7 @@ static void test_Rename(void)
...
@@ -1148,7 +1148,7 @@ static void test_Rename(void)
CloseHandle
(
file
);
CloseHandle
(
file
);
ret
=
p_Rename
(
f1W
,
f1W
);
ret
=
p_Rename
(
f1W
,
f1W
);
todo_wine
ok
(
ERROR_SUCCESS
==
ret
,
"_Rename(): expect: ERROR_SUCCESS, got %d
\n
"
,
ret
);
ok
(
ERROR_SUCCESS
==
ret
,
"_Rename(): expect: ERROR_SUCCESS, got %d
\n
"
,
ret
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
);
i
++
)
{
errno
=
0xdeadbeef
;
errno
=
0xdeadbeef
;
if
(
tests
[
i
].
val
==
ERROR_SUCCESS
)
{
if
(
tests
[
i
].
val
==
ERROR_SUCCESS
)
{
...
...
programs/cmd/tests/test_builtins.cmd.exp
View file @
7edfcd63
...
@@ -1313,8 +1313,8 @@ file move succeeded
...
@@ -1313,8 +1313,8 @@ file move succeeded
@todo_wine@bar@or_broken@baz
@todo_wine@bar@or_broken@baz
read-only files are moveable
read-only files are moveable
file moved in subdirectory
file moved in subdirectory
@todo_wine@
moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op!
moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op!
@todo_wine@
ErrorLevel: 0@or_broken@ErrorLevel: 1
ErrorLevel: 0@or_broken@ErrorLevel: 1
--- directory move
--- directory move
simple directory move succeeded
simple directory move succeeded
moving a directory to itself gives error; errlevel 1
moving a directory to itself gives error; errlevel 1
...
...
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