1 | #ifndef _WSAHELP_H
|
---|
2 | #define _WSAHELP_H
|
---|
3 | #if __GNUC__ >= 3
|
---|
4 | #pragma GCC system_header
|
---|
5 | #endif
|
---|
6 |
|
---|
7 | #include <winsock2.h>
|
---|
8 | #include <ntsecapi.h>
|
---|
9 | #ifdef __cplusplus
|
---|
10 | extern "C" {
|
---|
11 | #endif /* __cplusplus */
|
---|
12 |
|
---|
13 | #define WSH_NOTIFY_BIND 0x00000001
|
---|
14 | #define WSH_NOTIFY_LISTEN 0x00000002
|
---|
15 | #define WSH_NOTIFY_CONNECT 0x00000004
|
---|
16 | #define WSH_NOTIFY_ACCEPT 0x00000008
|
---|
17 | #define WSH_NOTIFY_SHUTDOWN_RECEIVE 0x00000010
|
---|
18 | #define WSH_NOTIFY_SHUTDOWN_SEND 0x00000020
|
---|
19 | #define WSH_NOTIFY_SHUTDOWN_ALL 0x00000040
|
---|
20 | #define WSH_NOTIFY_CLOSE 0x00000080
|
---|
21 | #define WSH_NOTIFY_CONNECT_ERROR 0x00000100
|
---|
22 | #define SOL_INTERNAL 0xFFFE
|
---|
23 | #define SO_CONTEXT 1
|
---|
24 |
|
---|
25 | #ifndef RC_INVOKED
|
---|
26 | typedef enum _SOCKADDR_ADDRESS_INFO {
|
---|
27 | SockaddrAddressInfoNormal,
|
---|
28 | SockaddrAddressInfoWildcard,
|
---|
29 | SockaddrAddressInfoBroadcast,
|
---|
30 | SockaddrAddressInfoLoopback
|
---|
31 | } SOCKADDR_ADDRESS_INFO, *PSOCKADDR_ADDRESS_INFO;
|
---|
32 | typedef enum _SOCKADDR_ENDPOINT_INFO {
|
---|
33 | SockaddrEndpointInfoNormal,
|
---|
34 | SockaddrEndpointInfoWildcard,
|
---|
35 | SockaddrEndpointInfoReserved
|
---|
36 | } SOCKADDR_ENDPOINT_INFO, *PSOCKADDR_ENDPOINT_INFO;
|
---|
37 | typedef struct _SOCKADDR_INFO {
|
---|
38 | SOCKADDR_ADDRESS_INFO AddressInfo;
|
---|
39 | SOCKADDR_ENDPOINT_INFO EndpointInfo;
|
---|
40 | } SOCKADDR_INFO, *PSOCKADDR_INFO;
|
---|
41 |
|
---|
42 | INT WINAPI WSHAddressToString(LPSOCKADDR,INT,LPWSAPROTOCOL_INFOW,LPWSTR,LPDWORD);
|
---|
43 | INT WINAPI WSHEnumProtocols(LPINT,LPWSTR,LPVOID,LPDWORD);
|
---|
44 | INT WINAPI WSHGetBroadcastSockaddr(PVOID,PSOCKADDR,PINT);
|
---|
45 | INT WINAPI WSHGetProviderGuid(LPWSTR,LPGUID);
|
---|
46 | INT WINAPI WSHGetSockaddrType(PSOCKADDR,DWORD,PSOCKADDR_INFO);
|
---|
47 | INT WINAPI WSHGetSocketInformation(PVOID,SOCKET,HANDLE,HANDLE,INT,INT,PCHAR,INT);
|
---|
48 | INT WINAPI WSHGetWildcardSockaddr(PVOID,PSOCKADDR,PINT);
|
---|
49 | INT WINAPI WSHGetWSAProtocolInfo(LPWSTR,LPWSAPROTOCOL_INFOW*,LPDWORD);
|
---|
50 | INT WINAPI WSHIoctl(PVOID,SOCKET,HANDLE,HANDLE,DWORD,LPVOID,DWORD,LPVOID,DWORD,
|
---|
51 | LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE,LPBOOL);
|
---|
52 | INT WINAPI WSHJoinLeaf(PVOID,SOCKET,HANDLE,HANDLE,PVOID,SOCKET,PSOCKADDR,
|
---|
53 | DWORD,LPWSABUF,LPWSABUF,LPQOS,LPQOS,DWORD);
|
---|
54 | INT WINAPI WSHNotify(PVOID,SOCKET,HANDLE,HANDLE,DWORD);
|
---|
55 | INT WINAPI WSHOpenSocket(PINT,PINT,PINT,PUNICODE_STRING,PVOID,PDWORD);
|
---|
56 | INT WINAPI WSHOpenSocket2(PINT,PINT,PINT,GROUP,DWORD,PUNICODE_STRING,PVOID*,PDWORD);
|
---|
57 | INT WINAPI WSHSetSocketInformation(PVOID,SOCKET,HANDLE,HANDLE,INT,INT,PCHAR,INT);
|
---|
58 | INT WINAPI WSHStringToAddress(LPWSTR,DWORD,LPWSAPROTOCOL_INFOW,LPSOCKADDR,LPDWORD);
|
---|
59 |
|
---|
60 | typedef INT (WINAPI *PWSH_ADDRESS_TO_STRING)(LPSOCKADDR,INT,LPWSAPROTOCOL_INFOW,LPWSTR,LPDWORD);
|
---|
61 | typedef INT (WINAPI *PWSH_ENUM_PROTOCOLS)(LPINT,LPWSTR,LPVOID,LPDWORD);
|
---|
62 | typedef INT (WINAPI *PWSH_GET_BROADCAST_SOCKADDR)(PVOID,PSOCKADDR,PINT);
|
---|
63 | typedef INT (WINAPI *PWSH_GET_PROVIDER_GUID)(LPWSTR,LPGUID);
|
---|
64 | typedef INT (WINAPI *PWSH_GET_SOCKADDR_TYPE)(PSOCKADDR,DWORD,PSOCKADDR_INFO);
|
---|
65 | typedef INT (WINAPI *PWSH_GET_SOCKET_INFORMATION)(PVOID,SOCKET,HANDLE,HANDLE,INT,INT,PCHAR,INT);
|
---|
66 | typedef INT (WINAPI *PWSH_GET_WILDCARD_SOCKEADDR)(PVOID,PSOCKADDR,PINT);
|
---|
67 | typedef INT (WINAPI *PWSH_GET_WSAPROTOCOL_INFO)(LPWSTR,LPWSAPROTOCOL_INFOW*,LPDWORD);
|
---|
68 | typedef INT (WINAPI *PWSH_IOCTL)(PVOID,SOCKET,HANDLE,HANDLE,DWORD,LPVOID,DWORD,
|
---|
69 | LPVOID,DWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE,LPBOOL);
|
---|
70 | typedef INT (WINAPI *PWSH_JOIN_LEAF)(PVOID,SOCKET,HANDLE,HANDLE,PVOID,SOCKET,
|
---|
71 | PSOCKADDR,DWORD,LPWSABUF,LPWSABUF,LPQOS,LPQOS,DWORD);
|
---|
72 | typedef INT (WINAPI *PWSH_NOTIFY)(PVOID,SOCKET,HANDLE,HANDLE,DWORD);
|
---|
73 | typedef INT (WINAPI *PWSH_OPEN_SOCKET)(PINT,PINT,PINT,PUNICODE_STRING,PVOID,PDWORD);
|
---|
74 | typedef INT (WINAPI *PWSH_OPEN_SOCKET2)(PINT,PINT,PINT,GROUP,DWORD,PUNICODE_STRING,PVOID*,PDWORD);
|
---|
75 | typedef INT (WINAPI *PWSH_SET_SOCKET_INFORMATION)(PVOID,SOCKET,HANDLE,HANDLE,INT,INT,PCHAR,INT);
|
---|
76 | typedef INT (WINAPI *PWSH_STRING_TO_ADDRESS)(LPWSTR,DWORD,LPWSAPROTOCOL_INFOW,LPSOCKADDR,LPDWORD);
|
---|
77 |
|
---|
78 | #ifndef __OBJC__
|
---|
79 | /* "Protocol" is a builtin class name in ObjC. */
|
---|
80 | typedef struct _WINSOCK_MAPPING {
|
---|
81 | DWORD Rows;
|
---|
82 | DWORD Columns;
|
---|
83 | struct {
|
---|
84 | DWORD AddressFamily;
|
---|
85 | DWORD SocketType;
|
---|
86 | DWORD Protocol;
|
---|
87 | } Mapping[1];
|
---|
88 | } WINSOCK_MAPPING, *PWINSOCK_MAPPING;
|
---|
89 | DWORD WINAPI WSHGetWinsockMapping(PWINSOCK_MAPPING,DWORD);
|
---|
90 | typedef DWORD (WINAPI *PWSH_GET_WINSOCK_MAPPING)(PWINSOCK_MAPPING,DWORD);
|
---|
91 | #endif
|
---|
92 |
|
---|
93 | #endif /* RC_INVOKED */
|
---|
94 |
|
---|
95 | #ifdef __cplusplus
|
---|
96 | }
|
---|
97 | #endif /* __cplusplus */
|
---|
98 | #endif
|
---|