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
1e87417e
Commit
1e87417e
authored
Oct 05, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Always use server ioctl for FSCTL_PIPE_PEEK.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d520f30b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
63 deletions
+8
-63
file.c
dlls/ntdll/file.c
+0
-63
file.c
dlls/ntdll/tests/file.c
+8
-0
No files found.
dlls/ntdll/file.c
View file @
1e87417e
...
@@ -1699,69 +1699,6 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
...
@@ -1699,69 +1699,6 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
if
(
!
status
)
status
=
DIR_unmount_device
(
handle
);
if
(
!
status
)
status
=
DIR_unmount_device
(
handle
);
return
status
;
return
status
;
case
FSCTL_PIPE_PEEK
:
{
FILE_PIPE_PEEK_BUFFER
*
buffer
=
out_buffer
;
int
avail
=
0
,
fd
,
needs_close
;
if
(
out_size
<
FIELD_OFFSET
(
FILE_PIPE_PEEK_BUFFER
,
Data
))
{
status
=
STATUS_INFO_LENGTH_MISMATCH
;
break
;
}
if
((
status
=
server_get_unix_fd
(
handle
,
FILE_READ_DATA
,
&
fd
,
&
needs_close
,
NULL
,
NULL
)))
{
if
(
status
==
STATUS_BAD_DEVICE_TYPE
)
return
server_ioctl_file
(
handle
,
event
,
apc
,
apc_context
,
io
,
code
,
in_buffer
,
in_size
,
out_buffer
,
out_size
);
break
;
}
#ifdef FIONREAD
if
(
ioctl
(
fd
,
FIONREAD
,
&
avail
)
!=
0
)
{
TRACE
(
"FIONREAD failed reason: %s
\n
"
,
strerror
(
errno
));
if
(
needs_close
)
close
(
fd
);
status
=
FILE_GetNtStatus
();
break
;
}
#endif
if
(
!
avail
)
/* check for closed pipe */
{
struct
pollfd
pollfd
;
int
ret
;
pollfd
.
fd
=
fd
;
pollfd
.
events
=
POLLIN
;
pollfd
.
revents
=
0
;
ret
=
poll
(
&
pollfd
,
1
,
0
);
if
(
ret
==
-
1
||
(
ret
==
1
&&
(
pollfd
.
revents
&
(
POLLHUP
|
POLLERR
))))
{
if
(
needs_close
)
close
(
fd
);
status
=
STATUS_PIPE_BROKEN
;
break
;
}
}
buffer
->
NamedPipeState
=
0
;
/* FIXME */
buffer
->
ReadDataAvailable
=
avail
;
buffer
->
NumberOfMessages
=
0
;
/* FIXME */
buffer
->
MessageLength
=
0
;
/* FIXME */
io
->
Information
=
FIELD_OFFSET
(
FILE_PIPE_PEEK_BUFFER
,
Data
);
status
=
STATUS_SUCCESS
;
if
(
avail
)
{
ULONG
data_size
=
out_size
-
FIELD_OFFSET
(
FILE_PIPE_PEEK_BUFFER
,
Data
);
if
(
data_size
)
{
int
res
=
recv
(
fd
,
buffer
->
Data
,
data_size
,
MSG_PEEK
);
if
(
res
>=
0
)
io
->
Information
+=
res
;
}
}
if
(
needs_close
)
close
(
fd
);
}
break
;
case
FSCTL_PIPE_DISCONNECT
:
case
FSCTL_PIPE_DISCONNECT
:
status
=
server_ioctl_file
(
handle
,
event
,
apc
,
apc_context
,
io
,
code
,
status
=
server_ioctl_file
(
handle
,
event
,
apc
,
apc_context
,
io
,
code
,
in_buffer
,
in_size
,
out_buffer
,
out_size
);
in_buffer
,
in_size
,
out_buffer
,
out_size
);
...
...
dlls/ntdll/tests/file.c
View file @
1e87417e
...
@@ -4179,6 +4179,7 @@ static void test_read_write(void)
...
@@ -4179,6 +4179,7 @@ static void test_read_write(void)
static
void
test_ioctl
(
void
)
static
void
test_ioctl
(
void
)
{
{
HANDLE
event
=
CreateEventA
(
NULL
,
TRUE
,
FALSE
,
NULL
);
HANDLE
event
=
CreateEventA
(
NULL
,
TRUE
,
FALSE
,
NULL
);
FILE_PIPE_PEEK_BUFFER
peek_buf
;
IO_STATUS_BLOCK
iosb
;
IO_STATUS_BLOCK
iosb
;
HANDLE
file
;
HANDLE
file
;
NTSTATUS
status
;
NTSTATUS
status
;
...
@@ -4195,6 +4196,13 @@ static void test_ioctl(void)
...
@@ -4195,6 +4196,13 @@ static void test_ioctl(void)
status
=
pNtFsControlFile
(
file
,
(
HANDLE
)
0xdeadbeef
,
NULL
,
NULL
,
&
iosb
,
0xdeadbeef
,
0
,
0
,
0
,
0
);
status
=
pNtFsControlFile
(
file
,
(
HANDLE
)
0xdeadbeef
,
NULL
,
NULL
,
&
iosb
,
0xdeadbeef
,
0
,
0
,
0
,
0
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"NtFsControlFile returned %x
\n
"
,
status
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"NtFsControlFile returned %x
\n
"
,
status
);
memset
(
&
iosb
,
0x55
,
sizeof
(
iosb
));
status
=
NtFsControlFile
(
file
,
NULL
,
NULL
,
NULL
,
&
iosb
,
FSCTL_PIPE_PEEK
,
NULL
,
0
,
&
peek_buf
,
sizeof
(
peek_buf
));
todo_wine
ok
(
status
==
STATUS_INVALID_DEVICE_REQUEST
,
"NtFsControlFile failed: %x
\n
"
,
status
);
ok
(
iosb
.
Status
==
0x55555555
,
"iosb.Status = %x
\n
"
,
iosb
.
Status
);
CloseHandle
(
event
);
CloseHandle
(
event
);
CloseHandle
(
file
);
CloseHandle
(
file
);
}
}
...
...
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