source: Daodan/MinGW/include/wsahelp.h@ 1122

Last change on this file since 1122 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

File size: 4.1 KB
Line 
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
10extern "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
26typedef enum _SOCKADDR_ADDRESS_INFO {
27 SockaddrAddressInfoNormal,
28 SockaddrAddressInfoWildcard,
29 SockaddrAddressInfoBroadcast,
30 SockaddrAddressInfoLoopback
31} SOCKADDR_ADDRESS_INFO, *PSOCKADDR_ADDRESS_INFO;
32typedef enum _SOCKADDR_ENDPOINT_INFO {
33 SockaddrEndpointInfoNormal,
34 SockaddrEndpointInfoWildcard,
35 SockaddrEndpointInfoReserved
36} SOCKADDR_ENDPOINT_INFO, *PSOCKADDR_ENDPOINT_INFO;
37typedef struct _SOCKADDR_INFO {
38 SOCKADDR_ADDRESS_INFO AddressInfo;
39 SOCKADDR_ENDPOINT_INFO EndpointInfo;
40} SOCKADDR_INFO, *PSOCKADDR_INFO;
41
42INT WINAPI WSHAddressToString(LPSOCKADDR,INT,LPWSAPROTOCOL_INFOW,LPWSTR,LPDWORD);
43INT WINAPI WSHEnumProtocols(LPINT,LPWSTR,LPVOID,LPDWORD);
44INT WINAPI WSHGetBroadcastSockaddr(PVOID,PSOCKADDR,PINT);
45INT WINAPI WSHGetProviderGuid(LPWSTR,LPGUID);
46INT WINAPI WSHGetSockaddrType(PSOCKADDR,DWORD,PSOCKADDR_INFO);
47INT WINAPI WSHGetSocketInformation(PVOID,SOCKET,HANDLE,HANDLE,INT,INT,PCHAR,INT);
48INT WINAPI WSHGetWildcardSockaddr(PVOID,PSOCKADDR,PINT);
49INT WINAPI WSHGetWSAProtocolInfo(LPWSTR,LPWSAPROTOCOL_INFOW*,LPDWORD);
50INT WINAPI WSHIoctl(PVOID,SOCKET,HANDLE,HANDLE,DWORD,LPVOID,DWORD,LPVOID,DWORD,
51LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE,LPBOOL);
52INT WINAPI WSHJoinLeaf(PVOID,SOCKET,HANDLE,HANDLE,PVOID,SOCKET,PSOCKADDR,
53DWORD,LPWSABUF,LPWSABUF,LPQOS,LPQOS,DWORD);
54INT WINAPI WSHNotify(PVOID,SOCKET,HANDLE,HANDLE,DWORD);
55INT WINAPI WSHOpenSocket(PINT,PINT,PINT,PUNICODE_STRING,PVOID,PDWORD);
56INT WINAPI WSHOpenSocket2(PINT,PINT,PINT,GROUP,DWORD,PUNICODE_STRING,PVOID*,PDWORD);
57INT WINAPI WSHSetSocketInformation(PVOID,SOCKET,HANDLE,HANDLE,INT,INT,PCHAR,INT);
58INT WINAPI WSHStringToAddress(LPWSTR,DWORD,LPWSAPROTOCOL_INFOW,LPSOCKADDR,LPDWORD);
59
60typedef INT (WINAPI *PWSH_ADDRESS_TO_STRING)(LPSOCKADDR,INT,LPWSAPROTOCOL_INFOW,LPWSTR,LPDWORD);
61typedef INT (WINAPI *PWSH_ENUM_PROTOCOLS)(LPINT,LPWSTR,LPVOID,LPDWORD);
62typedef INT (WINAPI *PWSH_GET_BROADCAST_SOCKADDR)(PVOID,PSOCKADDR,PINT);
63typedef INT (WINAPI *PWSH_GET_PROVIDER_GUID)(LPWSTR,LPGUID);
64typedef INT (WINAPI *PWSH_GET_SOCKADDR_TYPE)(PSOCKADDR,DWORD,PSOCKADDR_INFO);
65typedef INT (WINAPI *PWSH_GET_SOCKET_INFORMATION)(PVOID,SOCKET,HANDLE,HANDLE,INT,INT,PCHAR,INT);
66typedef INT (WINAPI *PWSH_GET_WILDCARD_SOCKEADDR)(PVOID,PSOCKADDR,PINT);
67typedef INT (WINAPI *PWSH_GET_WSAPROTOCOL_INFO)(LPWSTR,LPWSAPROTOCOL_INFOW*,LPDWORD);
68typedef INT (WINAPI *PWSH_IOCTL)(PVOID,SOCKET,HANDLE,HANDLE,DWORD,LPVOID,DWORD,
69 LPVOID,DWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE,LPBOOL);
70typedef INT (WINAPI *PWSH_JOIN_LEAF)(PVOID,SOCKET,HANDLE,HANDLE,PVOID,SOCKET,
71 PSOCKADDR,DWORD,LPWSABUF,LPWSABUF,LPQOS,LPQOS,DWORD);
72typedef INT (WINAPI *PWSH_NOTIFY)(PVOID,SOCKET,HANDLE,HANDLE,DWORD);
73typedef INT (WINAPI *PWSH_OPEN_SOCKET)(PINT,PINT,PINT,PUNICODE_STRING,PVOID,PDWORD);
74typedef INT (WINAPI *PWSH_OPEN_SOCKET2)(PINT,PINT,PINT,GROUP,DWORD,PUNICODE_STRING,PVOID*,PDWORD);
75typedef INT (WINAPI *PWSH_SET_SOCKET_INFORMATION)(PVOID,SOCKET,HANDLE,HANDLE,INT,INT,PCHAR,INT);
76typedef 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. */
80typedef 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;
89DWORD WINAPI WSHGetWinsockMapping(PWINSOCK_MAPPING,DWORD);
90typedef 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
Note: See TracBrowser for help on using the repository browser.