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
8db78ecc
Commit
8db78ecc
authored
Aug 20, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Allow FileAccessInformation to be queried on files without fds.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
09cca8fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
pipe.c
dlls/kernel32/tests/pipe.c
+38
-0
file.c
dlls/ntdll/file.c
+1
-1
No files found.
dlls/kernel32/tests/pipe.c
View file @
8db78ecc
...
...
@@ -144,6 +144,20 @@ static void _test_pipe_info(unsigned line, HANDLE pipe, DWORD ex_flags, DWORD ex
ok_
(
__FILE__
,
line
)(
max_instances
==
ex_max_instances
,
"max_instances = %x, expected %u
\n
"
,
max_instances
,
ex_max_instances
);
}
#define test_file_access(a,b) _test_file_access(__LINE__,a,b)
static
void
_test_file_access
(
unsigned
line
,
HANDLE
handle
,
DWORD
expected_access
)
{
FILE_ACCESS_INFORMATION
info
;
IO_STATUS_BLOCK
io
;
NTSTATUS
status
;
memset
(
&
info
,
0x11
,
sizeof
(
info
));
status
=
NtQueryInformationFile
(
handle
,
&
io
,
&
info
,
sizeof
(
info
),
FileAccessInformation
);
ok_
(
__FILE__
,
line
)(
status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok_
(
__FILE__
,
line
)(
info
.
AccessFlags
==
expected_access
,
"got access %08x expected %08x
\n
"
,
info
.
AccessFlags
,
expected_access
);
}
static
void
test_CreateNamedPipe
(
int
pipemode
)
{
HANDLE
hnp
;
...
...
@@ -213,6 +227,10 @@ static void test_CreateNamedPipe(int pipemode)
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
test_signaled
(
hnp
);
test_file_access
(
hnp
,
SYNCHRONIZE
|
READ_CONTROL
|
FILE_WRITE_ATTRIBUTES
|
FILE_READ_ATTRIBUTES
|
FILE_WRITE_PROPERTIES
|
FILE_READ_PROPERTIES
|
FILE_APPEND_DATA
|
FILE_WRITE_DATA
|
FILE_READ_DATA
);
ret
=
PeekNamedPipe
(
hnp
,
NULL
,
0
,
NULL
,
&
readden
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_BAD_PIPE
,
"PeekNamedPipe returned %x (%u)
\n
"
,
ret
,
GetLastError
());
...
...
@@ -630,6 +648,26 @@ static void test_CreateNamedPipe(int pipemode)
ok
(
CloseHandle
(
hnp
),
"CloseHandle
\n
"
);
hnp
=
CreateNamedPipeA
(
PIPENAME
,
PIPE_ACCESS_INBOUND
,
pipemode
|
PIPE_WAIT
,
1
,
1024
,
1024
,
NMPWAIT_USE_DEFAULT_WAIT
,
NULL
);
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
test_signaled
(
hnp
);
test_file_access
(
hnp
,
SYNCHRONIZE
|
READ_CONTROL
|
FILE_READ_ATTRIBUTES
|
FILE_READ_PROPERTIES
|
FILE_READ_DATA
);
CloseHandle
(
hnp
);
hnp
=
CreateNamedPipeA
(
PIPENAME
,
PIPE_ACCESS_OUTBOUND
,
pipemode
|
PIPE_WAIT
,
1
,
1024
,
1024
,
NMPWAIT_USE_DEFAULT_WAIT
,
NULL
);
ok
(
hnp
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe failed
\n
"
);
test_signaled
(
hnp
);
test_file_access
(
hnp
,
SYNCHRONIZE
|
READ_CONTROL
|
FILE_WRITE_ATTRIBUTES
|
FILE_WRITE_PROPERTIES
|
FILE_APPEND_DATA
|
FILE_WRITE_DATA
);
CloseHandle
(
hnp
);
if
(
winetest_debug
>
1
)
trace
(
"test_CreateNamedPipe returning
\n
"
);
}
...
...
dlls/ntdll/file.c
View file @
8db78ecc
...
...
@@ -2310,7 +2310,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
if
(
len
<
info_sizes
[
class
])
return
io
->
u
.
Status
=
STATUS_INFO_LENGTH_MISMATCH
;
if
(
class
!=
FilePipeInformation
&&
class
!=
FilePipeLocalInformation
)
if
(
class
!=
FilePipeInformation
&&
class
!=
FilePipeLocalInformation
&&
class
!=
FileAccessInformation
)
{
if
((
io
->
u
.
Status
=
server_get_unix_fd
(
hFile
,
0
,
&
fd
,
&
needs_close
,
NULL
,
NULL
)))
{
...
...
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