1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
#![cfg(windows)]
extern crate winapi;
use winapi::*;
extern "system" {
pub fn FreeAddrInfoEx(pAddrInfoEx: PADDRINFOEXA);
pub fn FreeAddrInfoExW(pAddrInfoEx: PADDRINFOEXW);
pub fn FreeAddrInfoW(pAddrInfo: PADDRINFOW);
pub fn GetAddrInfoExA(
pName: PCSTR, pServiceName: PCSTR, dwNameSpace: DWORD, lpNspId: LPGUID,
hints: *const ADDRINFOEXA, ppResult: *mut PADDRINFOEXA, timeout: *mut timeval,
lpOverlapped: LPOVERLAPPED, lpCompletionRoutine: LPLOOKUPSERVICE_COMPLETION_ROUTINE,
lpNameHandle: LPHANDLE,
) -> INT;
pub fn GetAddrInfoExCancel(lpHandle: LPHANDLE) -> INT;
pub fn GetAddrInfoExOverlappedResult(lpOverlapped: LPOVERLAPPED) -> INT;
pub fn GetAddrInfoExW(
pName: PCWSTR, pServiceName: PCWSTR, dwNameSpace: DWORD, lpNspId: LPGUID,
hints: *const ADDRINFOEXW, ppResult: *mut PADDRINFOEXW, timeout: *mut timeval,
lpOverlapped: LPOVERLAPPED, lpCompletionRoutine: LPLOOKUPSERVICE_COMPLETION_ROUTINE,
lpNameHandle: LPHANDLE,
) -> INT;
pub fn GetAddrInfoW(
pNodeName: PCWSTR, pServiceName: PCWSTR, pHints: *const ADDRINFOW,
ppResult: *mut PADDRINFOW,
) -> INT;
pub fn GetHostNameW(name: PWSTR, namelen: c_int) -> c_int;
pub fn GetNameInfoW(
pSockaddr: *const SOCKADDR, SockaddrLength: socklen_t, pNodeBuffer: PWCHAR,
NodeBufferSize: DWORD, pServiceBuffer: PWCHAR, ServiceBufferSize: DWORD, Flags: INT,
) -> INT;
pub fn InetNtopW(Family: INT, pAddr: PVOID, pStringBuf: PWSTR, StringBufSize: size_t) -> PCWSTR;
pub fn InetPtonW(Family: INT, pszAddrString: PCWSTR, pAddrBuf: PVOID) -> INT;
pub fn SetAddrInfoExA(
pName: PCSTR, pServiceName: PCSTR, pAddresses: *mut SOCKET_ADDRESS, dwAddressCount: DWORD,
lpBlob: LPBLOB, dwFlags: DWORD, dwNameSpace: DWORD, lpNspId: LPGUID, timeout: *mut timeval,
lpOverlapped: LPOVERLAPPED, lpCompletionRoutine: LPLOOKUPSERVICE_COMPLETION_ROUTINE,
lpNameHandle: LPHANDLE,
) -> INT;
pub fn SetAddrInfoExW(
pName: PCWSTR, pServiceName: PCWSTR, pAddresses: *mut SOCKET_ADDRESS, dwAddressCount: DWORD,
lpBlob: LPBLOB, dwFlags: DWORD, dwNameSpace: DWORD, lpNspId: LPGUID, timeout: *mut timeval,
lpOverlapped: LPOVERLAPPED, lpCompletionRoutine: LPLOOKUPSERVICE_COMPLETION_ROUTINE,
lpNameHandle: LPHANDLE,
) -> INT;
pub fn WPUCompleteOverlappedRequest(
s: SOCKET, lpOverlapped: LPWSAOVERLAPPED, dwError: DWORD, cbTransferred: DWORD,
lpErrno: LPINT,
) -> c_int;
pub fn WSAAccept(
s: SOCKET, addr: *mut SOCKADDR, addrlen: LPINT, lpfnCondition: LPCONDITIONPROC,
dwCallbackData: DWORD_PTR,
) -> SOCKET;
pub fn WSAAddressToStringA(
lpsaAddress: LPSOCKADDR, dwAddressLength: DWORD, lpProtocolInfo: LPWSAPROTOCOL_INFOA,
lpszAddressString: LPSTR, lpdwAddressStringLength: LPDWORD,
) -> INT;
pub fn WSAAddressToStringW(
lpsaAddress: LPSOCKADDR, dwAddressLength: DWORD, lpProtocolInfo: LPWSAPROTOCOL_INFOW,
lpszAddressString: LPWSTR, lpdwAddressStringLength: LPDWORD,
) -> INT;
pub fn WSAAdvertiseProvider(
puuidProviderId: *const GUID, pNSPv2Routine: *const LPCNSPV2_ROUTINE,
) -> INT;
pub fn WSAAsyncGetHostByAddr(
hWnd: HWND, wMsg: u_int, addr: *const c_char, len: c_int, _type: c_int, buf: *mut c_char,
buflen: c_int,
) -> HANDLE;
pub fn WSAAsyncGetHostByName(
hWnd: HWND, wMsg: u_int, name: *const c_char, buf: *mut c_char, buflen: c_int,
) -> HANDLE;
pub fn WSAAsyncGetProtoByName(
hWnd: HWND, wMsg: u_int, name: *const c_char, buf: *mut c_char, buflen: c_int,
) -> HANDLE;
pub fn WSAAsyncGetProtoByNumber(
hWnd: HWND, wMsg: u_int, number: c_int, buf: *mut c_char, buflen: c_int,
) -> HANDLE;
pub fn WSAAsyncGetServByName(
hWnd: HWND, wMsg: u_int, name: *const c_char, proto: *const c_char, buf: *mut c_char,
buflen: c_int,
) -> HANDLE;
pub fn WSAAsyncGetServByPort(
hWnd: HWND, wMsg: u_int, port: c_int, proto: *const c_char, buf: *mut c_char, buflen: c_int,
) -> HANDLE;
pub fn WSAAsyncSelect(s: SOCKET, hWnd: HWND, wMsg: u_int, lEvent: c_long) -> c_int;
pub fn WSACancelAsyncRequest(hAsyncTaskHandle: HANDLE) -> c_int;
pub fn WSACancelBlockingCall() -> c_int;
pub fn WSACleanup() -> c_int;
pub fn WSACloseEvent(hEvent: WSAEVENT) -> BOOL;
pub fn WSAConnect(
s: SOCKET, name: *const SOCKADDR, namelen: c_int, lpCallerData: LPWSABUF,
lpCalleeData: LPWSABUF, lpSQOS: LPQOS, lpGQOS: LPQOS,
) -> c_int;
pub fn WSAConnectByList(
s: SOCKET, SocketAddress: PSOCKET_ADDRESS_LIST, LocalAddressLength: LPDWORD,
LocalAddress: LPSOCKADDR, RemoteAddressLength: LPDWORD, RemoteAddress: LPSOCKADDR,
timeout: *const timeval, Reserved: LPWSAOVERLAPPED,
) -> BOOL;
pub fn WSAConnectByNameA(
s: SOCKET, nodename: LPCSTR, servicename: LPCSTR, LocalAddressLength: LPDWORD,
LocalAddress: LPSOCKADDR, RemoteAddressLength: LPDWORD, RemoteAddress: LPSOCKADDR,
timeout: *const timeval, Reserved: LPWSAOVERLAPPED,
) -> BOOL;
pub fn WSAConnectByNameW(
s: SOCKET, nodename: LPWSTR, servicename: LPWSTR, LocalAddressLength: LPDWORD,
LocalAddress: LPSOCKADDR, RemoteAddressLength: LPDWORD, RemoteAddress: LPSOCKADDR,
timeout: *const timeval, Reserved: LPWSAOVERLAPPED,
) -> BOOL;
pub fn WSACreateEvent() -> WSAEVENT;
pub fn WSADuplicateSocketA(
s: SOCKET, dwProcessId: DWORD, lpProtocolInfo: LPWSAPROTOCOL_INFOA,
) -> c_int;
pub fn WSADuplicateSocketW(
s: SOCKET, dwProcessId: DWORD, lpProtocolInfo: LPWSAPROTOCOL_INFOW,
) -> c_int;
pub fn WSAEnumNameSpaceProvidersA(
lpdwBufferLength: LPDWORD, lpnspBuffer: LPWSANAMESPACE_INFOA,
) -> INT;
pub fn WSAEnumNameSpaceProvidersExA(
lpdwBufferLength: LPDWORD, lpnspBuffer: LPWSANAMESPACE_INFOEXA,
) -> INT;
pub fn WSAEnumNameSpaceProvidersExW(
lpdwBufferLength: LPDWORD, lpnspBuffer: LPWSANAMESPACE_INFOEXW,
) -> INT;
pub fn WSAEnumNameSpaceProvidersW(
lpdwBufferLength: LPDWORD, lpnspBuffer: LPWSANAMESPACE_INFOW,
) -> INT;
pub fn WSAEnumNetworkEvents(
s: SOCKET, hEventObject: WSAEVENT, lpNetworkEvents: LPWSANETWORKEVENTS,
) -> c_int;
pub fn WSAEnumProtocolsA(
lpiProtocols: LPINT, lpProtocolBuffer: LPWSAPROTOCOL_INFOA, lpdwBufferLength: LPDWORD,
) -> c_int;
pub fn WSAEnumProtocolsW(
lpiProtocols: LPINT, lpProtocolBuffer: LPWSAPROTOCOL_INFOW, lpdwBufferLength: LPDWORD,
) -> c_int;
pub fn WSAEventSelect(s: SOCKET, hEventObject: WSAEVENT, lNetworkEvents: c_long) -> c_int;
pub fn WSAGetLastError() -> c_int;
pub fn WSAGetOverlappedResult(
s: SOCKET, lpOverlapped: LPWSAOVERLAPPED, lpcbTransfer: LPDWORD, fWait: BOOL,
lpdwFlags: LPDWORD,
) -> BOOL;
pub fn WSAGetQOSByName(s: SOCKET, lpQOSName: LPWSABUF, lpQOS: LPQOS) -> BOOL;
pub fn WSAGetServiceClassInfoA(
lpProviderId: LPGUID, lpServiceClassId: LPGUID, lpdwBufSize: LPDWORD,
lpServiceClassInfo: LPWSASERVICECLASSINFOA,
) -> INT;
pub fn WSAGetServiceClassInfoW(
lpProviderId: LPGUID, lpServiceClassId: LPGUID, lpdwBufSize: LPDWORD,
lpServiceClassInfo: LPWSASERVICECLASSINFOW,
) -> INT;
pub fn WSAGetServiceClassNameByClassIdA(
lpServiceClassId: LPGUID, lpszServiceClassName: LPSTR, lpdwBufferLength: LPDWORD,
) -> INT;
pub fn WSAGetServiceClassNameByClassIdW(
lpServiceClassId: LPGUID, lpszServiceClassName: LPWSTR, lpdwBufferLength: LPDWORD,
) -> INT;
pub fn WSAHtonl(s: SOCKET, hostlong: u_long, lpnetlong: *mut u_long) -> c_int;
pub fn WSAHtons(s: SOCKET, hostshort: u_short, lpnetshort: *mut u_short) -> c_int;
pub fn WSAInstallServiceClassA(lpServiceClassInfo: LPWSASERVICECLASSINFOA) -> INT;
pub fn WSAInstallServiceClassW(lpServiceClassInfo: LPWSASERVICECLASSINFOW) -> INT;
pub fn WSAIoctl(
s: SOCKET, dwIoControlCode: DWORD, lpvInBuffer: LPVOID, cbInBuffer: DWORD,
lpvOutBuffer: LPVOID, cbOutBuffer: DWORD, lpcbBytesReturned: LPDWORD,
lpOverlapped: LPWSAOVERLAPPED, lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE,
) -> c_int;
pub fn WSAIsBlocking() -> BOOL;
pub fn WSAJoinLeaf(
s: SOCKET, name: *const SOCKADDR, namelen: c_int, lpCallerData: LPWSABUF,
lpCalleeData: LPWSABUF, lpSQOS: LPQOS, lpGQOS: LPQOS, dwFlags: DWORD,
) -> SOCKET;
pub fn WSALookupServiceBeginA(
lpqsRestrictions: LPWSAQUERYSETA, dwControlFlags: DWORD, lphLookup: LPHANDLE,
) -> INT;
pub fn WSALookupServiceBeginW(
lpqsRestrictions: LPWSAQUERYSETW, dwControlFlags: DWORD, lphLookup: LPHANDLE,
) -> INT;
pub fn WSALookupServiceEnd(hLookup: HANDLE) -> INT;
pub fn WSALookupServiceNextA(
hLookup: HANDLE, dwControlFlags: DWORD, lpdwBufferLength: LPDWORD,
lpqsResults: LPWSAQUERYSETA,
) -> INT;
pub fn WSALookupServiceNextW(
hLookup: HANDLE, dwControlFlags: DWORD, lpdwBufferLength: LPDWORD,
lpqsResults: LPWSAQUERYSETW,
) -> INT;
pub fn WSANSPIoctl(
hLookup: HANDLE, dwControlFlags: DWORD, lpvInBuffer: LPVOID, cbInBuffer: DWORD,
lpvOutBuffer: LPVOID, cbOutBuffer: DWORD, lpcbBytesReturned: LPDWORD,
lpCompletion: LPWSACOMPLETION,
) -> INT;
pub fn WSANtohl(s: SOCKET, netlong: u_long, lphostlong: *mut c_long) -> c_int;
pub fn WSANtohs(s: SOCKET, netshort: u_short, lphostshort: *mut c_short) -> c_int;
pub fn WSAPoll(fdArray: LPWSAPOLLFD, fds: ULONG, timeout: INT) -> c_int;
pub fn WSAProviderCompleteAsyncCall(hAsyncCall: HANDLE, iRetCode: INT) -> INT;
pub fn WSAProviderConfigChange(
lpNotificationHandle: LPHANDLE, lpOverlapped: LPWSAOVERLAPPED,
lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE,
) -> INT;
pub fn WSARecv(
s: SOCKET, lpBuffers: LPWSABUF, dwBufferCount: DWORD, lpNumberOfBytesRecvd: LPDWORD,
lpFlags: LPDWORD, lpOverlapped: LPWSAOVERLAPPED,
lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE,
) -> c_int;
pub fn WSARecvDisconnect(s: SOCKET, lpInboundDisconnectData: LPWSABUF) -> c_int;
pub fn WSARecvFrom(
s: SOCKET, lpBuffers: LPWSABUF, dwBufferCount: DWORD, lpNumberOfBytesRecvd: LPDWORD,
lpFlags: LPDWORD, lpFrom: *mut SOCKADDR, lpFromlen: LPINT, lpOverlapped: LPWSAOVERLAPPED,
lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE,
) -> c_int;
pub fn WSARemoveServiceClass(lpServiceClassId: LPGUID) -> INT;
pub fn WSAResetEvent(hEvent: WSAEVENT) -> BOOL;
pub fn WSASend(
s: SOCKET, lpBuffers: LPWSABUF, dwBufferCount: DWORD, lpNumberOfBytesSent: LPDWORD,
dwFlags: DWORD, lpOverlapped: LPWSAOVERLAPPED,
lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE,
) -> c_int;
pub fn WSASendDisconnect(s: SOCKET, lpOutboundDisconnectData: LPWSABUF) -> c_int;
pub fn WSASendMsg(
Handle: SOCKET, lpMsg: LPWSAMSG, dwFlags: DWORD, lpNumberOfBytesSent: LPDWORD,
lpOverlapped: LPWSAOVERLAPPED, lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE,
) -> c_int;
pub fn WSASendTo(
s: SOCKET, lpBuffers: LPWSABUF, dwBufferCount: DWORD, lpNumberOfBytesSent: LPDWORD,
dwFlags: DWORD, lpTo: *const SOCKADDR, iToLen: c_int, lpOverlapped: LPWSAOVERLAPPED,
lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE,
) -> c_int;
pub fn WSASetBlockingHook(lpBlockFunc: FARPROC) -> FARPROC;
pub fn WSASetEvent(hEvent: WSAEVENT) -> BOOL;
pub fn WSASetLastError(iError: c_int);
pub fn WSASetServiceA(
lpqsRegInfo: LPWSAQUERYSETA, essoperation: WSAESETSERVICEOP, dwControlFlags: DWORD,
) -> INT;
pub fn WSASetServiceW(
lpqsRegInfo: LPWSAQUERYSETW, essoperation: WSAESETSERVICEOP, dwControlFlags: DWORD,
) -> INT;
pub fn WSASocketA(
af: c_int, _type: c_int, protocol: c_int, lpProtocolInfo: LPWSAPROTOCOL_INFOA, g: GROUP,
dwFlags: DWORD,
) -> SOCKET;
pub fn WSASocketW(
af: c_int, _type: c_int, protocol: c_int, lpProtocolInfo: LPWSAPROTOCOL_INFOW, g: GROUP,
dwFlags: DWORD,
) -> SOCKET;
pub fn WSAStartup(wVersionRequested: WORD, lpWSAData: LPWSADATA) -> c_int;
pub fn WSAStringToAddressA(
AddressString: LPSTR, AddressFamily: INT, lpProtocolInfo: LPWSAPROTOCOL_INFOA,
lpAddress: LPSOCKADDR, lpAddressLength: LPINT,
) -> INT;
pub fn WSAStringToAddressW(
AddressString: LPWSTR, AddressFamily: INT, lpProtocolInfo: LPWSAPROTOCOL_INFOW,
lpAddress: LPSOCKADDR, lpAddressLength: LPINT,
) -> INT;
pub fn WSAUnadvertiseProvider(puuidProviderId: *const GUID) -> INT;
pub fn WSAUnhookBlockingHook() -> c_int;
pub fn WSAWaitForMultipleEvents(
cEvents: DWORD, lphEvents: *const WSAEVENT, fWaitAll: BOOL, dwTimeout: DWORD,
fAlertable: BOOL,
) -> DWORD;
pub fn WSCDeinstallProvider(lpProviderId: LPGUID, lpErrno: LPINT) -> c_int;
pub fn WSCEnableNSProvider(lpProviderId: LPGUID, fEnable: BOOL) -> INT;
pub fn WSCEnumProtocols(
lpiProtocols: LPINT, lpProtocolBuffer: LPWSAPROTOCOL_INFOW, lpdwBufferLength: LPDWORD,
lpErrno: LPINT,
) -> c_int;
pub fn WSCGetApplicationCategory(
Path: LPCWSTR, PathLength: DWORD, Extra: LPCWSTR, ExtraLength: DWORD,
pPermittedLspCategories: *mut DWORD, lpErrno: LPINT,
) -> c_int;
pub fn WSCGetProviderInfo(
lpProviderId: LPGUID, InfoType: WSC_PROVIDER_INFO_TYPE, Info: PBYTE, InfoSize: *mut size_t,
Flags: DWORD, lpErrno: LPINT,
) -> c_int;
pub fn WSCGetProviderPath(
lpProviderId: LPGUID, lpszProviderDllPath: *mut WCHAR, lpProviderDllPathLen: LPINT,
lpErrno: LPINT,
) -> c_int;
pub fn WSCInstallNameSpace(
lpszIdentifier: LPWSTR, lpszPathName: LPWSTR, dwNameSpace: DWORD, dwVersion: DWORD,
lpProviderId: LPGUID,
) -> INT;
pub fn WSCInstallNameSpaceEx(
lpszIdentifier: LPWSTR, lpszPathName: LPWSTR, dwNameSpace: DWORD, dwVersion: DWORD,
lpProviderId: LPGUID, lpProviderSpecific: LPBLOB,
) -> INT;
pub fn WSCInstallProvider(
lpProviderId: LPGUID, lpszProviderDllPath: *const WCHAR,
lpProtocolInfoList: LPWSAPROTOCOL_INFOW, dwNumberOfEntries: DWORD, lpErrno: LPINT,
) -> c_int;
pub fn WSCSetApplicationCategory(
Path: LPCWSTR, PathLength: DWORD, Extra: LPCWSTR, ExtraLength: DWORD,
PermittedLspCategories: DWORD, pPrevPermLspCat: *mut DWORD, lpErrno: LPINT,
) -> c_int;
pub fn WSCSetProviderInfo(
lpProviderId: LPGUID, InfoType: WSC_PROVIDER_INFO_TYPE, Info: PBYTE, InfoSize: size_t,
Flags: DWORD, lpErrno: LPINT,
) -> c_int;
pub fn WSCUnInstallNameSpace(lpProviderId: LPGUID) -> INT;
pub fn WSCUpdateProvider(
lpProviderId: LPGUID, lpszProviderDllPath: *const WCHAR,
lpProtocolInfoList: LPWSAPROTOCOL_INFOW, dwNumberOfEntries: DWORD, lpErrno: LPINT,
) -> c_int;
pub fn WSCWriteNameSpaceOrder(lpProviderId: LPGUID, dwNumberOfEntries: DWORD) -> c_int;
pub fn WSCWriteProviderOrder(lpwdCatalogEntryId: LPDWORD, dwNumberOfEntries: DWORD) -> c_int;
pub fn __WSAFDIsSet(fd: SOCKET, _: *mut fd_set) -> c_int;
pub fn accept(s: SOCKET, addr: *mut SOCKADDR, addrlen: *mut c_int) -> SOCKET;
pub fn bind(s: SOCKET, name: *const SOCKADDR, namelen: c_int) -> c_int;
pub fn closesocket(s: SOCKET) -> c_int;
pub fn connect(s: SOCKET, name: *const SOCKADDR, namelen: c_int) -> c_int;
pub fn freeaddrinfo(pAddrInfo: PADDRINFOA);
pub fn getaddrinfo(
pNodeName: PCSTR, pServiceName: PCSTR, pHints: *const ADDRINFOA, ppResult: *mut PADDRINFOA,
) -> INT;
pub fn gethostbyaddr(addr: *const c_char, len: c_int, _type: c_int) -> *mut hostent;
pub fn gethostbyname(name: *const c_char) -> *mut hostent;
pub fn gethostname(name: *mut c_char, namelen: c_int) -> c_int;
pub fn getnameinfo(
pSockaddr: *const SOCKADDR, SockaddrLength: socklen_t, pNodeBuffer: PCHAR,
NodeBufferSize: DWORD, pServiceBuffer: PCHAR, ServiceBufferSize: DWORD, Flags: INT,
) -> INT;
pub fn getpeername(s: SOCKET, name: *mut SOCKADDR, namelen: *mut c_int) -> c_int;
pub fn getprotobyname(name: *const c_char) -> *mut protoent;
pub fn getprotobynumber(number: c_int) -> *mut protoent;
pub fn getservbyname(name: *const c_char, proto: *const c_char) -> *mut servent;
pub fn getservbyport(port: c_int, proto: *const c_char) -> *mut servent;
pub fn getsockname(s: SOCKET, name: *mut SOCKADDR, namelen: *mut c_int) -> c_int;
pub fn getsockopt(
s: SOCKET, level: c_int, optname: c_int, optval: *mut c_char, optlen: *mut c_int,
) -> c_int;
pub fn htonl(hostlong: u_long) -> u_long;
pub fn htons(hostshort: u_short) -> u_short;
pub fn inet_addr(cp: *const c_char) -> c_ulong;
pub fn inet_ntoa(_in: in_addr) -> *mut c_char;
pub fn inet_ntop(Family: INT, pAddr: PVOID, pStringBuf: PSTR, StringBufSize: size_t) -> PCSTR;
pub fn inet_pton(Family: INT, pszAddrString: PCSTR, pAddrBuf: PVOID) -> INT;
pub fn ioctlsocket(s: SOCKET, cmd: c_long, argp: *mut u_long) -> c_int;
pub fn listen(s: SOCKET, backlog: c_int) -> c_int;
pub fn ntohl(netlong: u_long) -> u_long;
pub fn ntohs(netshort: u_short) -> u_short;
pub fn recv(s: SOCKET, buf: *mut c_char, len: c_int, flags: c_int) -> c_int;
pub fn recvfrom(
s: SOCKET, buf: *mut c_char, len: c_int, flags: c_int, from: *mut SOCKADDR,
fromlen: *mut c_int,
) -> c_int;
pub fn select(
nfds: c_int, readfds: *mut fd_set, writefds: *mut fd_set, exceptfds: *mut fd_set,
timeout: *const timeval,
) -> c_int;
pub fn send(s: SOCKET, buf: *const c_char, len: c_int, flags: c_int) -> c_int;
pub fn sendto(
s: SOCKET, buf: *const c_char, len: c_int, flags: c_int, to: *const SOCKADDR, tolen: c_int,
) -> c_int;
pub fn setsockopt(
s: SOCKET, level: c_int, optname: c_int, optval: *const c_char, optlen: c_int,
) -> c_int;
pub fn shutdown(s: SOCKET, how: c_int) -> c_int;
pub fn socket(af: c_int, _type: c_int, protocol: c_int) -> SOCKET;
}
#[cfg(any(target_arch = "x86", target_arch = "arm"))]
extern "system" {
pub fn WSCInstallProviderAndChains(
lpProviderId: LPGUID, lpszProviderDllPath: LPWSTR, lpszLspName: LPWSTR,
dwServiceFlags: DWORD, lpProtocolInfoList: LPWSAPROTOCOL_INFOW, dwNumberOfEntries: DWORD,
lpdwCatalogEntryId: LPDWORD, lpErrno: LPINT,
) -> c_int;
}
#[cfg(target_arch = "x86_64")]
extern "system" {
pub fn WSCDeinstallProvider32(lpProviderId: LPGUID, lpErrno: LPINT) -> c_int;
pub fn WSCEnableNSProvider32(lpProviderId: LPGUID, fEnable: BOOL) -> INT;
pub fn WSCEnumNameSpaceProviders32(
lpdwBufferLength: LPDWORD, lpnspBuffer: LPWSANAMESPACE_INFOW,
) -> INT;
pub fn WSCEnumNameSpaceProvidersEx32(
lpdwBufferLength: LPDWORD, lpnspBuffer: LPWSANAMESPACE_INFOEXW,
) -> INT;
pub fn WSCEnumProtocols32(
lpiProtocols: LPINT, lpProtocolBuffer: LPWSAPROTOCOL_INFOW, lpdwBufferLength: LPDWORD,
lpErrno: LPINT,
) -> c_int;
pub fn WSCGetProviderInfo32(
lpProviderId: LPGUID, InfoType: WSC_PROVIDER_INFO_TYPE, Info: PBYTE, InfoSize: *mut size_t,
Flags: DWORD, lpErrno: LPINT,
) -> c_int;
pub fn WSCGetProviderPath32(
lpProviderId: LPGUID, lpszProviderDllPath: *mut WCHAR, lpProviderDllPathLen: LPINT,
lpErrno: LPINT,
) -> c_int;
pub fn WSCInstallNameSpace32(
lpszIdentifier: LPWSTR, lpszPathName: LPWSTR, dwNameSpace: DWORD, dwVersion: DWORD,
lpProviderId: LPGUID,
) -> INT;
pub fn WSCInstallNameSpaceEx32(
lpszIdentifier: LPWSTR, lpszPathName: LPWSTR, dwNameSpace: DWORD, dwVersion: DWORD,
lpProviderId: LPGUID, lpProviderSpecific: LPBLOB,
) -> INT;
pub fn WSCInstallProvider64_32(
lpProviderId: LPGUID, lpszProviderDllPath: *const WCHAR,
lpProtocolInfoList: LPWSAPROTOCOL_INFOW, dwNumberOfEntries: DWORD, lpErrno: LPINT,
) -> c_int;
pub fn WSCInstallProviderAndChains64_32(
lpProviderId: LPGUID, lpszProviderDllPath: LPWSTR, lpszProviderDllPath32: LPWSTR,
lpszLspName: LPWSTR, dwServiceFlags: DWORD, lpProtocolInfoList: LPWSAPROTOCOL_INFOW,
dwNumberOfEntries: DWORD, lpdwCatalogEntryId: LPDWORD, lpErrno: LPINT,
) -> c_int;
pub fn WSCSetProviderInfo32(
lpProviderId: LPGUID, InfoType: WSC_PROVIDER_INFO_TYPE, Info: PBYTE, InfoSize: size_t,
Flags: DWORD, lpErrno: LPINT,
) -> c_int;
pub fn WSCUnInstallNameSpace32(lpProviderId: LPGUID) -> INT;
pub fn WSCUpdateProvider32(
lpProviderId: LPGUID, lpszProviderDllPath: *const WCHAR,
lpProtocolInfoList: LPWSAPROTOCOL_INFOW, dwNumberOfEntries: DWORD, lpErrno: LPINT,
) -> c_int;
pub fn WSCWriteNameSpaceOrder32(lpProviderId: LPGUID, dwNumberOfEntries: DWORD) -> c_int;
pub fn WSCWriteProviderOrder32(lpwdCatalogEntryId: LPDWORD, dwNumberOfEntries: DWORD) -> c_int;
}
extern {
}