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
e9162552
Commit
e9162552
authored
Aug 07, 2023
by
Joel Holdsworth
Committed by
Alexandre Julliard
Oct 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add support for FILE_{RENAME,LINK}_IGNORE_READONLY_ATTRIBUTE.
Signed-off-by:
Joel Holdsworth
<
joel@airwebreathe.org.uk
>
parent
a8489d12
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
file.c
dlls/ntdll/tests/file.c
+7
-7
file.c
dlls/ntdll/unix/file.c
+2
-2
fd.c
server/fd.c
+2
-1
No files found.
dlls/ntdll/tests/file.c
View file @
e9162552
...
...
@@ -2259,10 +2259,10 @@ static void test_file_rename_information_ex(void)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fri
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
fri
->
FileNameLength
,
FileRenameInformationEx
);
todo_wine
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"io.Status expected STATUS_SUCCESS, got %lx
\n
"
,
io
.
Status
);
todo_wine
ok
(
res
==
STATUS_SUCCESS
,
"res expected STATUS_SUCCESS, got %lx
\n
"
,
res
);
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"io.Status expected STATUS_SUCCESS, got %lx
\n
"
,
io
.
Status
);
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
ok
(
fileDeleted
,
"file should not exist
\n
"
);
ok
(
fileDeleted
,
"file should not exist
\n
"
);
fileDeleted
=
GetFileAttributesW
(
newpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
...
...
@@ -3076,8 +3076,8 @@ static void test_file_link_information_ex(void)
return
;
}
ok
(
io
.
Status
==
0xdeadbeef
,
"io.Status expected 0xdeadbeef, got %lx
\n
"
,
io
.
Status
);
todo_wine
ok
(
res
==
STATUS_ACCESS_DENIED
,
"res expected STATUS_ACCESS_DENIED, got %lx
\n
"
,
res
);
todo_wine
ok
(
io
.
Status
==
0xdeadbeef
,
"io.Status expected 0xdeadbeef, got %lx
\n
"
,
io
.
Status
);
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
"
);
fileDeleted
=
GetFileAttributesW
(
newpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
...
...
@@ -3110,8 +3110,8 @@ static void test_file_link_information_ex(void)
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fli
,
sizeof
(
FILE_LINK_INFORMATION
)
+
fli
->
FileNameLength
,
FileLinkInformationEx
);
todo_wine
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"io.Status expected STATUS_SUCCESS, got %lx
\n
"
,
io
.
Status
);
todo_wine
ok
(
res
==
STATUS_SUCCESS
,
"res expected STATUS_SUCCESS, got %lx
\n
"
,
res
);
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"io.Status expected STATUS_SUCCESS, got %lx
\n
"
,
io
.
Status
);
ok
(
res
==
STATUS_SUCCESS
,
"res expected STATUS_SUCCESS, got %lx
\n
"
,
res
);
fileDeleted
=
GetFileAttributesW
(
oldpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"file should exist
\n
"
);
fileDeleted
=
GetFileAttributesW
(
newpath
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
...
...
dlls/ntdll/unix/file.c
View file @
e9162552
...
...
@@ -4797,7 +4797,7 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
else
flags
=
info
->
Flags
;
if
(
flags
&
~
FILE_RENAME_REPLACE_IF_EXISTS
)
if
(
flags
&
~
(
FILE_RENAME_REPLACE_IF_EXISTS
|
FILE_RENAME_IGNORE_READONLY_ATTRIBUTE
)
)
FIXME
(
"unsupported flags: %#x
\n
"
,
flags
);
name_str
.
Buffer
=
info
->
FileName
;
...
...
@@ -4844,7 +4844,7 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
else
flags
=
info
->
Flags
;
if
(
flags
&
~
FILE_LINK_REPLACE_IF_EXISTS
)
if
(
flags
&
~
(
FILE_LINK_REPLACE_IF_EXISTS
|
FILE_LINK_IGNORE_READONLY_ATTRIBUTE
)
)
FIXME
(
"unsupported flags: %#x
\n
"
,
flags
);
name_str
.
Buffer
=
info
->
FileName
;
...
...
server/fd.c
View file @
e9162552
...
...
@@ -2601,7 +2601,8 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
}
/* read-only files cannot be replaced */
if
(
!
(
st
.
st_mode
&
(
S_IWUSR
|
S_IWGRP
|
S_IWOTH
)))
if
(
!
(
st
.
st_mode
&
(
S_IWUSR
|
S_IWGRP
|
S_IWOTH
))
&&
!
(
flags
&
FILE_RENAME_IGNORE_READONLY_ATTRIBUTE
))
{
set_error
(
STATUS_ACCESS_DENIED
);
goto
failed
;
...
...
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