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