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
0a33ac4a
Commit
0a33ac4a
authored
Jul 22, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Move the implementation of IOCTL_AFD_GET_EVENTS to a dedicated server call.
parent
8ab7120b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
103 additions
and
25 deletions
+103
-25
socket.c
dlls/ntdll/unix/socket.c
+24
-2
server_protocol.h
include/wine/server_protocol.h
+21
-1
protocol.def
server/protocol.def
+10
-0
request.h
server/request.h
+7
-0
sock.c
server/sock.c
+26
-22
trace.c
server/trace.c
+15
-0
No files found.
dlls/ntdll/unix/socket.c
View file @
0a33ac4a
...
...
@@ -1552,10 +1552,32 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc
}
case
IOCTL_AFD_GET_EVENTS
:
{
struct
afd_get_events_params
*
params
=
out_buffer
;
HANDLE
reset_event
=
in_buffer
;
/* sic */
TRACE
(
"reset_event %p
\n
"
,
reset_event
);
if
(
in_size
)
FIXME
(
"unexpected input size %u
\n
"
,
in_size
);
status
=
STATUS_BAD_DEVICE_TYPE
;
break
;
if
(
out_size
<
sizeof
(
*
params
))
{
status
=
STATUS_INVALID_PARAMETER
;
break
;
}
SERVER_START_REQ
(
socket_get_events
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
req
->
event
=
wine_server_obj_handle
(
reset_event
);
wine_server_set_reply
(
req
,
params
->
status
,
sizeof
(
params
->
status
)
);
if
(
!
(
status
=
wine_server_call
(
req
)))
params
->
flags
=
reply
->
flags
;
}
SERVER_END_REQ
;
complete_async
(
handle
,
event
,
apc
,
apc_user
,
io
,
status
,
0
);
return
status
;
}
case
IOCTL_AFD_POLL
:
status
=
STATUS_BAD_DEVICE_TYPE
;
...
...
include/wine/server_protocol.h
View file @
0a33ac4a
...
...
@@ -1841,6 +1841,23 @@ struct send_socket_reply
struct
socket_get_events_request
{
struct
request_header
__header
;
obj_handle_t
handle
;
obj_handle_t
event
;
char
__pad_20
[
4
];
};
struct
socket_get_events_reply
{
struct
reply_header
__header
;
unsigned
int
flags
;
/* VARARG(status,uints); */
char
__pad_12
[
4
];
};
struct
socket_send_icmp_id_request
{
struct
request_header
__header
;
...
...
@@ -5633,6 +5650,7 @@ enum request
REQ_unlock_file
,
REQ_recv_socket
,
REQ_send_socket
,
REQ_socket_get_events
,
REQ_socket_send_icmp_id
,
REQ_socket_get_icmp_id
,
REQ_get_next_console_request
,
...
...
@@ -5921,6 +5939,7 @@ union generic_request
struct
unlock_file_request
unlock_file_request
;
struct
recv_socket_request
recv_socket_request
;
struct
send_socket_request
send_socket_request
;
struct
socket_get_events_request
socket_get_events_request
;
struct
socket_send_icmp_id_request
socket_send_icmp_id_request
;
struct
socket_get_icmp_id_request
socket_get_icmp_id_request
;
struct
get_next_console_request_request
get_next_console_request_request
;
...
...
@@ -6207,6 +6226,7 @@ union generic_reply
struct
unlock_file_reply
unlock_file_reply
;
struct
recv_socket_reply
recv_socket_reply
;
struct
send_socket_reply
send_socket_reply
;
struct
socket_get_events_reply
socket_get_events_reply
;
struct
socket_send_icmp_id_reply
socket_send_icmp_id_reply
;
struct
socket_get_icmp_id_reply
socket_get_icmp_id_reply
;
struct
get_next_console_request_reply
get_next_console_request_reply
;
...
...
@@ -6436,7 +6456,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 7
79
#define SERVER_PROTOCOL_VERSION 7
80
/* ### protocol_version end ### */
...
...
server/protocol.def
View file @
0a33ac4a
...
...
@@ -1514,6 +1514,16 @@ enum server_fd_type
@END
/* Get socket event flags */
@REQ(socket_get_events)
obj_handle_t handle; /* socket handle */
obj_handle_t event; /* event to reset */
@REPLY
unsigned int flags; /* event mask */
VARARG(status,uints); /* array of status codes */
@END
/* Store ICMP id for ICMP over datagram fixup */
@REQ(socket_send_icmp_id)
obj_handle_t handle; /* socket handle */
...
...
server/request.h
View file @
0a33ac4a
...
...
@@ -175,6 +175,7 @@ DECL_HANDLER(lock_file);
DECL_HANDLER
(
unlock_file
);
DECL_HANDLER
(
recv_socket
);
DECL_HANDLER
(
send_socket
);
DECL_HANDLER
(
socket_get_events
);
DECL_HANDLER
(
socket_send_icmp_id
);
DECL_HANDLER
(
socket_get_icmp_id
);
DECL_HANDLER
(
get_next_console_request
);
...
...
@@ -462,6 +463,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(
req_handler
)
req_unlock_file
,
(
req_handler
)
req_recv_socket
,
(
req_handler
)
req_send_socket
,
(
req_handler
)
req_socket_get_events
,
(
req_handler
)
req_socket_send_icmp_id
,
(
req_handler
)
req_socket_get_icmp_id
,
(
req_handler
)
req_get_next_console_request
,
...
...
@@ -1085,6 +1087,11 @@ C_ASSERT( FIELD_OFFSET(struct send_socket_reply, wait) == 8 );
C_ASSERT
(
FIELD_OFFSET
(
struct
send_socket_reply
,
options
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
send_socket_reply
,
nonblocking
)
==
16
);
C_ASSERT
(
sizeof
(
struct
send_socket_reply
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
socket_get_events_request
,
handle
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
socket_get_events_request
,
event
)
==
16
);
C_ASSERT
(
sizeof
(
struct
socket_get_events_request
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
socket_get_events_reply
,
flags
)
==
8
);
C_ASSERT
(
sizeof
(
struct
socket_get_events_reply
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
socket_send_icmp_id_request
,
handle
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
socket_send_icmp_id_request
,
icmp_id
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
socket_send_icmp_id_request
,
icmp_seq
)
==
18
);
...
...
server/sock.c
View file @
0a33ac4a
...
...
@@ -2762,28 +2762,6 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
}
return
;
case
IOCTL_AFD_GET_EVENTS
:
{
struct
afd_get_events_params
params
=
{
0
};
unsigned
int
i
;
if
(
get_reply_max_size
()
<
sizeof
(
params
))
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
}
params
.
flags
=
sock
->
pending_events
&
sock
->
mask
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
params
.
status
);
++
i
)
params
.
status
[
i
]
=
sock_get_ntstatus
(
sock
->
errors
[
i
]
);
sock
->
pending_events
&=
~
sock
->
mask
;
sock_reselect
(
sock
);
set_reply_data
(
&
params
,
sizeof
(
params
)
);
return
;
}
case
IOCTL_AFD_EVENT_SELECT
:
{
struct
event
*
event
=
NULL
;
...
...
@@ -3937,6 +3915,32 @@ DECL_HANDLER(send_socket)
release_object
(
sock
);
}
DECL_HANDLER
(
socket_get_events
)
{
struct
sock
*
sock
=
(
struct
sock
*
)
get_handle_obj
(
current
->
process
,
req
->
handle
,
0
,
&
sock_ops
);
unsigned
int
status
[
13
];
unsigned
int
i
;
if
(
get_reply_max_size
()
<
sizeof
(
status
))
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
}
if
(
!
sock
)
return
;
reply
->
flags
=
sock
->
pending_events
&
sock
->
mask
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
status
);
++
i
)
status
[
i
]
=
sock_get_ntstatus
(
sock
->
errors
[
i
]
);
sock
->
pending_events
&=
~
sock
->
mask
;
sock_reselect
(
sock
);
set_reply_data
(
status
,
sizeof
(
status
)
);
release_object
(
sock
);
}
DECL_HANDLER
(
socket_send_icmp_id
)
{
struct
sock
*
sock
=
(
struct
sock
*
)
get_handle_obj
(
current
->
process
,
req
->
handle
,
0
,
&
sock_ops
);
...
...
server/trace.c
View file @
0a33ac4a
...
...
@@ -2089,6 +2089,18 @@ static void dump_send_socket_reply( const struct send_socket_reply *req )
fprintf
(
stderr
,
", nonblocking=%d"
,
req
->
nonblocking
);
}
static
void
dump_socket_get_events_request
(
const
struct
socket_get_events_request
*
req
)
{
fprintf
(
stderr
,
" handle=%04x"
,
req
->
handle
);
fprintf
(
stderr
,
", event=%04x"
,
req
->
event
);
}
static
void
dump_socket_get_events_reply
(
const
struct
socket_get_events_reply
*
req
)
{
fprintf
(
stderr
,
" flags=%08x"
,
req
->
flags
);
dump_varargs_uints
(
", status="
,
cur_size
);
}
static
void
dump_socket_send_icmp_id_request
(
const
struct
socket_send_icmp_id_request
*
req
)
{
fprintf
(
stderr
,
" handle=%04x"
,
req
->
handle
);
...
...
@@ -4623,6 +4635,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(
dump_func
)
dump_unlock_file_request
,
(
dump_func
)
dump_recv_socket_request
,
(
dump_func
)
dump_send_socket_request
,
(
dump_func
)
dump_socket_get_events_request
,
(
dump_func
)
dump_socket_send_icmp_id_request
,
(
dump_func
)
dump_socket_get_icmp_id_request
,
(
dump_func
)
dump_get_next_console_request_request
,
...
...
@@ -4907,6 +4920,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
NULL
,
(
dump_func
)
dump_recv_socket_reply
,
(
dump_func
)
dump_send_socket_reply
,
(
dump_func
)
dump_socket_get_events_reply
,
NULL
,
(
dump_func
)
dump_socket_get_icmp_id_reply
,
(
dump_func
)
dump_get_next_console_request_reply
,
...
...
@@ -5191,6 +5205,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"unlock_file"
,
"recv_socket"
,
"send_socket"
,
"socket_get_events"
,
"socket_send_icmp_id"
,
"socket_get_icmp_id"
,
"get_next_console_request"
,
...
...
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