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
3602c676
Commit
3602c676
authored
Sep 18, 2022
by
Erich E. Hoover
Committed by
Alexandre Julliard
Oct 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement storing DOS attributes in NtCreateFile.
Co-authored-by:
Joel Holdsworth
<
joel@airwebreathe.org.uk
>
Signed-off-by:
Joel Holdsworth
<
joel@airwebreathe.org.uk
>
parent
0a223f17
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
13 deletions
+26
-13
directory.c
dlls/ntdll/tests/directory.c
+12
-13
file.c
dlls/ntdll/unix/file.c
+14
-0
No files found.
dlls/ntdll/tests/directory.c
View file @
3602c676
...
@@ -55,7 +55,6 @@ static NTSTATUS (WINAPI *pRtlWow64EnableFsRedirectionEx)( ULONG disable, ULONG *
...
@@ -55,7 +55,6 @@ static NTSTATUS (WINAPI *pRtlWow64EnableFsRedirectionEx)( ULONG disable, ULONG *
/* The attribute sets to test */
/* The attribute sets to test */
static
struct
testfile_s
{
static
struct
testfile_s
{
BOOL
todo
;
/* set if it doesn't work on wine yet */
BOOL
attr_done
;
/* set if attributes were tested for this file already */
BOOL
attr_done
;
/* set if attributes were tested for this file already */
const
DWORD
attr
;
/* desired attribute */
const
DWORD
attr
;
/* desired attribute */
WCHAR
name
[
20
];
/* filename to use */
WCHAR
name
[
20
];
/* filename to use */
...
@@ -63,16 +62,16 @@ static struct testfile_s {
...
@@ -63,16 +62,16 @@ static struct testfile_s {
const
char
*
description
;
/* for error messages */
const
char
*
description
;
/* for error messages */
int
nfound
;
/* How many were found (expect 1) */
int
nfound
;
/* How many were found (expect 1) */
}
testfiles
[]
=
{
}
testfiles
[]
=
{
{
0
,
0
,
FILE_ATTRIBUTE_NORMAL
,
{
'l'
,
'o'
,
'n'
,
'g'
,
'f'
,
'i'
,
'l'
,
'e'
,
'n'
,
'a'
,
'm'
,
'e'
,
'.'
,
't'
,
'm'
,
'p'
},
"normal"
},
{
0
,
FILE_ATTRIBUTE_NORMAL
,
{
'l'
,
'o'
,
'n'
,
'g'
,
'f'
,
'i'
,
'l'
,
'e'
,
'n'
,
'a'
,
'm'
,
'e'
,
'.'
,
't'
,
'm'
,
'p'
},
"normal"
},
{
0
,
0
,
FILE_ATTRIBUTE_NORMAL
,
{
'n'
,
'.'
,
't'
,
'm'
,
'p'
,},
"normal"
},
{
0
,
FILE_ATTRIBUTE_NORMAL
,
{
'n'
,
'.'
,
't'
,
'm'
,
'p'
,},
"normal"
},
{
1
,
0
,
FILE_ATTRIBUTE_HIDDEN
,
{
'h'
,
'.'
,
't'
,
'm'
,
'p'
,},
"hidden"
},
{
0
,
FILE_ATTRIBUTE_HIDDEN
,
{
'h'
,
'.'
,
't'
,
'm'
,
'p'
,},
"hidden"
},
{
1
,
0
,
FILE_ATTRIBUTE_SYSTEM
,
{
's'
,
'.'
,
't'
,
'm'
,
'p'
,},
"system"
},
{
0
,
FILE_ATTRIBUTE_SYSTEM
,
{
's'
,
'.'
,
't'
,
'm'
,
'p'
,},
"system"
},
{
0
,
0
,
FILE_ATTRIBUTE_DIRECTORY
,
{
'd'
,
'.'
,
't'
,
'm'
,
'p'
,},
"directory"
},
{
0
,
FILE_ATTRIBUTE_DIRECTORY
,
{
'd'
,
'.'
,
't'
,
'm'
,
'p'
,},
"directory"
},
{
0
,
0
,
FILE_ATTRIBUTE_NORMAL
,
{
0xe9
,
'a'
,
'.'
,
't'
,
'm'
,
'p'
},
"normal"
},
{
0
,
FILE_ATTRIBUTE_NORMAL
,
{
0xe9
,
'a'
,
'.'
,
't'
,
'm'
,
'p'
},
"normal"
},
{
0
,
0
,
FILE_ATTRIBUTE_NORMAL
,
{
0xc9
,
'b'
,
'.'
,
't'
,
'm'
,
'p'
},
"normal"
},
{
0
,
FILE_ATTRIBUTE_NORMAL
,
{
0xc9
,
'b'
,
'.'
,
't'
,
'm'
,
'p'
},
"normal"
},
{
0
,
0
,
FILE_ATTRIBUTE_NORMAL
,
{
'e'
,
'a'
,
'.'
,
't'
,
'm'
,
'p'
},
"normal"
},
{
0
,
FILE_ATTRIBUTE_NORMAL
,
{
'e'
,
'a'
,
'.'
,
't'
,
'm'
,
'p'
},
"normal"
},
{
0
,
0
,
FILE_ATTRIBUTE_DIRECTORY
,
{
'.'
},
". directory"
},
{
0
,
FILE_ATTRIBUTE_DIRECTORY
,
{
'.'
},
". directory"
},
{
0
,
0
,
FILE_ATTRIBUTE_DIRECTORY
,
{
'.'
,
'.'
},
".. directory"
}
{
0
,
FILE_ATTRIBUTE_DIRECTORY
,
{
'.'
,
'.'
},
".. directory"
}
};
};
static
const
int
test_dir_count
=
ARRAY_SIZE
(
testfiles
);
static
const
int
test_dir_count
=
ARRAY_SIZE
(
testfiles
);
static
const
int
max_test_dir_size
=
ARRAY_SIZE
(
testfiles
)
+
5
;
/* size of above plus some for .. etc */
static
const
int
max_test_dir_size
=
ARRAY_SIZE
(
testfiles
)
+
5
;
/* size of above plus some for .. etc */
...
@@ -162,8 +161,8 @@ static void tally_test_file(FILE_BOTH_DIRECTORY_INFORMATION *dir_info)
...
@@ -162,8 +161,8 @@ static void tally_test_file(FILE_BOTH_DIRECTORY_INFORMATION *dir_info)
if
(
namelen
!=
len
||
memcmp
(
nameW
,
testfiles
[
i
].
name
,
len
*
sizeof
(
WCHAR
)))
if
(
namelen
!=
len
||
memcmp
(
nameW
,
testfiles
[
i
].
name
,
len
*
sizeof
(
WCHAR
)))
continue
;
continue
;
if
(
!
testfiles
[
i
].
attr_done
)
{
if
(
!
testfiles
[
i
].
attr_done
)
{
todo_wine_if
(
testfiles
[
i
].
todo
)
ok
(
attrib
==
(
testfiles
[
i
].
attr
&
attribmask
),
"file %s: expected %s (%lx), got %lx
\n
"
,
ok
(
attrib
==
(
testfiles
[
i
].
attr
&
attribmask
),
"file %s: expected %s (%lx), got %lx (is your linux new enough?)
\n
"
,
wine_dbgstr_w
(
testfiles
[
i
].
name
),
testfiles
[
i
].
description
,
testfiles
[
i
].
attr
,
attrib
);
wine_dbgstr_w
(
testfiles
[
i
].
name
),
testfiles
[
i
].
description
,
testfiles
[
i
].
attr
,
attrib
);
testfiles
[
i
].
attr_done
=
TRUE
;
testfiles
[
i
].
attr_done
=
TRUE
;
}
}
testfiles
[
i
].
nfound
++
;
testfiles
[
i
].
nfound
++
;
...
...
dlls/ntdll/unix/file.c
View file @
3602c676
...
@@ -4002,6 +4002,20 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU
...
@@ -4002,6 +4002,20 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU
io
->
Information
=
FILE_OVERWRITTEN
;
io
->
Information
=
FILE_OVERWRITTEN
;
break
;
break
;
}
}
if
(
io
->
Information
==
FILE_CREATED
&&
(
attributes
&
XATTR_ATTRIBS_MASK
))
{
int
fd
,
needs_close
;
/* set any DOS extended attributes */
if
(
!
server_get_unix_fd
(
*
handle
,
0
,
&
fd
,
&
needs_close
,
NULL
,
NULL
))
{
if
(
fd_set_dos_attrib
(
fd
,
attributes
)
==
-
1
&&
errno
!=
ENOTSUP
)
WARN
(
"Failed to set extended attribute "
SAMBA_XATTR_DOS_ATTRIB
". errno %d (%s)"
,
errno
,
strerror
(
errno
)
);
if
(
needs_close
)
close
(
fd
);
}
}
}
}
else
if
(
status
==
STATUS_TOO_MANY_OPENED_FILES
)
else
if
(
status
==
STATUS_TOO_MANY_OPENED_FILES
)
{
{
...
...
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