Rizin
unix-like reverse engineering framework and cli tools
winsock.c
Go to the documentation of this file.
1 /* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to
5  * deal in the Software without restriction, including without limitation the
6  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7  * sell copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19  * IN THE SOFTWARE.
20  */
21 
22 #include <assert.h>
23 #include <stdlib.h>
24 
25 #include "uv.h"
26 #include "internal.h"
27 
28 
29 /* Whether there are any non-IFS LSPs stacked on TCP */
32 
33 /* Ip address used to bind to any port at any interface */
36 
37 
38 /*
39  * Retrieves the pointer to a winsock extension function.
40  */
41 static BOOL uv_get_extension_function(SOCKET socket, GUID guid,
42  void **target) {
43  int result;
44  DWORD bytes;
45 
46  result = WSAIoctl(socket,
47  SIO_GET_EXTENSION_FUNCTION_POINTER,
48  &guid,
49  sizeof(guid),
50  (void*)target,
51  sizeof(*target),
52  &bytes,
53  NULL,
54  NULL);
55 
56  if (result == SOCKET_ERROR) {
57  *target = NULL;
58  return FALSE;
59  } else {
60  return TRUE;
61  }
62 }
63 
64 
66  const GUID wsaid_acceptex = WSAID_ACCEPTEX;
67  return uv_get_extension_function(socket, wsaid_acceptex, (void**)target);
68 }
69 
70 
72  const GUID wsaid_connectex = WSAID_CONNECTEX;
73  return uv_get_extension_function(socket, wsaid_connectex, (void**)target);
74 }
75 
76 
77 
78 void uv_winsock_init(void) {
79  WSADATA wsa_data;
80  int errorno;
81  SOCKET dummy;
82  WSAPROTOCOL_INFOW protocol_info;
83  int opt_len;
84 
85  /* Set implicit binding address used by connectEx */
86  if (uv_ip4_addr("0.0.0.0", 0, &uv_addr_ip4_any_)) {
87  abort();
88  }
89 
90  if (uv_ip6_addr("::", 0, &uv_addr_ip6_any_)) {
91  abort();
92  }
93 
94  /* Skip initialization in safe mode without network support */
95  if (1 == GetSystemMetrics(SM_CLEANBOOT)) return;
96 
97  /* Initialize winsock */
98  errorno = WSAStartup(MAKEWORD(2, 2), &wsa_data);
99  if (errorno != 0) {
100  uv_fatal_error(errorno, "WSAStartup");
101  }
102 
103  /* Try to detect non-IFS LSPs */
105  dummy = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
106  if (dummy != INVALID_SOCKET) {
107  opt_len = (int) sizeof protocol_info;
108  if (getsockopt(dummy,
109  SOL_SOCKET,
110  SO_PROTOCOL_INFOW,
111  (char*) &protocol_info,
112  &opt_len) == 0) {
113  if (protocol_info.dwServiceFlags1 & XP1_IFS_HANDLES)
115  }
116  closesocket(dummy);
117  }
118 
119  /* Try to detect IPV6 support and non-IFS LSPs */
121  dummy = socket(AF_INET6, SOCK_STREAM, IPPROTO_IP);
122  if (dummy != INVALID_SOCKET) {
123  opt_len = (int) sizeof protocol_info;
124  if (getsockopt(dummy,
125  SOL_SOCKET,
126  SO_PROTOCOL_INFOW,
127  (char*) &protocol_info,
128  &opt_len) == 0) {
129  if (protocol_info.dwServiceFlags1 & XP1_IFS_HANDLES)
131  }
132  closesocket(dummy);
133  }
134 }
135 
136 
138  switch (status) {
139  case STATUS_SUCCESS:
140  return ERROR_SUCCESS;
141 
142  case STATUS_PENDING:
143  return ERROR_IO_PENDING;
144 
147  return WSAENOTSOCK;
148 
153  case STATUS_NO_MEMORY:
157  return WSAENOBUFS;
158 
162  return WSAEADDRINUSE;
163 
164  case STATUS_LINK_TIMEOUT:
165  case STATUS_IO_TIMEOUT:
166  case STATUS_TIMEOUT:
167  return WSAETIMEDOUT;
168 
170  return WSAEDISCON;
171 
174  case STATUS_LINK_FAILED:
178  return WSAECONNRESET;
179 
183  return WSAECONNABORTED;
184 
188  return WSAENETUNREACH;
189 
191  return WSAEHOSTUNREACH;
192 
193  case STATUS_CANCELLED:
195  return WSAEINTR;
196 
199  return WSAEMSGSIZE;
200 
203  return WSAEFAULT;
204 
207  return WSAEWOULDBLOCK;
208 
210  case STATUS_NETWORK_BUSY:
212  case STATUS_NO_SUCH_FILE:
216  return WSAENETDOWN;
217 
219  return WSAENOTCONN;
220 
223  return WSAECONNREFUSED;
224 
226  return WSAESHUTDOWN;
227 
231  return WSAEADDRNOTAVAIL;
232 
235  return WSAEOPNOTSUPP;
236 
238  return WSAEACCES;
239 
240  default:
241  if ((status & (FACILITY_NTWIN32 << 16)) == (FACILITY_NTWIN32 << 16) &&
242  (status & (ERROR_SEVERITY_ERROR | ERROR_SEVERITY_WARNING))) {
243  /* It's a windows error that has been previously mapped to an ntstatus
244  * code. */
245  return (DWORD) (status & 0xffff);
246  } else {
247  /* The default fallback for unmappable ntstatus codes. */
248  return WSAEINVAL;
249  }
250  }
251 }
252 
253 
254 /*
255  * This function provides a workaround for a bug in the winsock implementation
256  * of WSARecv. The problem is that when SetFileCompletionNotificationModes is
257  * used to avoid IOCP notifications of completed reads, WSARecv does not
258  * reliably indicate whether we can expect a completion package to be posted
259  * when the receive buffer is smaller than the received datagram.
260  *
261  * However it is desirable to use SetFileCompletionNotificationModes because
262  * it yields a massive performance increase.
263  *
264  * This function provides a workaround for that bug, but it only works for the
265  * specific case that we need it for. E.g. it assumes that the "avoid iocp"
266  * bit has been set, and supports only overlapped operation. It also requires
267  * the user to use the default msafd driver, doesn't work when other LSPs are
268  * stacked on top of it.
269  */
270 int WSAAPI uv_wsarecv_workaround(SOCKET socket, WSABUF* buffers,
271  DWORD buffer_count, DWORD* bytes, DWORD* flags, WSAOVERLAPPED *overlapped,
272  LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine) {
274  void* apc_context;
275  IO_STATUS_BLOCK* iosb = (IO_STATUS_BLOCK*) &overlapped->Internal;
277  DWORD error;
278 
279  if (overlapped == NULL || completion_routine != NULL) {
280  WSASetLastError(WSAEINVAL);
281  return SOCKET_ERROR;
282  }
283 
284  info.BufferArray = buffers;
285  info.BufferCount = buffer_count;
286  info.AfdFlags = AFD_OVERLAPPED;
287  info.TdiFlags = TDI_RECEIVE_NORMAL;
288 
289  if (*flags & MSG_PEEK) {
290  info.TdiFlags |= TDI_RECEIVE_PEEK;
291  }
292 
293  if (*flags & MSG_PARTIAL) {
294  info.TdiFlags |= TDI_RECEIVE_PARTIAL;
295  }
296 
297  if (!((intptr_t) overlapped->hEvent & 1)) {
298  apc_context = (void*) overlapped;
299  } else {
300  apc_context = NULL;
301  }
302 
303  iosb->Status = STATUS_PENDING;
304  iosb->Pointer = 0;
305 
307  overlapped->hEvent,
308  NULL,
309  apc_context,
310  iosb,
312  &info,
313  sizeof(info),
314  NULL,
315  0);
316 
317  *flags = 0;
318  *bytes = (DWORD) iosb->Information;
319 
320  switch (status) {
321  case STATUS_SUCCESS:
322  error = ERROR_SUCCESS;
323  break;
324 
325  case STATUS_PENDING:
326  error = WSA_IO_PENDING;
327  break;
328 
330  error = WSAEMSGSIZE;
331  break;
332 
334  error = ERROR_SUCCESS;
335  *flags = MSG_OOB;
336  break;
337 
339  error = ERROR_SUCCESS;
340  *flags = MSG_PARTIAL | MSG_OOB;
341  break;
342 
344  error = ERROR_SUCCESS;
345  *flags = MSG_PARTIAL;
346  break;
347 
348  default:
350  break;
351  }
352 
353  WSASetLastError(error);
354 
355  if (error == ERROR_SUCCESS) {
356  return 0;
357  } else {
358  return SOCKET_ERROR;
359  }
360 }
361 
362 
363 /* See description of uv_wsarecv_workaround. */
364 int WSAAPI uv_wsarecvfrom_workaround(SOCKET socket, WSABUF* buffers,
365  DWORD buffer_count, DWORD* bytes, DWORD* flags, struct sockaddr* addr,
366  int* addr_len, WSAOVERLAPPED *overlapped,
367  LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine) {
369  void* apc_context;
370  IO_STATUS_BLOCK* iosb = (IO_STATUS_BLOCK*) &overlapped->Internal;
372  DWORD error;
373 
374  if (overlapped == NULL || addr == NULL || addr_len == NULL ||
375  completion_routine != NULL) {
376  WSASetLastError(WSAEINVAL);
377  return SOCKET_ERROR;
378  }
379 
380  info.BufferArray = buffers;
381  info.BufferCount = buffer_count;
382  info.AfdFlags = AFD_OVERLAPPED;
383  info.TdiFlags = TDI_RECEIVE_NORMAL;
384  info.Address = addr;
385  info.AddressLength = addr_len;
386 
387  if (*flags & MSG_PEEK) {
388  info.TdiFlags |= TDI_RECEIVE_PEEK;
389  }
390 
391  if (*flags & MSG_PARTIAL) {
392  info.TdiFlags |= TDI_RECEIVE_PARTIAL;
393  }
394 
395  if (!((intptr_t) overlapped->hEvent & 1)) {
396  apc_context = (void*) overlapped;
397  } else {
398  apc_context = NULL;
399  }
400 
401  iosb->Status = STATUS_PENDING;
402  iosb->Pointer = 0;
403 
405  overlapped->hEvent,
406  NULL,
407  apc_context,
408  iosb,
410  &info,
411  sizeof(info),
412  NULL,
413  0);
414 
415  *flags = 0;
416  *bytes = (DWORD) iosb->Information;
417 
418  switch (status) {
419  case STATUS_SUCCESS:
420  error = ERROR_SUCCESS;
421  break;
422 
423  case STATUS_PENDING:
424  error = WSA_IO_PENDING;
425  break;
426 
428  error = WSAEMSGSIZE;
429  break;
430 
432  error = ERROR_SUCCESS;
433  *flags = MSG_OOB;
434  break;
435 
437  error = ERROR_SUCCESS;
438  *flags = MSG_PARTIAL | MSG_OOB;
439  break;
440 
442  error = ERROR_SUCCESS;
443  *flags = MSG_PARTIAL;
444  break;
445 
446  default:
448  break;
449  }
450 
451  WSASetLastError(error);
452 
453  if (error == ERROR_SUCCESS) {
454  return 0;
455  } else {
456  return SOCKET_ERROR;
457  }
458 }
459 
460 
461 int WSAAPI uv_msafd_poll(SOCKET socket, AFD_POLL_INFO* info_in,
462  AFD_POLL_INFO* info_out, OVERLAPPED* overlapped) {
463  IO_STATUS_BLOCK iosb;
464  IO_STATUS_BLOCK* iosb_ptr;
465  HANDLE event = NULL;
466  void* apc_context;
468  DWORD error;
469 
470  if (overlapped != NULL) {
471  /* Overlapped operation. */
472  iosb_ptr = (IO_STATUS_BLOCK*) &overlapped->Internal;
473  event = overlapped->hEvent;
474 
475  /* Do not report iocp completion if hEvent is tagged. */
476  if ((uintptr_t) event & 1) {
477  event = (HANDLE)((uintptr_t) event & ~(uintptr_t) 1);
478  apc_context = NULL;
479  } else {
480  apc_context = overlapped;
481  }
482 
483  } else {
484  /* Blocking operation. */
485  iosb_ptr = &iosb;
486  event = CreateEvent(NULL, FALSE, FALSE, NULL);
487  if (event == NULL) {
488  return SOCKET_ERROR;
489  }
490  apc_context = NULL;
491  }
492 
493  iosb_ptr->Status = STATUS_PENDING;
495  event,
496  NULL,
497  apc_context,
498  iosb_ptr,
500  info_in,
501  sizeof *info_in,
502  info_out,
503  sizeof *info_out);
504 
505  if (overlapped == NULL) {
506  /* If this is a blocking operation, wait for the event to become signaled,
507  * and then grab the real status from the io status block. */
508  if (status == STATUS_PENDING) {
509  DWORD r = WaitForSingleObject(event, INFINITE);
510 
511  if (r == WAIT_FAILED) {
512  DWORD saved_error = GetLastError();
513  CloseHandle(event);
514  WSASetLastError(saved_error);
515  return SOCKET_ERROR;
516  }
517 
518  status = iosb.Status;
519  }
520 
521  CloseHandle(event);
522  }
523 
524  switch (status) {
525  case STATUS_SUCCESS:
526  error = ERROR_SUCCESS;
527  break;
528 
529  case STATUS_PENDING:
530  error = WSA_IO_PENDING;
531  break;
532 
533  default:
535  break;
536  }
537 
538  WSASetLastError(error);
539 
540  if (error == ERROR_SUCCESS) {
541  return 0;
542  } else {
543  return SOCKET_ERROR;
544  }
545 }
546 
548  struct sockaddr_storage* storage) {
549  struct sockaddr_in* dest4;
550  struct sockaddr_in6* dest6;
551 
552  if (addr == NULL)
553  return UV_EINVAL;
554 
555  switch (addr->sa_family) {
556  case AF_INET:
557  dest4 = (struct sockaddr_in*) storage;
558  memcpy(dest4, addr, sizeof(*dest4));
559  if (dest4->sin_addr.s_addr == 0)
560  dest4->sin_addr.s_addr = htonl(INADDR_LOOPBACK);
561  return 0;
562  case AF_INET6:
563  dest6 = (struct sockaddr_in6*) storage;
564  memcpy(dest6, addr, sizeof(*dest6));
565  if (memcmp(&dest6->sin6_addr,
567  sizeof(uv_addr_ip6_any_.sin6_addr)) == 0) {
568  struct in6_addr init_sin6_addr = IN6ADDR_LOOPBACK_INIT;
569  dest6->sin6_addr = init_sin6_addr;
570  }
571  return 0;
572  default:
573  return UV_EINVAL;
574  }
575 }
static ut8 bytes[32]
Definition: asm_arc.c:23
RzBinInfo * info(RzBinFile *bf)
Definition: bin_ne.c:86
#define NULL
Definition: cris-opc.c:27
#define r
Definition: crypto_rc6.c:12
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd socket
Definition: sflib.h:79
void uv_fatal_error(const int errorno, const char *syscall)
Definition: error.c:35
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static const char struct stat static buf struct stat static buf static vhangup int status
Definition: sflib.h:145
#define TRUE
Definition: mybfd.h:103
#define FALSE
Definition: mybfd.h:102
static struct sockaddr static addrlen static backlog const void static flags void flags
Definition: sfsocketcall.h:123
static int
Definition: sfsocketcall.h:114
@ SOCK_STREAM
Definition: sftypes.h:224
#define SOL_SOCKET
Definition: sftypes.h:427
#define AF_INET
Definition: sftypes.h:287
#define AF_INET6
Definition: sftypes.h:295
_W64 unsigned int uintptr_t
_W64 signed int intptr_t
NTSTATUS Status
Definition: winapi.h:4165
ULONG_PTR Information
Definition: winapi.h:4168
in_addr_t s_addr
Definition: sftypes.h:337
struct in6_addr sin6_addr
Definition: sftypes.h:375
struct in_addr sin_addr
Definition: sftypes.h:344
void error(const char *msg)
Definition: untgz.c:593
UV_EXTERN int uv_ip4_addr(const char *ip, int port, struct sockaddr_in *addr)
Definition: uv-common.c:221
UV_EXTERN int uv_ip6_addr(const char *ip, int port, struct sockaddr_in6 *addr)
Definition: uv-common.c:232
LONG NTSTATUS
Definition: win.h:198
BOOL(PASCAL * LPFN_ACCEPTEX)(SOCKET sListenSocket, SOCKET sAcceptSocket, PVOID lpOutputBuffer, DWORD dwReceiveDataLength, DWORD dwLocalAddressLength, DWORD dwRemoteAddressLength, LPDWORD lpdwBytesReceived, LPOVERLAPPED lpOverlapped)
Definition: win.h:130
BOOL(PASCAL * LPFN_CONNECTEX)(SOCKET s, const struct sockaddr *name, int namelen, PVOID lpSendBuffer, DWORD dwSendDataLength, LPDWORD lpdwBytesSent, LPOVERLAPPED lpOverlapped)
Definition: win.h:140
#define WSAID_ACCEPTEX
Definition: win.h:109
#define WSAID_CONNECTEX
Definition: win.h:113
sNtDeviceIoControlFile pNtDeviceIoControlFile
Definition: winapi.c:31
#define STATUS_TIMEOUT
Definition: winapi.h:116
#define STATUS_PIPE_DISCONNECTED
Definition: winapi.h:1376
#define STATUS_INVALID_ADDRESS
Definition: winapi.h:1956
#define STATUS_INVALID_HANDLE
Definition: winapi.h:708
#define STATUS_QUOTA_EXCEEDED
Definition: winapi.h:944
#define STATUS_RECEIVE_EXPEDITED
Definition: winapi.h:356
#define STATUS_NETWORK_UNREACHABLE
Definition: winapi.h:2576
#define STATUS_DEVICE_NOT_READY
Definition: winapi.h:1324
#define STATUS_PROTOCOL_UNREACHABLE
Definition: winapi.h:2584
#define STATUS_ADDRESS_ALREADY_EXISTS
Definition: winapi.h:2376
#define STATUS_GRACEFUL_DISCONNECT
Definition: winapi.h:2556
#define STATUS_INVALID_BUFFER_SIZE
Definition: winapi.h:2360
#define STATUS_TRANSACTION_ABORTED
Definition: winapi.h:2396
#define STATUS_ACCESS_DENIED
Definition: winapi.h:812
#define STATUS_OBJECT_PATH_NOT_FOUND
Definition: winapi.h:904
#define STATUS_HOST_UNREACHABLE
Definition: winapi.h:2580
#define STATUS_WORKING_SET_QUOTA
Definition: winapi.h:1316
#define STATUS_REMOTE_DISCONNECT
Definition: winapi.h:1936
#define STATUS_INVALID_CONNECTION
Definition: winapi.h:1952
#define STATUS_PORT_UNREACHABLE
Definition: winapi.h:2588
#define STATUS_PENDING
Definition: winapi.h:120
#define STATUS_NETWORK_BUSY
Definition: winapi.h:1436
#define STATUS_IO_TIMEOUT
Definition: winapi.h:1396
#define STATUS_INVALID_NETWORK_RESPONSE
Definition: winapi.h:1452
#define STATUS_CONNECTION_RESET
Definition: winapi.h:2388
#define STATUS_NO_SUCH_DEVICE
Definition: winapi.h:732
#define STATUS_REQUEST_ABORTED
Definition: winapi.h:2592
#define STATUS_NO_MEMORY
Definition: winapi.h:768
#define STATUS_CONNECTION_ABORTED
Definition: winapi.h:2596
#define STATUS_NOT_SUPPORTED
Definition: winapi.h:1420
#define STATUS_BAD_NETWORK_PATH
Definition: winapi.h:1432
#define STATUS_CONNECTION_REFUSED
Definition: winapi.h:2552
#define STATUS_INVALID_ADDRESS_COMPONENT
Definition: winapi.h:2364
#define STATUS_ACCESS_VIOLATION
Definition: winapi.h:696
#define STATUS_NOT_IMPLEMENTED
Definition: winapi.h:684
#define STATUS_RECEIVE_PARTIAL
Definition: winapi.h:352
#define STATUS_CONNECTION_DISCONNECTED
Definition: winapi.h:2384
#define FACILITY_NTWIN32
Definition: winapi.h:48
#define STATUS_NO_SUCH_FILE
Definition: winapi.h:736
#define STATUS_LINK_TIMEOUT
Definition: winapi.h:1948
#define STATUS_CONFLICTING_ADDRESSES
Definition: winapi.h:772
#define STATUS_REMOTE_NOT_LISTENING
Definition: winapi.h:1424
#define STATUS_REMOTE_RESOURCES
Definition: winapi.h:1940
#define STATUS_LINK_FAILED
Definition: winapi.h:1944
#define STATUS_BUFFER_TOO_SMALL
Definition: winapi.h:816
#define STATUS_BUFFER_OVERFLOW
Definition: winapi.h:520
#define STATUS_UNEXPECTED_NETWORK_ERROR
Definition: winapi.h:1456
#define STATUS_HOPLIMIT_EXCEEDED
Definition: winapi.h:4024
#define STATUS_LOCAL_DISCONNECT
Definition: winapi.h:1932
#define STATUS_SHARING_VIOLATION
Definition: winapi.h:940
#define STATUS_SUCCESS
Definition: winapi.h:68
#define STATUS_RECEIVE_PARTIAL_EXPEDITED
Definition: winapi.h:360
#define STATUS_INSUFFICIENT_RESOURCES
Definition: winapi.h:1288
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: winapi.h:884
#define STATUS_CANCELLED
Definition: winapi.h:1824
#define STATUS_REQUEST_NOT_ACCEPTED
Definition: winapi.h:1504
#define STATUS_PAGEFILE_QUOTA
Definition: winapi.h:704
#define STATUS_TOO_MANY_ADDRESSES
Definition: winapi.h:2372
#define STATUS_TOO_MANY_PAGING_FILES
Definition: winapi.h:1276
#define STATUS_COMMITMENT_LIMIT
Definition: winapi.h:1876
#define STATUS_OBJECT_TYPE_MISMATCH
Definition: winapi.h:820
if(dbg->bits==RZ_SYS_BITS_64)
Definition: windows-arm64.h:4
DWORD * HANDLE
DWORD
int uv__convert_to_localhost_if_unspecified(const struct sockaddr *addr, struct sockaddr_storage *storage)
Definition: winsock.c:547
struct sockaddr_in uv_addr_ip4_any_
Definition: winsock.c:34
int WSAAPI uv_wsarecv_workaround(SOCKET socket, WSABUF *buffers, DWORD buffer_count, DWORD *bytes, DWORD *flags, WSAOVERLAPPED *overlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine)
Definition: winsock.c:270
BOOL uv_get_connectex_function(SOCKET socket, LPFN_CONNECTEX *target)
Definition: winsock.c:71
int WSAAPI uv_msafd_poll(SOCKET socket, AFD_POLL_INFO *info_in, AFD_POLL_INFO *info_out, OVERLAPPED *overlapped)
Definition: winsock.c:461
int WSAAPI uv_wsarecvfrom_workaround(SOCKET socket, WSABUF *buffers, DWORD buffer_count, DWORD *bytes, DWORD *flags, struct sockaddr *addr, int *addr_len, WSAOVERLAPPED *overlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine)
Definition: winsock.c:364
int uv_tcp_non_ifs_lsp_ipv4
Definition: winsock.c:30
int uv_tcp_non_ifs_lsp_ipv6
Definition: winsock.c:31
static BOOL uv_get_extension_function(SOCKET socket, GUID guid, void **target)
Definition: winsock.c:41
BOOL uv_get_acceptex_function(SOCKET socket, LPFN_ACCEPTEX *target)
Definition: winsock.c:65
void uv_winsock_init(void)
Definition: winsock.c:78
struct sockaddr_in6 uv_addr_ip6_any_
Definition: winsock.c:35
int uv_ntstatus_to_winsock_error(NTSTATUS status)
Definition: winsock.c:137
#define TDI_RECEIVE_PARTIAL
Definition: winsock.h:72
#define IOCTL_AFD_RECEIVE_DATAGRAM
Definition: winsock.h:151
#define AFD_OVERLAPPED
Definition: winsock.h:93
#define IOCTL_AFD_POLL
Definition: winsock.h:154
#define TDI_RECEIVE_PEEK
Definition: winsock.h:75
#define TDI_RECEIVE_NORMAL
Definition: winsock.h:73
#define IOCTL_AFD_RECEIVE
Definition: winsock.h:148
static int addr
Definition: z80asm.c:58