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
5917d573
Commit
5917d573
authored
Jun 02, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Introduce IOCTL_AFD_WINE_FIONREAD.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d1cd6f4a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
socket.c
dlls/ntdll/unix/socket.c
+42
-0
afd.h
include/wine/afd.h
+1
-0
No files found.
dlls/ntdll/unix/socket.c
View file @
5917d573
...
...
@@ -25,6 +25,9 @@
#include "config.h"
#include <errno.h>
#include <unistd.h>
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
...
...
@@ -1274,6 +1277,45 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc
status
=
sock_poll
(
handle
,
event
,
apc
,
apc_user
,
io
,
in_buffer
,
in_size
,
out_buffer
,
out_size
);
break
;
case
IOCTL_AFD_WINE_FIONREAD
:
{
int
value
,
ret
;
if
(
out_size
<
sizeof
(
int
))
{
status
=
STATUS_BUFFER_TOO_SMALL
;
break
;
}
if
((
status
=
server_get_unix_fd
(
handle
,
0
,
&
fd
,
&
needs_close
,
NULL
,
NULL
)))
return
status
;
#ifdef linux
{
socklen_t
len
=
sizeof
(
value
);
/* FIONREAD on a listening socket always fails (see tcp(7)). */
if
(
!
getsockopt
(
fd
,
SOL_SOCKET
,
SO_ACCEPTCONN
,
&
value
,
&
len
)
&&
value
)
{
*
(
int
*
)
out_buffer
=
0
;
status
=
STATUS_SUCCESS
;
complete_async
(
handle
,
event
,
apc
,
apc_user
,
io
,
status
,
0
);
break
;
}
}
#endif
if
((
ret
=
ioctl
(
fd
,
FIONREAD
,
&
value
))
<
0
)
{
status
=
sock_errno_to_status
(
errno
);
break
;
}
*
(
int
*
)
out_buffer
=
value
;
status
=
STATUS_SUCCESS
;
complete_async
(
handle
,
event
,
apc
,
apc_user
,
io
,
status
,
0
);
break
;
}
default:
{
if
((
code
>>
16
)
==
FILE_DEVICE_NETWORK
)
...
...
include/wine/afd.h
View file @
5917d573
...
...
@@ -98,6 +98,7 @@ struct afd_poll_params
#define IOCTL_AFD_WINE_ADDRESS_LIST_CHANGE CTL_CODE(FILE_DEVICE_NETWORK, 208, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_FIONBIO CTL_CODE(FILE_DEVICE_NETWORK, 209, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_COMPLETE_ASYNC CTL_CODE(FILE_DEVICE_NETWORK, 210, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_FIONREAD CTL_CODE(FILE_DEVICE_NETWORK, 211, METHOD_BUFFERED, FILE_ANY_ACCESS)
struct
afd_create_params
{
...
...
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