ws2_32: Convert the Unix library to the __wine_unix_call interface.
[wine.git] / dlls / ws2_32 / ws2_32_private.h
blob5e2075b5c9c07790cd1ab147ce6f1178c22f6075
1 /*
2 * Copyright (C) 2021 Zebediah Figura for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_WS2_32_PRIVATE_H
20 #define __WINE_WS2_32_PRIVATE_H
22 #include <stdarg.h>
23 #include <stdio.h>
24 #include <string.h>
25 #include <limits.h>
27 #define NONAMELESSUNION
28 #define NONAMELESSSTRUCT
29 #include "ntstatus.h"
30 #define WIN32_NO_STATUS
31 #include "windef.h"
32 #include "winbase.h"
33 #include "wingdi.h"
34 #include "winuser.h"
35 #include "winerror.h"
36 #include "winnls.h"
37 #include "winsock2.h"
38 #include "mswsock.h"
39 #include "ws2tcpip.h"
40 #include "ws2spi.h"
41 #include "wsipx.h"
42 #include "wsnwlink.h"
43 #include "wshisotp.h"
44 #include "mstcpip.h"
45 #include "af_irda.h"
46 #include "winnt.h"
47 #define USE_WC_PREFIX /* For CMSG_DATA */
48 #include "iphlpapi.h"
49 #include "ip2string.h"
50 #include "wine/afd.h"
51 #include "wine/debug.h"
52 #include "wine/exception.h"
53 #include "wine/heap.h"
54 #include "wine/unixlib.h"
56 #define DECLARE_CRITICAL_SECTION(cs) \
57 static CRITICAL_SECTION cs; \
58 static CRITICAL_SECTION_DEBUG cs##_debug = \
59 { 0, 0, &cs, { &cs##_debug.ProcessLocksList, &cs##_debug.ProcessLocksList }, \
60 0, 0, { (DWORD_PTR)(__FILE__ ": " # cs) }}; \
61 static CRITICAL_SECTION cs = { &cs##_debug, -1, 0, 0, 0, 0 }
63 static const char magic_loopback_addr[] = {127, 12, 34, 56};
65 const char *debugstr_sockaddr( const struct sockaddr *addr ) DECLSPEC_HIDDEN;
67 struct per_thread_data
69 HANDLE sync_event; /* event to wait on for synchronous ioctls */
70 int opentype;
71 struct hostent *he_buffer;
72 struct servent *se_buffer;
73 struct protoent *pe_buffer;
74 int he_len;
75 int se_len;
76 int pe_len;
77 char ntoa_buffer[16]; /* 4*3 digits + 3 '.' + 1 '\0' */
80 extern int num_startup;
82 struct per_thread_data *get_per_thread_data(void) DECLSPEC_HIDDEN;
84 struct getaddrinfo_params
86 const char *node;
87 const char *service;
88 const struct WS(addrinfo) *hints;
89 struct WS(addrinfo) *info;
90 unsigned int *size;
93 struct gethostbyaddr_params
95 const void *addr;
96 int len;
97 int family;
98 struct WS(hostent) *host;
99 unsigned int *size;
102 struct gethostbyname_params
104 const char *name;
105 struct WS(hostent) *host;
106 unsigned int *size;
109 struct gethostname_params
111 char *name;
112 unsigned int size;
115 struct getnameinfo_params
117 const struct WS(sockaddr) *addr;
118 int addr_len;
119 char *host;
120 DWORD host_len;
121 char *serv;
122 DWORD serv_len;
123 int flags;
126 enum ws_unix_funcs
128 ws_unix_getaddrinfo,
129 ws_unix_gethostbyaddr,
130 ws_unix_gethostbyname,
131 ws_unix_gethostname,
132 ws_unix_getnameinfo,
135 extern unixlib_handle_t ws_unix_handle DECLSPEC_HIDDEN;
137 #endif