4 * Copyright 2020 Zebediah Figura for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_WINE_AFD_H
22 #define __WINE_WINE_AFD_H
27 #include "wine/server_protocol.h"
35 #define IOCTL_AFD_BIND CTL_CODE(FILE_DEVICE_BEEP, 0x800, METHOD_NEITHER, FILE_ANY_ACCESS)
36 #define IOCTL_AFD_LISTEN CTL_CODE(FILE_DEVICE_BEEP, 0x802, METHOD_NEITHER, FILE_ANY_ACCESS)
37 #define IOCTL_AFD_RECV CTL_CODE(FILE_DEVICE_BEEP, 0x805, METHOD_NEITHER, FILE_ANY_ACCESS)
38 #define IOCTL_AFD_POLL CTL_CODE(FILE_DEVICE_BEEP, 0x809, METHOD_BUFFERED, FILE_ANY_ACCESS)
39 #define IOCTL_AFD_GETSOCKNAME CTL_CODE(FILE_DEVICE_BEEP, 0x80b, METHOD_NEITHER, FILE_ANY_ACCESS)
40 #define IOCTL_AFD_EVENT_SELECT CTL_CODE(FILE_DEVICE_BEEP, 0x821, METHOD_NEITHER, FILE_ANY_ACCESS)
41 #define IOCTL_AFD_GET_EVENTS CTL_CODE(FILE_DEVICE_BEEP, 0x822, METHOD_NEITHER, FILE_ANY_ACCESS)
45 AFD_POLL_BIT_READ
= 0,
47 AFD_POLL_BIT_WRITE
= 2,
49 AFD_POLL_BIT_RESET
= 4,
50 AFD_POLL_BIT_CLOSE
= 5,
51 AFD_POLL_BIT_CONNECT
= 6,
52 AFD_POLL_BIT_ACCEPT
= 7,
53 AFD_POLL_BIT_CONNECT_ERR
= 8,
54 /* IOCTL_AFD_GET_EVENTS has space for 13 events. */
55 AFD_POLL_BIT_UNK1
= 9,
56 AFD_POLL_BIT_UNK2
= 10,
57 AFD_POLL_BIT_UNK3
= 11,
58 AFD_POLL_BIT_UNK4
= 12,
59 AFD_POLL_BIT_COUNT
= 13,
62 #define AFD_POLL_READ 0x0001
63 #define AFD_POLL_OOB 0x0002
64 #define AFD_POLL_WRITE 0x0004
65 #define AFD_POLL_HUP 0x0008
66 #define AFD_POLL_RESET 0x0010
67 #define AFD_POLL_CLOSE 0x0020
68 #define AFD_POLL_CONNECT 0x0040
69 #define AFD_POLL_ACCEPT 0x0080
70 #define AFD_POLL_CONNECT_ERR 0x0100
71 /* I have never seen these reported, but StarCraft Remastered polls for them. */
72 #define AFD_POLL_UNK1 0x0200
73 #define AFD_POLL_UNK2 0x0400
75 struct afd_bind_params
78 struct WS(sockaddr
) addr
; /* variable size */
81 struct afd_listen_params
88 #define AFD_RECV_FORCE_ASYNC 0x2
90 #define AFD_MSG_NOT_OOB 0x0020
91 #define AFD_MSG_OOB 0x0040
92 #define AFD_MSG_PEEK 0x0080
93 #define AFD_MSG_WAITALL 0x4000
95 struct afd_recv_params
97 const WSABUF
*buffers
;
103 #include <pshpack4.h>
104 struct afd_poll_params
119 struct afd_event_select_params
125 struct afd_event_select_params_64
131 struct afd_event_select_params_32
137 struct afd_get_events_params
143 #define IOCTL_AFD_WINE_CREATE CTL_CODE(FILE_DEVICE_NETWORK, 200, METHOD_BUFFERED, FILE_ANY_ACCESS)
144 #define IOCTL_AFD_WINE_ACCEPT CTL_CODE(FILE_DEVICE_NETWORK, 201, METHOD_BUFFERED, FILE_ANY_ACCESS)
145 #define IOCTL_AFD_WINE_ACCEPT_INTO CTL_CODE(FILE_DEVICE_NETWORK, 202, METHOD_BUFFERED, FILE_ANY_ACCESS)
146 #define IOCTL_AFD_WINE_CONNECT CTL_CODE(FILE_DEVICE_NETWORK, 203, METHOD_BUFFERED, FILE_ANY_ACCESS)
147 #define IOCTL_AFD_WINE_SHUTDOWN CTL_CODE(FILE_DEVICE_NETWORK, 204, METHOD_BUFFERED, FILE_ANY_ACCESS)
148 #define IOCTL_AFD_WINE_RECVMSG CTL_CODE(FILE_DEVICE_NETWORK, 205, METHOD_BUFFERED, FILE_ANY_ACCESS)
149 #define IOCTL_AFD_WINE_SENDMSG CTL_CODE(FILE_DEVICE_NETWORK, 206, METHOD_BUFFERED, FILE_ANY_ACCESS)
150 #define IOCTL_AFD_WINE_TRANSMIT CTL_CODE(FILE_DEVICE_NETWORK, 207, METHOD_BUFFERED, FILE_ANY_ACCESS)
151 #define IOCTL_AFD_WINE_ADDRESS_LIST_CHANGE CTL_CODE(FILE_DEVICE_NETWORK, 208, METHOD_BUFFERED, FILE_ANY_ACCESS)
152 #define IOCTL_AFD_WINE_FIONBIO CTL_CODE(FILE_DEVICE_NETWORK, 209, METHOD_BUFFERED, FILE_ANY_ACCESS)
153 #define IOCTL_AFD_WINE_COMPLETE_ASYNC CTL_CODE(FILE_DEVICE_NETWORK, 210, METHOD_BUFFERED, FILE_ANY_ACCESS)
154 #define IOCTL_AFD_WINE_FIONREAD CTL_CODE(FILE_DEVICE_NETWORK, 211, METHOD_BUFFERED, FILE_ANY_ACCESS)
155 #define IOCTL_AFD_WINE_SIOCATMARK CTL_CODE(FILE_DEVICE_NETWORK, 212, METHOD_BUFFERED, FILE_ANY_ACCESS)
156 #define IOCTL_AFD_WINE_GET_INTERFACE_LIST CTL_CODE(FILE_DEVICE_NETWORK, 213, METHOD_BUFFERED, FILE_ANY_ACCESS)
157 #define IOCTL_AFD_WINE_KEEPALIVE_VALS CTL_CODE(FILE_DEVICE_NETWORK, 214, METHOD_BUFFERED, FILE_ANY_ACCESS)
158 #define IOCTL_AFD_WINE_MESSAGE_SELECT CTL_CODE(FILE_DEVICE_NETWORK, 215, METHOD_BUFFERED, FILE_ANY_ACCESS)
159 #define IOCTL_AFD_WINE_GETPEERNAME CTL_CODE(FILE_DEVICE_NETWORK, 216, METHOD_BUFFERED, FILE_ANY_ACCESS)
160 #define IOCTL_AFD_WINE_DEFER CTL_CODE(FILE_DEVICE_NETWORK, 217, METHOD_BUFFERED, FILE_ANY_ACCESS)
161 #define IOCTL_AFD_WINE_GET_INFO CTL_CODE(FILE_DEVICE_NETWORK, 218, METHOD_BUFFERED, FILE_ANY_ACCESS)
162 #define IOCTL_AFD_WINE_GET_SO_ACCEPTCONN CTL_CODE(FILE_DEVICE_NETWORK, 219, METHOD_BUFFERED, FILE_ANY_ACCESS)
163 #define IOCTL_AFD_WINE_GET_SO_BROADCAST CTL_CODE(FILE_DEVICE_NETWORK, 220, METHOD_BUFFERED, FILE_ANY_ACCESS)
164 #define IOCTL_AFD_WINE_SET_SO_BROADCAST CTL_CODE(FILE_DEVICE_NETWORK, 221, METHOD_BUFFERED, FILE_ANY_ACCESS)
165 #define IOCTL_AFD_WINE_GET_SO_ERROR CTL_CODE(FILE_DEVICE_NETWORK, 222, METHOD_BUFFERED, FILE_ANY_ACCESS)
166 #define IOCTL_AFD_WINE_GET_SO_KEEPALIVE CTL_CODE(FILE_DEVICE_NETWORK, 223, METHOD_BUFFERED, FILE_ANY_ACCESS)
167 #define IOCTL_AFD_WINE_SET_SO_KEEPALIVE CTL_CODE(FILE_DEVICE_NETWORK, 224, METHOD_BUFFERED, FILE_ANY_ACCESS)
169 struct afd_create_params
171 int family
, type
, protocol
;
175 struct afd_accept_into_params
177 obj_handle_t accept_handle
;
178 unsigned int recv_len
, local_len
;
181 struct afd_connect_params
185 /* VARARG(addr, struct WS(sockaddr), addr_len); */
186 /* VARARG(data, bytes); */
189 struct afd_recvmsg_params
192 struct WS(sockaddr
) *addr
;
194 unsigned int *ws_flags
;
200 struct afd_sendmsg_params
202 const struct WS(sockaddr
) *addr
;
203 unsigned int addr_len
;
204 unsigned int ws_flags
;
207 const WSABUF
*buffers
;
210 struct afd_transmit_params
215 LARGE_INTEGER offset
;
216 TRANSMIT_FILE_BUFFERS buffers
;
220 struct afd_message_select_params
223 user_handle_t window
;
224 unsigned int message
;
228 struct afd_get_info_params
230 int family
, type
, protocol
;