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
c7b1551e
Commit
c7b1551e
authored
Sep 20, 2023
by
Joel Holdsworth
Committed by
Alexandre Julliard
Oct 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Initial implementation of FileRenameInformationEx.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54997
Signed-off-by:
Joel Holdsworth
<
joel@airwebreathe.org.uk
>
parent
25db1c5d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
56 deletions
+30
-56
file.c
dlls/ntdll/tests/file.c
+3
-45
file.c
dlls/ntdll/unix/file.c
+12
-2
file.c
dlls/wow64/file.c
+2
-1
struct32.h
dlls/wow64/struct32.h
+5
-1
server_protocol.h
include/wine/server_protocol.h
+2
-2
fd.c
server/fd.c
+3
-2
protocol.def
server/protocol.def
+1
-1
request.h
server/request.h
+1
-1
trace.c
server/trace.c
+1
-1
No files found.
dlls/ntdll/tests/file.c
View file @
c7b1551e
...
...
@@ -1549,29 +1549,24 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
if
(
class
==
FileRenameInformationEx
&&
(
res
==
STATUS_NOT_IMPLEMENTED
||
res
==
STATUS_INVALID_INFO_CLASS
))
{
todo_wine
win_skip
(
"FileRenameInformationEx not supported
\n
"
);
win_skip
(
"FileRenameInformationEx not supported
\n
"
);
CloseHandle
(
handle
);
HeapFree
(
GetProcessHeap
(),
0
,
fri
);
delete_object
(
oldpath
);
return
;
}
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"io.Status expected STATUS_SUCCESS, got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_SUCCESS
,
"res expected STATUS_SUCCESS, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
fileDeleted
,
"file should not exist
\n
"
);
fileDeleted
=
GetFileAttributesW
(
newpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
fni
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
FILE_NAME_INFORMATION
)
+
MAX_PATH
*
sizeof
(
WCHAR
)
);
res
=
pNtQueryInformationFile
(
handle
,
&
io
,
fni
,
sizeof
(
FILE_NAME_INFORMATION
)
+
MAX_PATH
*
sizeof
(
WCHAR
),
FileNameInformation
);
ok
(
res
==
STATUS_SUCCESS
,
"res expected STATUS_SUCCESS, got %lx
\n
"
,
res
);
fni
->
FileName
[
fni
->
FileNameLength
/
sizeof
(
WCHAR
)
]
=
0
;
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
!
lstrcmpiW
(
fni
->
FileName
,
newpath
+
2
),
"FileName expected %s, got %s
\n
"
,
wine_dbgstr_w
(
newpath
+
2
),
wine_dbgstr_w
(
fni
->
FileName
)
);
HeapFree
(
GetProcessHeap
(),
0
,
fni
);
...
...
@@ -1600,7 +1595,6 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine
ok
(
io
.
Status
==
0xdeadbeef
,
"io.Status expected 0xdeadbeef, got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_OBJECT_NAME_COLLISION
,
"res expected STATUS_OBJECT_NAME_COLLISION, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
...
...
@@ -1630,12 +1624,9 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"io.Status expected STATUS_SUCCESS, got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_SUCCESS
,
"res expected STATUS_SUCCESS, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
fileDeleted
,
"file should not exist
\n
"
);
fileDeleted
=
GetFileAttributesW
(
newpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
...
...
@@ -1667,7 +1658,6 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine
ok
(
io
.
Status
==
0xdeadbeef
,
"io.Status expected 0xdeadbeef, got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_OBJECT_NAME_COLLISION
,
"res expected STATUS_OBJECT_NAME_COLLISION, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
...
...
@@ -1702,7 +1692,6 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine
ok
(
io
.
Status
==
0xdeadbeef
,
"io.Status expected 0xdeadbeef, got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_ACCESS_DENIED
,
"res expected STATUS_ACCESS_DENIED, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
...
...
@@ -1737,22 +1726,17 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"io.Status expected STATUS_SUCCESS, got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_SUCCESS
,
"res expected STATUS_SUCCESS, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
fileDeleted
,
"file should not exist
\n
"
);
fileDeleted
=
GetFileAttributesW
(
newpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
fni
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
FILE_NAME_INFORMATION
)
+
MAX_PATH
*
sizeof
(
WCHAR
)
);
res
=
pNtQueryInformationFile
(
handle
,
&
io
,
fni
,
sizeof
(
FILE_NAME_INFORMATION
)
+
MAX_PATH
*
sizeof
(
WCHAR
),
FileNameInformation
);
ok
(
res
==
STATUS_SUCCESS
,
"res expected STATUS_SUCCESS, got %lx
\n
"
,
res
);
fni
->
FileName
[
fni
->
FileNameLength
/
sizeof
(
WCHAR
)
]
=
0
;
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
!
lstrcmpiW
(
fni
->
FileName
,
newpath
+
2
),
"FileName expected %s, got %s
\n
"
,
wine_dbgstr_w
(
newpath
+
2
),
wine_dbgstr_w
(
fni
->
FileName
)
);
HeapFree
(
GetProcessHeap
(),
0
,
fni
);
...
...
@@ -1792,11 +1776,9 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
todo_wine
ok
(
io
.
Status
==
0xdeadbeef
||
io
.
Status
==
STATUS_ACCESS_DENIED
,
"io.Status got %lx
\n
"
,
io
.
Status
);
todo_wine
ok
(
res
==
STATUS_ACCESS_DENIED
,
"res expected STATUS_ACCESS_DENIED, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
todo_wine_if
(
class
!=
FileRenameInformationEx
)
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
todo_wine
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
fileDeleted
=
GetFileAttributesW
(
newpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
todo_wine_if
(
class
!=
FileRenameInformationEx
)
ok
(
fileDeleted
,
"file should not exist
\n
"
);
todo_wine
ok
(
fileDeleted
,
"file should not exist
\n
"
);
CloseHandle
(
handle
);
CloseHandle
(
handle2
);
...
...
@@ -1831,9 +1813,7 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
io
.
Status
==
0xdeadbeef
||
io
.
Status
==
STATUS_OBJECT_NAME_COLLISION
,
"io.Status got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_OBJECT_NAME_COLLISION
,
"res expected STATUS_OBJECT_NAME_COLLISION, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
...
...
@@ -1869,9 +1849,7 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
io
.
Status
==
0xdeadbeef
||
io
.
Status
==
STATUS_OBJECT_NAME_COLLISION
,
"io.Status got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_OBJECT_NAME_COLLISION
,
"res expected STATUS_OBJECT_NAME_COLLISION, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
...
...
@@ -1905,12 +1883,9 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"io.Status expected STATUS_SUCCESS, got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_SUCCESS
,
"res expected STATUS_SUCCESS, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
fileDeleted
,
"file should not exist
\n
"
);
fileDeleted
=
GetFileAttributesW
(
newpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
...
...
@@ -1944,9 +1919,7 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
io
.
Status
==
0xdeadbeef
||
io
.
Status
==
STATUS_ACCESS_DENIED
,
"io.Status got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_ACCESS_DENIED
,
"res expected STATUS_ACCESS_DENIED, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
...
...
@@ -1983,9 +1956,7 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
io
.
Status
==
0xdeadbeef
||
io
.
Status
==
STATUS_OBJECT_NAME_COLLISION
,
"io.Status got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_OBJECT_NAME_COLLISION
,
"res expected STATUS_OBJECT_NAME_COLLISION, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
...
...
@@ -2021,9 +1992,7 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
io
.
Status
==
0xdeadbeef
||
io
.
Status
==
STATUS_ACCESS_DENIED
,
"io.Status got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_ACCESS_DENIED
,
"res expected STATUS_ACCESS_DENIED, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
...
...
@@ -2062,9 +2031,7 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
io
.
Status
==
0xdeadbeef
||
io
.
Status
==
STATUS_ACCESS_DENIED
,
"io.Status got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_ACCESS_DENIED
,
"res expected STATUS_ACCESS_DENIED, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
...
...
@@ -2099,7 +2066,6 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine
ok
(
io
.
Status
==
0xdeadbeef
,
"io.Status expected 0xdeadbeef, got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_OBJECT_NAME_COLLISION
,
"res expected STATUS_OBJECT_NAME_COLLISION, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
...
...
@@ -2133,7 +2099,6 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine
ok
(
io
.
Status
==
0xdeadbeef
,
"io.Status expected 0xdeadbeef, got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_ACCESS_DENIED
,
"res expected STATUS_ACCESS_DENIED, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
...
...
@@ -2167,22 +2132,17 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"io.Status expected STATUS_SUCCESS, got %lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_SUCCESS
,
"res expected STATUS_SUCCESS, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
fileDeleted
,
"file should not exist
\n
"
);
fileDeleted
=
GetFileAttributesW
(
newpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
fni
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
FILE_NAME_INFORMATION
)
+
MAX_PATH
*
sizeof
(
WCHAR
)
);
res
=
pNtQueryInformationFile
(
handle
,
&
io
,
fni
,
sizeof
(
FILE_NAME_INFORMATION
)
+
MAX_PATH
*
sizeof
(
WCHAR
),
FileNameInformation
);
ok
(
res
==
STATUS_SUCCESS
,
"res expected STATUS_SUCCESS, got %lx
\n
"
,
res
);
fni
->
FileName
[
fni
->
FileNameLength
/
sizeof
(
WCHAR
)
]
=
0
;
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
!
lstrcmpiW
(
fni
->
FileName
,
newpath
+
2
),
"FileName expected %s, got %s
\n
"
,
wine_dbgstr_w
(
newpath
+
2
),
wine_dbgstr_w
(
fni
->
FileName
)
);
HeapFree
(
GetProcessHeap
(),
0
,
fni
);
...
...
@@ -2209,9 +2169,7 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
class
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"got io status %#lx
\n
"
,
io
.
Status
);
todo_wine_if
(
class
==
FileRenameInformationEx
)
ok
(
res
==
STATUS_SUCCESS
,
"got status %lx
\n
"
,
res
);
ok
(
GetFileAttributesW
(
oldpath
)
!=
INVALID_FILE_ATTRIBUTES
,
"file should exist
\n
"
);
...
...
dlls/ntdll/unix/file.c
View file @
c7b1551e
...
...
@@ -4783,13 +4783,23 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
break
;
case
FileRenameInformation
:
case
FileRenameInformationEx
:
if
(
len
>=
sizeof
(
FILE_RENAME_INFORMATION
))
{
FILE_RENAME_INFORMATION
*
info
=
ptr
;
unsigned
int
flags
;
UNICODE_STRING
name_str
,
redir
;
OBJECT_ATTRIBUTES
attr
;
char
*
unix_name
;
if
(
class
==
FileRenameInformation
)
flags
=
info
->
ReplaceIfExists
?
FILE_RENAME_REPLACE_IF_EXISTS
:
0
;
else
flags
=
info
->
Flags
;
if
(
flags
&
~
FILE_RENAME_REPLACE_IF_EXISTS
)
FIXME
(
"unsupported flags: %#x
\n
"
,
flags
);
name_str
.
Buffer
=
info
->
FileName
;
name_str
.
Length
=
info
->
FileNameLength
;
name_str
.
MaximumLength
=
info
->
FileNameLength
+
sizeof
(
WCHAR
);
...
...
@@ -4805,7 +4815,7 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
req
->
rootdir
=
wine_server_obj_handle
(
attr
.
RootDirectory
);
req
->
namelen
=
attr
.
ObjectName
->
Length
;
req
->
link
=
FALSE
;
req
->
replace
=
info
->
ReplaceIfExist
s
;
req
->
flags
=
flag
s
;
wine_server_add_data
(
req
,
attr
.
ObjectName
->
Buffer
,
attr
.
ObjectName
->
Length
);
wine_server_add_data
(
req
,
unix_name
,
strlen
(
unix_name
)
);
status
=
wine_server_call
(
req
);
...
...
@@ -4842,7 +4852,7 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
req
->
rootdir
=
wine_server_obj_handle
(
attr
.
RootDirectory
);
req
->
namelen
=
attr
.
ObjectName
->
Length
;
req
->
link
=
TRUE
;
req
->
replace
=
info
->
ReplaceIfExists
;
req
->
flags
=
info
->
ReplaceIfExists
?
FILE_LINK_REPLACE_IF_EXISTS
:
0
;
wine_server_add_data
(
req
,
attr
.
ObjectName
->
Buffer
,
attr
.
ObjectName
->
Length
);
wine_server_add_data
(
req
,
unix_name
,
strlen
(
unix_name
)
);
status
=
wine_server_call
(
req
);
...
...
dlls/wow64/file.c
View file @
c7b1551e
...
...
@@ -792,6 +792,7 @@ NTSTATUS WINAPI wow64_NtSetInformationFile( UINT *args )
break
;
case
FileRenameInformation
:
/* FILE_RENAME_INFORMATION */
case
FileRenameInformationEx
:
/* FILE_RENAME_INFORMATION */
case
FileLinkInformation
:
/* FILE_LINK_INFORMATION */
if
(
len
>=
sizeof
(
FILE_RENAME_INFORMATION32
))
{
...
...
@@ -807,7 +808,7 @@ NTSTATUS WINAPI wow64_NtSetInformationFile( UINT *args )
get_file_redirect
(
&
attr
);
size
=
offsetof
(
FILE_RENAME_INFORMATION
,
FileName
[
name
.
Length
/
sizeof
(
WCHAR
)]
);
info
=
Wow64AllocateTemp
(
size
);
info
->
ReplaceIfExists
=
info32
->
ReplaceIfExist
s
;
info
->
Flags
=
info32
->
Flag
s
;
info
->
RootDirectory
=
attr
.
RootDirectory
;
info
->
FileNameLength
=
name
.
Length
;
memcpy
(
info
->
FileName
,
name
.
Buffer
,
info
->
FileNameLength
);
...
...
dlls/wow64/struct32.h
View file @
c7b1551e
...
...
@@ -94,7 +94,11 @@ typedef struct
typedef
struct
{
BOOLEAN
ReplaceIfExists
;
union
{
BOOLEAN
ReplaceIfExists
;
ULONG
Flags
;
};
ULONG
RootDirectory
;
ULONG
FileNameLength
;
WCHAR
FileName
[
1
];
...
...
include/wine/server_protocol.h
View file @
c7b1551e
...
...
@@ -5307,7 +5307,7 @@ struct set_fd_name_info_request
obj_handle_t
rootdir
;
data_size_t
namelen
;
int
link
;
int
replace
;
unsigned
int
flags
;
/* VARARG(name,unicode_str,namelen); */
/* VARARG(filename,string); */
};
...
...
@@ -6487,7 +6487,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 78
2
#define SERVER_PROTOCOL_VERSION 78
3
/* ### protocol_version end ### */
...
...
server/fd.c
View file @
c7b1551e
...
...
@@ -2511,11 +2511,12 @@ static void set_fd_disposition( struct fd *fd, unsigned int flags )
/* set new name for the fd */
static
void
set_fd_name
(
struct
fd
*
fd
,
struct
fd
*
root
,
const
char
*
nameptr
,
data_size_t
len
,
struct
unicode_str
nt_name
,
int
create_link
,
int
replace
)
struct
unicode_str
nt_name
,
int
create_link
,
unsigned
int
flags
)
{
struct
inode
*
inode
;
struct
stat
st
,
st2
;
char
*
name
;
const
unsigned
int
replace
=
flags
&
FILE_RENAME_REPLACE_IF_EXISTS
;
if
(
!
fd
->
inode
||
!
fd
->
unix_name
)
{
...
...
@@ -2967,7 +2968,7 @@ DECL_HANDLER(set_fd_name_info)
if
((
fd
=
get_handle_fd_obj
(
current
->
process
,
req
->
handle
,
0
)))
{
set_fd_name
(
fd
,
root_fd
,
(
const
char
*
)
get_req_data
()
+
req
->
namelen
,
get_req_data_size
()
-
req
->
namelen
,
nt_name
,
req
->
link
,
req
->
replace
);
get_req_data_size
()
-
req
->
namelen
,
nt_name
,
req
->
link
,
req
->
flags
);
release_object
(
fd
);
}
if
(
root_fd
)
release_object
(
root_fd
);
...
...
server/protocol.def
View file @
c7b1551e
...
...
@@ -3692,7 +3692,7 @@ struct handle_info
obj_handle_t rootdir; /* root directory */
data_size_t namelen; /* length of NT name in bytes */
int link; /* link instead of renaming */
int replace; /* replace an existing file?
*/
unsigned int flags; /* FILE_RENAME_* flags
*/
VARARG(name,unicode_str,namelen); /* NT name */
VARARG(filename,string); /* new file name */
@END
...
...
server/request.h
View file @
c7b1551e
...
...
@@ -2241,7 +2241,7 @@ C_ASSERT( FIELD_OFFSET(struct set_fd_name_info_request, handle) == 12 );
C_ASSERT
(
FIELD_OFFSET
(
struct
set_fd_name_info_request
,
rootdir
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_fd_name_info_request
,
namelen
)
==
20
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_fd_name_info_request
,
link
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_fd_name_info_request
,
replace
)
==
28
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_fd_name_info_request
,
flags
)
==
28
);
C_ASSERT
(
sizeof
(
struct
set_fd_name_info_request
)
==
32
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_fd_eof_info_request
,
handle
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_fd_eof_info_request
,
eof
)
==
16
);
...
...
server/trace.c
View file @
c7b1551e
...
...
@@ -4411,7 +4411,7 @@ static void dump_set_fd_name_info_request( const struct set_fd_name_info_request
fprintf
(
stderr
,
", rootdir=%04x"
,
req
->
rootdir
);
fprintf
(
stderr
,
", namelen=%u"
,
req
->
namelen
);
fprintf
(
stderr
,
", link=%d"
,
req
->
link
);
fprintf
(
stderr
,
",
replace=%d"
,
req
->
replace
);
fprintf
(
stderr
,
",
flags=%08x"
,
req
->
flags
);
dump_varargs_unicode_str
(
", name="
,
min
(
cur_size
,
req
->
namelen
)
);
dump_varargs_string
(
", filename="
,
cur_size
);
}
...
...
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