10#define AFD_MAX_EVENTS 10
11#define AFD_PACKET_COMMAND_LENGTH 15
12#define AfdCommand "AfdOpenPacketXX"
153#define AFD_ENDPOINT_CONNECTIONLESS 0x1
154#define AFD_ENDPOINT_MESSAGE_ORIENTED 0x10
155#define AFD_ENDPOINT_RAW 0x100
156#define AFD_ENDPOINT_MULTIPOINT 0x1000
157#define AFD_ENDPOINT_C_ROOT 0x10000
158#define AFD_ENDPOINT_D_ROOT 0x100000
161#define AFD_ADDRESS_HANDLE 0x1L
162#define AFD_CONNECTION_HANDLE 0x2L
165#define AFD_EVENT_RECEIVE_BIT 0
166#define AFD_EVENT_OOB_RECEIVE_BIT 1
167#define AFD_EVENT_SEND_BIT 2
168#define AFD_EVENT_DISCONNECT_BIT 3
169#define AFD_EVENT_ABORT_BIT 4
170#define AFD_EVENT_CLOSE_BIT 5
171#define AFD_EVENT_CONNECT_BIT 6
172#define AFD_EVENT_ACCEPT_BIT 7
173#define AFD_EVENT_CONNECT_FAIL_BIT 8
174#define AFD_EVENT_QOS_BIT 9
175#define AFD_EVENT_GROUP_QOS_BIT 10
176#define AFD_EVENT_ROUTING_INTERFACE_CHANGE_BIT 11
177#define AFD_EVENT_ADDRESS_LIST_CHANGE_BIT 12
178#define AFD_MAX_EVENT 13
179#define AFD_ALL_EVENTS ((1 << AFD_MAX_EVENT) - 1)
182#define AFD_INFO_INLINING_MODE 0x01L
183#define AFD_INFO_BLOCKING_MODE 0x02L
184#define AFD_INFO_SENDS_IN_PROGRESS 0x04L
185#define AFD_INFO_RECEIVE_WINDOW_SIZE 0x06L
186#define AFD_INFO_SEND_WINDOW_SIZE 0x07L
187#define AFD_INFO_GROUP_ID_TYPE 0x10L
188#define AFD_INFO_RECEIVE_CONTENT_SIZE 0x11L
191#define AFD_SHARE_UNIQUE 0x0L
192#define AFD_SHARE_REUSE 0x1L
193#define AFD_SHARE_WILDCARD 0x2L
194#define AFD_SHARE_EXCLUSIVE 0x3L
197#define AFD_DISCONNECT_SEND 0x01L
198#define AFD_DISCONNECT_RECV 0x02L
199#define AFD_DISCONNECT_ABORT 0x04L
200#define AFD_DISCONNECT_DATAGRAM 0x08L
203#define AFD_EVENT_RECEIVE (1 << AFD_EVENT_RECEIVE_BIT)
204#define AFD_EVENT_OOB_RECEIVE (1 << AFD_EVENT_OOB_RECEIVE_BIT)
205#define AFD_EVENT_SEND (1 << AFD_EVENT_SEND_BIT)
206#define AFD_EVENT_DISCONNECT (1 << AFD_EVENT_DISCONNECT_BIT)
207#define AFD_EVENT_ABORT (1 << AFD_EVENT_ABORT_BIT)
208#define AFD_EVENT_CLOSE (1 << AFD_EVENT_CLOSE_BIT)
209#define AFD_EVENT_CONNECT (1 << AFD_EVENT_CONNECT_BIT)
210#define AFD_EVENT_ACCEPT (1 << AFD_EVENT_ACCEPT_BIT)
211#define AFD_EVENT_CONNECT_FAIL (1 << AFD_EVENT_CONNECT_FAIL_BIT)
212#define AFD_EVENT_QOS (1 << AFD_EVENT_QOS_BIT)
213#define AFD_EVENT_GROUP_QOS (1 << AFD_EVENT_GROUP_QOS_BIT)
214#define AFD_EVENT_ROUTING_INTERFACE_CHANGE (1 << AFD_EVENT_ROUTING_INTERFACE_CHANGE_BIT)
215#define AFD_EVENT_ADDRESS_LIST_CHANGE (1 << AFD_EVENT_ADDRESS_LIST_CHANGE_BIT)
218#define AFD_SKIP_FIO 0x1L
219#define AFD_OVERLAPPED 0x2L
220#define AFD_IMMEDIATE 0x4L
223#define FSCTL_AFD_BASE FILE_DEVICE_NETWORK
224#define _AFD_CONTROL_CODE(Operation,Method) \
225 ((FSCTL_AFD_BASE)<<12 | (Operation<<2) | Method)
230#define AFD_START_LISTEN 2
231#define AFD_WAIT_FOR_LISTEN 3
234#define AFD_RECV_DATAGRAM 6
236#define AFD_SEND_DATAGRAM 8
238#define AFD_DISCONNECT 10
239#define AFD_GET_SOCK_NAME 11
240#define AFD_GET_PEER_NAME 12
241#define AFD_GET_TDI_HANDLES 13
242#define AFD_SET_INFO 14
243#define AFD_GET_CONTEXT_SIZE 15
244#define AFD_GET_CONTEXT 16
245#define AFD_SET_CONTEXT 17
246#define AFD_SET_CONNECT_DATA 18
247#define AFD_SET_CONNECT_OPTIONS 19
248#define AFD_SET_DISCONNECT_DATA 20
249#define AFD_SET_DISCONNECT_OPTIONS 21
250#define AFD_GET_CONNECT_DATA 22
251#define AFD_GET_CONNECT_OPTIONS 23
252#define AFD_GET_DISCONNECT_DATA 24
253#define AFD_GET_DISCONNECT_OPTIONS 25
254#define AFD_SET_CONNECT_DATA_SIZE 26
255#define AFD_SET_CONNECT_OPTIONS_SIZE 27
256#define AFD_SET_DISCONNECT_DATA_SIZE 28
257#define AFD_SET_DISCONNECT_OPTIONS_SIZE 29
258#define AFD_GET_INFO 30
259#define AFD_EVENT_SELECT 33
260#define AFD_ENUM_NETWORK_EVENTS 34
261#define AFD_DEFER_ACCEPT 35
262#define AFD_GET_PENDING_CONNECT_DATA 41
263#define AFD_VALIDATE_GROUP 42
267#define IOCTL_AFD_BIND \
268 _AFD_CONTROL_CODE(AFD_BIND, METHOD_NEITHER)
269#define IOCTL_AFD_CONNECT \
270 _AFD_CONTROL_CODE(AFD_CONNECT, METHOD_NEITHER)
271#define IOCTL_AFD_START_LISTEN \
272 _AFD_CONTROL_CODE(AFD_START_LISTEN, METHOD_NEITHER)
273#define IOCTL_AFD_WAIT_FOR_LISTEN \
274 _AFD_CONTROL_CODE(AFD_WAIT_FOR_LISTEN, METHOD_BUFFERED )
275#define IOCTL_AFD_ACCEPT \
276 _AFD_CONTROL_CODE(AFD_ACCEPT, METHOD_BUFFERED )
277#define IOCTL_AFD_RECV \
278 _AFD_CONTROL_CODE(AFD_RECV, METHOD_NEITHER)
279#define IOCTL_AFD_RECV_DATAGRAM \
280 _AFD_CONTROL_CODE(AFD_RECV_DATAGRAM, METHOD_NEITHER)
281#define IOCTL_AFD_SEND \
282 _AFD_CONTROL_CODE(AFD_SEND, METHOD_NEITHER)
283#define IOCTL_AFD_SEND_DATAGRAM \
284 _AFD_CONTROL_CODE(AFD_SEND_DATAGRAM, METHOD_NEITHER)
285#define IOCTL_AFD_SELECT \
286 _AFD_CONTROL_CODE(AFD_SELECT, METHOD_BUFFERED )
287#define IOCTL_AFD_DISCONNECT \
288 _AFD_CONTROL_CODE(AFD_DISCONNECT, METHOD_NEITHER)
289#define IOCTL_AFD_GET_SOCK_NAME \
290 _AFD_CONTROL_CODE(AFD_GET_SOCK_NAME, METHOD_NEITHER)
291#define IOCTL_AFD_GET_PEER_NAME \
292 _AFD_CONTROL_CODE(AFD_GET_PEER_NAME, METHOD_NEITHER)
293#define IOCTL_AFD_GET_TDI_HANDLES \
294 _AFD_CONTROL_CODE(AFD_GET_TDI_HANDLES, METHOD_NEITHER)
295#define IOCTL_AFD_SET_INFO \
296 _AFD_CONTROL_CODE(AFD_SET_INFO, METHOD_NEITHER)
297#define IOCTL_AFD_GET_CONTEXT_SIZE \
298 _AFD_CONTROL_CODE(AFD_GET_CONTEXT_SIZE, METHOD_NEITHER)
299#define IOCTL_AFD_GET_CONTEXT \
300 _AFD_CONTROL_CODE(AFD_GET_CONTEXT, METHOD_NEITHER)
301#define IOCTL_AFD_SET_CONTEXT \
302 _AFD_CONTROL_CODE(AFD_SET_CONTEXT, METHOD_NEITHER)
303#define IOCTL_AFD_SET_CONNECT_DATA \
304 _AFD_CONTROL_CODE(AFD_SET_CONNECT_DATA, METHOD_NEITHER)
305#define IOCTL_AFD_SET_CONNECT_OPTIONS \
306 _AFD_CONTROL_CODE(AFD_SET_CONNECT_OPTIONS, METHOD_NEITHER)
307#define IOCTL_AFD_SET_DISCONNECT_DATA \
308 _AFD_CONTROL_CODE(AFD_SET_DISCONNECT_DATA, METHOD_NEITHER)
309#define IOCTL_AFD_SET_DISCONNECT_OPTIONS \
310 _AFD_CONTROL_CODE(AFD_SET_DISCONNECT_OPTIONS, METHOD_NEITHER)
311#define IOCTL_AFD_GET_CONNECT_DATA \
312 _AFD_CONTROL_CODE(AFD_GET_CONNECT_DATA, METHOD_NEITHER)
313#define IOCTL_AFD_GET_CONNECT_OPTIONS \
314 _AFD_CONTROL_CODE(AFD_GET_CONNECT_OPTIONS, METHOD_NEITHER)
315#define IOCTL_AFD_GET_DISCONNECT_DATA \
316 _AFD_CONTROL_CODE(AFD_GET_DISCONNECT_DATA, METHOD_NEITHER)
317#define IOCTL_AFD_GET_DISCONNECT_OPTIONS \
318 _AFD_CONTROL_CODE(AFD_GET_DISCONNECT_OPTIONS, METHOD_NEITHER)
319#define IOCTL_AFD_SET_CONNECT_DATA_SIZE \
320 _AFD_CONTROL_CODE(AFD_SET_CONNECT_DATA_SIZE, METHOD_NEITHER)
321#define IOCTL_AFD_SET_CONNECT_OPTIONS_SIZE \
322 _AFD_CONTROL_CODE(AFD_SET_CONNECT_OPTIONS_SIZE, METHOD_NEITHER)
323#define IOCTL_AFD_SET_DISCONNECT_DATA_SIZE \
324 _AFD_CONTROL_CODE(AFD_SET_DISCONNECT_DATA_SIZE, METHOD_NEITHER)
325#define IOCTL_AFD_SET_DISCONNECT_OPTIONS_SIZE \
326 _AFD_CONTROL_CODE(AFD_SET_DISCONNECT_OPTIONS_SIZE, METHOD_NEITHER)
327#define IOCTL_AFD_GET_INFO \
328 _AFD_CONTROL_CODE(AFD_GET_INFO, METHOD_NEITHER)
329#define IOCTL_AFD_EVENT_SELECT \
330 _AFD_CONTROL_CODE(AFD_EVENT_SELECT, METHOD_NEITHER)
331#define IOCTL_AFD_DEFER_ACCEPT \
332 _AFD_CONTROL_CODE(AFD_DEFER_ACCEPT, METHOD_NEITHER)
333#define IOCTL_AFD_GET_PENDING_CONNECT_DATA \
334 _AFD_CONTROL_CODE(AFD_GET_PENDING_CONNECT_DATA, METHOD_NEITHER)
335#define IOCTL_AFD_ENUM_NETWORK_EVENTS \
336 _AFD_CONTROL_CODE(AFD_ENUM_NETWORK_EVENTS, METHOD_NEITHER)
337#define IOCTL_AFD_VALIDATE_GROUP \
338 _AFD_CONTROL_CODE(AFD_VALIDATE_GROUP, METHOD_NEITHER)
struct _FILE_REPLY_SEND FILE_REPLY_SEND
struct _FILE_REPLY_BIND * PFILE_REPLY_BIND
struct _AFD_BIND_DATA * PAFD_BIND_DATA
struct _AFD_PENDING_ACCEPT_DATA AFD_PENDING_ACCEPT_DATA
struct _AFD_RECV_INFO * PAFD_RECV_INFO
struct _AFD_RECV_INFO_UDP * PAFD_RECV_INFO_UDP
struct _AFD_SEND_INFO_UDP AFD_SEND_INFO_UDP
struct _FILE_REQUEST_BIND FILE_REQUEST_BIND
struct _AFD_POLL_INFO * PAFD_POLL_INFO
struct _AFD_ACCEPT_DATA AFD_ACCEPT_DATA
struct _AFD_ENUM_NETWORK_EVENTS_INFO * PAFD_ENUM_NETWORK_EVENTS_INFO
struct _AFD_CREATE_PACKET * PAFD_CREATE_PACKET
struct _AFD_BIND_DATA AFD_BIND_DATA
struct _AFD_DISCONNECT_INFO AFD_DISCONNECT_INFO
struct _FILE_REQUEST_LISTEN FILE_REQUEST_LISTEN
struct _AFD_CONNECT_INFO * PAFD_CONNECT_INFO
struct _FILE_REPLY_LISTEN * PFILE_REPLY_LISTEN
struct _AFD_INFO AFD_INFO
struct _AFD_RECEIVED_ACCEPT_DATA AFD_RECEIVED_ACCEPT_DATA
struct _FILE_REQUEST_CONNECT FILE_REQUEST_CONNECT
struct _AFD_SOCKET_INFORMATION AFD_SOCKET_INFORMATION
struct _AFD_SEND_INFO_UDP * PAFD_SEND_INFO_UDP
struct _FILE_REPLY_SEND * PFILE_REPLY_SEND
struct _FILE_REPLY_LISTEN FILE_REPLY_LISTEN
struct _AFD_POLL_INFO AFD_POLL_INFO
struct _FILE_REQUEST_CONNECT * PFILE_REQUEST_CONNECT
struct _FILE_REQUEST_RECVFROM FILE_REQUEST_RECVFROM
struct _AFD_TDI_HANDLE_DATA * PAFD_TDI_HANDLE_DATA
struct _FILE_REPLY_RECV FILE_REPLY_RECV
struct _FILE_REQUEST_SEND * PFILE_REQUEST_SEND
struct _AFD_RECEIVED_ACCEPT_DATA * PAFD_RECEIVED_ACCEPT_DATA
struct _AFD_DEFER_ACCEPT_DATA AFD_DEFER_ACCEPT_DATA
struct _AFD_PENDING_ACCEPT_DATA * PAFD_PENDING_ACCEPT_DATA
struct _AFD_VALIDATE_GROUP_DATA AFD_VALIDATE_GROUP_DATA
struct _FILE_REQUEST_SEND FILE_REQUEST_SEND
struct _AFD_HANDLE_ AFD_HANDLE
struct _AFD_DEFER_ACCEPT_DATA * PAFD_DEFER_ACCEPT_DATA
struct _FILE_REQUEST_ACCEPT * PFILE_REQUEST_ACCEPT
struct _AFD_SEND_INFO * PAFD_SEND_INFO
struct _FILE_REPLY_ACCEPT FILE_REPLY_ACCEPT
struct _AFD_LISTEN_DATA AFD_LISTEN_DATA
struct _AFD_TDI_HANDLE_DATA AFD_TDI_HANDLE_DATA
struct _FILE_REPLY_RECVFROM FILE_REPLY_RECVFROM
struct _AFD_WSABUF AFD_WSABUF
struct _AFD_EVENT_SELECT_INFO AFD_EVENT_SELECT_INFO
struct _AFD_VALIDATE_GROUP_DATA * PAFD_VALIDATE_GROUP_DATA
struct _AFD_SEND_INFO AFD_SEND_INFO
struct _AFD_SOCKET_INFORMATION * PAFD_SOCKET_INFORMATION
struct _FILE_REQUEST_ACCEPT FILE_REQUEST_ACCEPT
struct _FILE_REQUEST_RECV * PFILE_REQUEST_RECV
struct _FILE_REPLY_SENDTO FILE_REPLY_SENDTO
struct _FILE_REPLY_CONNECT * PFILE_REPLY_CONNECT
struct _AFD_RECV_INFO_UDP AFD_RECV_INFO_UDP
struct _AFD_LISTEN_DATA * PAFD_LISTEN_DATA
struct _FILE_REPLY_RECVFROM * PFILE_REPLY_RECVFROM
struct _FILE_REPLY_BIND FILE_REPLY_BIND
struct _AFD_CONNECT_INFO AFD_CONNECT_INFO
struct _AFD_CREATE_PACKET AFD_CREATE_PACKET
struct _AFD_HANDLE_ * PAFD_HANDLE
struct _AFD_ACCEPT_DATA * PAFD_ACCEPT_DATA
struct _FILE_REPLY_CONNECT FILE_REPLY_CONNECT
struct _FILE_REPLY_RECV * PFILE_REPLY_RECV
struct _FILE_REPLY_SENDTO * PFILE_REPLY_SENDTO
struct _FILE_REQUEST_SENDTO FILE_REQUEST_SENDTO
struct _AFD_INFO * PAFD_INFO
struct _AFD_DISCONNECT_INFO * PAFD_DISCONNECT_INFO
struct _AFD_WSABUF * PAFD_WSABUF
struct _AFD_RECV_INFO AFD_RECV_INFO
struct _AFD_EVENT_SELECT_INFO * PAFD_EVENT_SELECT_INFO
struct _FILE_REQUEST_RECVFROM * PFILE_REQUEST_RECVFROM
struct _AFD_ENUM_NETWORK_EVENTS_INFO AFD_ENUM_NETWORK_EVENTS_INFO
struct _FILE_REPLY_ACCEPT * PFILE_REPLY_ACCEPT
struct _FILE_REQUEST_RECV FILE_REQUEST_RECV
struct _FILE_REQUEST_LISTEN * PFILE_REQUEST_LISTEN
struct _FILE_REQUEST_BIND * PFILE_REQUEST_BIND
struct _FILE_REQUEST_SENDTO * PFILE_REQUEST_SENDTO
TRANSPORT_ADDRESS Address
TRANSPORT_ADDRESS RemoteAddress
DWORD SizeOfTransportName
NTSTATUS EventStatus[AFD_MAX_EVENTS]
union _AFD_INFO::@3376 Information
LARGE_INTEGER LargeInteger
BOOLEAN UseDelayedAcceptance
TRANSPORT_ADDRESS Address
TDI_CONNECTION_INFORMATION TdiConnection
TDI_REQUEST_SEND_DATAGRAM TdiRequest
HANDLE TdiConnectionHandle
TRANSPORT_ADDRESS Address
HANDLE TdiConnectionObjectHandle
HANDLE TdiAddressObjectHandle
LPCONDITIONPROC lpfnCondition
int(CALLBACK * LPCONDITIONPROC)(IN LPWSABUF lpCallerId, IN LPWSABUF lpCallerData, IN OUT LPQOS lpSQOS, IN OUT LPQOS lpGQOS, IN LPWSABUF lpCalleeId, IN LPWSABUF lpCalleeData, OUT GROUP FAR *g, IN DWORD_PTR dwCallbackData)