Changeset 42 for Include/api_winsock2.sbp
- Timestamp:
- Dec 30, 2006, 11:20:03 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/api_winsock2.sbp
r24 r42 1 ' api_winsock2.sbp 2 'Windows Sockets Ver2.0 3 4 5 #ifndef _INC_WINSOCK2 6 #define _INC_WINSOCK2 1 #ifndef _WINSOCK2API_ 2 #define _WINSOCK2API_ 3 #define _WINSOCKAPI_ 4 /* 5 #ifndef INCL_WINSOCK_API_PROTOTYPES 6 #define INCL_WINSOCK_API_PROTOTYPES 1 7 #endif 8 9 #ifndef INCL_WINSOCK_API_TYPEDEFS 10 #define INCL_WINSOCK_API_TYPEDEFS 0 11 #endif 12 */ 13 14 Const WINSOCK_VERSION = MAKEWORD(2, 2) 7 15 8 16 TypeDef SOCKET = ULONG_PTR 9 17 10 Const SOCKET_ERROR = -1 11 Const INVALID_SOCKET = -1 12 13 14 'Port/socket numbers - network standard functions 15 Const IPPORT_ECHO = 7 16 Const IPPORT_DISCARD = 9 17 Const IPPORT_SYSTAT = 11 18 Const IPPORT_DAYTIME = 13 19 Const IPPORT_NETSTAT = 15 20 Const IPPORT_FTP = 21 21 Const IPPORT_TELNET = 23 22 Const IPPORT_SMTP = 25 23 Const IPPORT_TIMESERVER = 37 24 Const IPPORT_NAMESERVER = 42 25 Const IPPORT_WHOIS = 43 26 Const IPPORT_MTP = 57 27 28 29 'Address families 30 Const AF_UNSPEC = 0 31 Const AF_UNIX = 1 32 Const AF_INET = 2 33 Const AF_IMPLINK = 3 34 Const AF_PUP = 4 35 Const AF_CHAOS = 5 36 Const AF_NS = 6 37 Const AF_IPX = AF_NS 38 Const AF_ISO = 7 39 Const AF_OSI = AF_ISO 40 Const AF_ECMA = 8 41 Const AF_DATAKIT = 9 42 Const AF_CCITT = 10 43 Const AF_SNA = 11 44 Const AF_DECnet = 12 45 Const AF_DLI = 13 46 Const AF_LAT = 14 47 Const AF_HYLINK = 15 48 Const AF_APPLETALK = 16 49 Const AF_NETBIOS = 17 50 Const AF_VOICEVIEW = 18 51 Const AF_FIREFOX = 19 52 Const AF_UNKNOWN1 = 20 53 Const AF_BAN = 21 54 Const AF_ATM = 22 55 Const AF_INET6 = 23 56 Const AF_CLUSTER = 24 57 Const AF_12844 = 25 58 Const AF_MAX = 26 59 60 61 'Protocol families 62 Const PF_UNSPEC = AF_UNSPEC 63 Const PF_UNIX = AF_UNIX 64 Const PF_INET = AF_INET 65 Const PF_IMPLINK = AF_IMPLINK 66 Const PF_PUP = AF_PUP 67 Const PF_CHAOS = AF_CHAOS 68 Const PF_NS = AF_NS 69 Const PF_IPX = AF_IPX 70 Const PF_ISO = AF_ISO 71 Const PF_OSI = AF_OSI 72 Const PF_ECMA = AF_ECMA 73 Const PF_DATAKIT = AF_DATAKIT 74 Const PF_CCITT = AF_CCITT 75 Const PF_SNA = AF_SNA 76 Const PF_DECnet = AF_DECnet 77 Const PF_DLI = AF_DLI 78 Const PF_LAT = AF_LAT 79 Const PF_HYLINK = AF_HYLINK 80 Const PF_APPLETALK = AF_APPLETALK 81 Const PF_VOICEVIEW = AF_VOICEVIEW 82 Const PF_FIREFOX = AF_FIREFOX 83 Const PF_UNKNOWN1 = AF_UNKNOWN1 84 Const PF_BAN = AF_BAN 85 Const PF_ATM = AF_ATM 86 Const PF_INET6 = AF_INET6 87 Const PF_MAX = AF_MAX 88 89 90 Const MSG_OOB = 1 'process out-of-band data 91 Const MSG_PEEK = 2 'peek at incoming message 92 Const MSG_DONTROUTE = 4 'send without using routing tables 93 94 95 'Error code 96 Const WSABASEERR = 10000 97 Const WSAEINTR = WSABASEERR+4 98 Const WSAEBADF = WSABASEERR+9 99 Const WSAEACCES = WSABASEERR+13 100 Const WSAEFAULT = WSABASEERR+14 101 Const WSAEINVAL = WSABASEERR+22 102 Const WSAEMFILE = WSABASEERR+24 103 Const WSAEWOULDBLOCK = WSABASEERR+35 104 Const WSAEINPROGRESS = WSABASEERR+36 105 Const WSAEALREADY = WSABASEERR+37 106 Const WSAENOTSOCK = WSABASEERR+38 107 Const WSAEDESTADDRREQ = WSABASEERR+39 108 Const WSAEMSGSIZE = WSABASEERR+40 109 Const WSAEPROTOTYPE = WSABASEERR+41 110 Const WSAENOPROTOOPT = WSABASEERR+42 111 Const WSAEPROTONOSUPPORT = WSABASEERR+43 112 Const WSAESOCKTNOSUPPORT = WSABASEERR+44 113 Const WSAEOPNOTSUPP = WSABASEERR+45 114 Const WSAEPFNOSUPPORT = WSABASEERR+46 115 Const WSAEAFNOSUPPORT = WSABASEERR+47 116 Const WSAEADDRINUSE = WSABASEERR+48 117 Const WSAEADDRNOTAVAIL = WSABASEERR+49 118 Const WSAENETDOWN = WSABASEERR+50 119 Const WSAENETUNREACH = WSABASEERR+51 120 Const WSAENETRESET = WSABASEERR+52 121 Const WSAECONNABORTED = WSABASEERR+53 122 Const WSAECONNRESET = WSABASEERR+54 123 Const WSAENOBUFS = WSABASEERR+55 124 Const WSAEISCONN = WSABASEERR+56 125 Const WSAENOTCONN = WSABASEERR+57 126 Const WSAESHUTDOWN = WSABASEERR+58 127 Const WSAETOOMANYREFS = WSABASEERR+59 128 Const WSAETIMEDOUT = WSABASEERR+60 129 Const WSAECONNREFUSED = WSABASEERR+61 130 Const WSAELOOP = WSABASEERR+62 131 Const WSAENAMETOOLONG = WSABASEERR+63 132 Const WSAEHOSTDOWN = WSABASEERR+64 133 Const WSAEHOSTUNREACH = WSABASEERR+65 134 Const WSAENOTEMPTY = WSABASEERR+66 135 Const WSAEPROCLIM = WSABASEERR+67 136 Const WSAEUSERS = WSABASEERR+68 137 Const WSAEDQUOT = WSABASEERR+69 138 Const WSAESTALE = WSABASEERR+70 139 Const WSAEREMOTE = WSABASEERR+71 140 Const WSASYSNOTREADY = WSABASEERR+91 141 Const WSAVERNOTSUPPORTED = WSABASEERR+92 142 Const WSANOTINITIALISED = WSABASEERR+93 143 Const WSAEDISCON = WSABASEERR+101 144 Const WSAENOMORE = WSABASEERR+102 145 Const WSAECANCELLED = WSABASEERR+103 146 Const WSAEINVALIDPROCTABLE = WSABASEERR+104 147 Const WSAEINVALIDPROVIDER = WSABASEERR+105 148 Const WSAEPROVIDERFAILEDINIT =WSABASEERR+106 149 Const WSASYSCALLFAILURE = WSABASEERR+107 150 Const WSASERVICE_NOT_FOUND = WSABASEERR+108 151 Const WSATYPE_NOT_FOUND = WSABASEERR+109 152 Const WSA_E_NO_MORE = WSABASEERR+110 153 Const WSA_E_CANCELLED = WSABASEERR+111 154 Const WSAEREFUSED = WSABASEERR+112 155 156 157 158 '--------------- 159 ' WinSock Types 160 '--------------- 161 162 Type HOSTENT 163 h_name As BytePtr 164 h_aliases As DWordPtr 18 Const FD_SETSIZE = 64 19 20 Type fd_set 21 fd_count As DWord 22 fd_array[ELM(FD_SETSIZE)] As SOCKET 23 End Type 24 25 Declare Function __WSAFDIsSet Lib "ws2_32" (fd As SOCKET, ByRef set As fd_set) As Long 26 27 Sub FD_CLR(fd As SOCKET, ByRef set As fd_set) 28 Dim i As DWord 29 With set 30 For i = 0 To .fd_count 31 If .fd_array[i] = fd Then 32 While i < .fd_count - 1 33 .fd_array[i] = .fd_array[i + 1] 34 WEnd 35 .fd_count-- 36 Exit For 37 End If 38 Next 39 End With 40 End Sub 41 42 Sub FD_SET(fd As SOCKET, ByRef set As fd_set) 43 Dim i As DWord 44 With set 45 For i = 0 To ELM(.fd_count) 46 If .fd_array[i] = fd Then 47 Exit Sub 48 End If 49 Next 50 If i = .fd_count Then 51 If .fd_count < FD_SET_SIZE Then 52 .fd_array[i] = fd 53 .fd_count++ 54 End If 55 End If 56 End With 57 End Sub 58 59 Sub FD_ZERO(ByRef set As fd_set) 60 set.fd_count = 0 61 End Sub 62 63 Const FD_ISSET(fd, set) = __WSAFDIsSet(fd, set) 64 65 Type timeval 66 tv_sec As Long 67 tv_usec As Long 68 End Type 69 70 ' Operations on timevals. 71 Function timerisset(ByRef tvp As timeval) As BOOL 72 Return tvp.tv_sec Or tvp.tv_usec 73 End Function 74 75 /* 76 #define timercmp(tvp, uvp, cmp) \ 77 ((tvp)->tv_sec cmp (uvp)->tv_sec || \ 78 (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) 79 */ 80 81 Sub timerclear(ByRef tvp As timeval) 82 tvp.tv_sec = 0 83 tvp.tv_usec = 0 84 End Sub 85 86 ' Commands for ioctlsocket(), taken from the BSD file fcntl.h. 87 Const IOCPARM_MASK = &h7f 88 Const IOC_VOID = &h20000000 89 Const IOC_OUT = &h40000000 90 Const IOC_IN = &h80000000 91 Const IOC_INOUT= (IOC_IN Or IOC_OUT) 92 93 Const _IO(x ,y) = (IOC_VOID Or (x << 8) Or y) 94 95 Const _IOR(x, y, size) = (IOC_OUT Or ((size And IOCPARM_MASK) << 16) Or ((x) << 8) Or (y)) 96 97 Const _IOW(x, y, size) = (IOC_IN Or ((size And IOCPARM_MASK) << 16) Or ((x) << 8) Or (y)) 98 99 Const FIONREAD = _IOR(&h66,127, SizeOf (DWord)) '&h66は'f' 100 Const FIONBIO = _IOW(&h66,126, SizeOf (DWord)) 101 Const FIOASYNC = _IOW(&h66,125, SizeOf (DWord)) 102 103 ' Socket I/O Controls 104 Const SIOCSHIWAT = _IOW(&h73, 0, SizeOf (DWord)) '&h73は's' 105 Const SIOCGHIWAT = _IOR(&h73, 1, SizeOf (DWord)) 106 Const SIOCSLOWAT = _IOW(&h73, 2, SizeOf (DWord)) 107 Const SIOCGLOWAT = _IOR(&h73, 3, SizeOf (DWord)) 108 Const SIOCATMARK = _IOR(&h73, 7, SizeOf (DWord)) 109 110 111 Class hostent 112 Public 113 h_name As *Byte 114 h_aliases As **Byte 165 115 h_addrtype As Integer 166 h_length As Integer 167 h_addr_list As DWordPtr 168 End Type 169 170 Type SERVENT 171 s_name As BytePtr 172 s_aliases As DWordPtr 116 h_lengt As Integer 117 h_addr_list As **Byte 118 119 Function h_addr() As *Byte 120 Return h_addr_list[0] 121 End Function 122 123 Sub h_addr(l As *Byte) 124 h_addr_list[0] = i 125 End Sub 126 End Class 127 128 Type netent 129 FAR * n_name As *Byte 130 FAR * FAR * n_aliases As **Byte 131 n_addrtyp As Integer 132 n_net As DWord 133 End Type 134 135 Type servent 136 s_name As *Byte 137 s_aliases As **Byte 138 #ifdef _WIN64 139 s_proto As *Byte 173 140 s_port As Integer 174 s_proto As BytePtr 175 End Type 176 177 Type SOCKADDR 178 sa_family As Word 179 sa_data[13] As Byte 180 End Type 181 Type SOCKADDR_IN 182 sin_family As Word 141 #else 142 s_port As Integer 143 s_proto As *Byte 144 #endif 145 End Type 146 147 Type protoent 148 p_name As *Byte 149 p_aliases As **Byte 150 p_proto As Integer 151 End Type 152 153 ' Protocols 154 Const IPPROTO_IP = 0 155 Const IPPROTO_HOPOPTS = 0 156 Const IPPROTO_ICMP = 1 157 Const IPPROTO_IGMP = 2 158 Const IPPROTO_GGP = 3 159 Const IPPROTO_IPV4 = 4 160 Const IPPROTO_TCP = 6 161 Const IPPROTO_PUP = 12 162 Const IPPROTO_UDP = 17 163 Const IPPROTO_IDP = 22 164 Const IPPROTO_IPV6 = 41 165 Const IPPROTO_ROUTING = 43 166 Const IPPROTO_FRAGMENT = 44 167 Const IPPROTO_ESP = 50 168 Const IPPROTO_AH = 51 169 Const IPPROTO_ICMPV6 = 58 170 Const IPPROTO_NONE = 59 171 Const IPPROTO_DSTOPTS = 60 172 Const IPPROTO_ND = 77 173 Const IPPROTO_ICLFXBM = 78 174 175 Const IPPROTO_RAW = 255 176 Const IPPROTO_MAX = 256 177 178 ' Port/socket numbers: network standard functions 179 Const IPPORT_ECHO = 7 180 Const IPPORT_DISCARD = 9 181 Const IPPORT_SYSTAT = 11 182 Const IPPORT_DAYTIME = 13 183 Const IPPORT_NETSTAT = 15 184 Const IPPORT_FTP = 21 185 Const IPPORT_TELNET = 23 186 Const IPPORT_SMTP = 25 187 Const IPPORT_TIMESERVER = 37 188 Const IPPORT_NAMESERVER = 42 189 Const IPPORT_WHOIS = 43 190 Const IPPORT_MTP = 57 191 192 ' Port/socket numbers: host specific functions 193 Const IPPORT_TFTP = 69 194 Const IPPORT_RJE = 77 195 Const IPPORT_FINGER = 79 196 Const IPPORT_TTYLINK = 87 197 Const IPPORT_SUPDUP = 95 198 199 ' UNIX TCP sockets 200 Const IPPORT_EXECSERVER = 512 201 Const IPPORT_LOGINSERVER = 513 202 Const IPPORT_CMDSERVER = 514 203 Const IPPORT_EFSSERVER = 520 204 205 ' UNIX UDP sockets 206 Const IPPORT_BIFFUDP = 512 207 Const IPPORT_WHOSERVER = 513 208 Const IPPORT_ROUTESERVER = 520 209 ' 520+1 also used 210 211 ' Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root). 212 Const IPPORT_RESERVED = 1024 213 214 ' Link numbers 215 Const IMPLINK_IP = 155 216 Const IMPLINK_LOWEXPER = 156 217 Const IMPLINK_HIGHEXPER = 158 218 219 #ifndef s_addr 220 #define s_addr 221 ' Internet address (old style... should be updated) 222 Class in_addr 223 Public 224 /* 225 Union S_un 226 S_un_b As Type 227 s_b1 As Byte 228 s_b2 As Byte 229 s_b3 As Byte 230 s_b4 As Byte 231 End Type 232 S_un_w As Type 233 s_w1 As Word 234 s_w2 As Word 235 End Type 236 S_addr As DWord 237 End Union 238 */ 239 s_addr As DWord 240 241 Function s_host() As Byte 242 Return GetByte(VarPtr(s_addr) + 1) 243 End Function 244 245 Sub s_host(h As Byte) 246 Return SetByte(VarPtr(s_addr) + 2, h) 247 End Sub 248 249 Function s_net() As Byte 250 Return GetByte(VarPtr(s_addr) + 0) 251 End Function 252 253 Sub s_net(n As Byte) 254 Return SetByte(VarPtr(s_addr) + 0, n) 255 End Sub 256 257 Function s_imp() As Word 258 Return GetWord(VarPtr(s_addr) + 1) 259 End Function 260 261 Sub s_imp(i As Word) 262 Return SetWord(VarPtr(s_addr) + 1, i) 263 End Sub 264 265 Function s_impno() As Byte 266 Return GetByte(VarPtr(s_addr) + 3) 267 End Function 268 269 Sub s_impno(i As Byte) 270 Return SetByte(VarPtr(s_addr) + 3, i) 271 End Sub 272 273 Function s_lh() As Byte 274 Return GetByte(VarPtr(s_addr) + 2) 275 End Function 276 277 Sub s_lh(l As Byte) 278 Return SetByte(VarPtr(s_addr) + 2, l) 279 End Sub 280 End Class 281 #endif 282 283 Const IN_CLASSA(i) = (((i) As DWord And &h80000000) = 0) 284 Const IN_CLASSA_NET = &hff000000 285 Const IN_CLASSA_NSHIFT = 24 286 Const IN_CLASSA_HOST = &h00ffffff 287 Const IN_CLASSA_MAX = 128 288 289 Const IN_CLASSB(i) = (((i) As DWord & &hc0000000) = &h80000000) 290 Const IN_CLASSB_NET= &hffff0000 291 Const IN_CLASSB_NSHIFT = 16 292 Const IN_CLASSB_HOST = &h0000ffff 293 Const IN_CLASSB_MAX = 65536 294 295 Const IN_CLASSC(i) = (((i) As DWord And &he0000000) = &hc0000000) 296 Const IN_CLASSC_NET = &hffffff00 297 Const IN_CLASSC_NSHIFT = 8 298 Const IN_CLASSC_HOST = &h000000ff 299 300 Const IN_CLASSD(i) = (((i) As DWord And &hf0000000) = &he0000000) 301 Const IN_CLASSD_NET = &hf0000000 302 Const IN_CLASSD_NSHIFT = 28 303 Const IN_CLASSD_HOST = &h0fffffff 304 Const IN_MULTICAST(i) = IN_CLASSD(i) 305 306 Const INADDR_ANY = &h00000000 As DWord 307 Const INADDR_LOOPBACK = &h7f000001 308 Const INADDR_BROADCAST = &hffffffff As DWord 309 Const INADDR_NONE = &hffffffff 310 311 Const ADDR_ANY = INADDR_ANY 312 313 ' Socket address, internet style. 314 Type sockaddr_in 315 sin_family As Integer 183 316 sin_port As Word 184 sin_addr As DWord 185 sin_zero[7] As Byte 186 End Type 187 188 189 '------------- 190 ' WinSock API 191 '------------- 192 193 Declare Function closesocket Lib "ws2_32.dll" (s As SOCKET) As Long 194 Declare Function connect Lib "ws2_32.dll" (s As SOCKET, ByRef name As Any, namelen As Long) As Long 195 Declare Function gethostbyname Lib "ws2_32.dll" (name As BytePtr) As *HOSTENT 196 Declare Function getservbyname Lib "ws2_32.dll" (name As BytePtr, proto As BytePtr) As *SERVENT 197 Declare Function htonl Lib "ws2_32.dll" (hostlong As DWord) As DWord 198 Declare Function htons Lib "ws2_32.dll" (hostshort As Word) As Word 199 Declare Function recv Lib "ws2_32.dll" (s As SOCKET, buf As BytePtr, length As Long, flags As Long) As Long 200 Declare Function send Lib "ws2_32.dll" (s As SOCKET, buf As BytePtr, length As Long, flags As Long) As Long 201 202 Const SD_RECEIVE = 0 203 Const SD_SEND = 1 204 Const SD_BOTH = 2 205 Declare Function shutdown Lib "ws2_32.dll" (s As SOCKET, how As Long) As Long 206 207 Const SOCK_STREAM = 1 208 Const SOCK_DGRAM = 2 209 Const SOCK_RAW = 3 210 Const SOCK_RDM = 4 211 Const SOCK_SEQPACKET = 5 212 Declare Function socket Lib "ws2_32.dll" (af As Long, sokettype As Long, protocol As Long) As SOCKET 213 214 Declare Function WSACleanup Lib "ws2_32.dll" () As Integer 317 sin_addr As in_addr 318 sin_zero[ELM(8)] As Byte 319 End Type 215 320 216 321 Const WSADESCRIPTION_LEN = 256 217 Const WSASYS_STATUS_LEN = 128 322 Const WSASYS_STATUS_LEN = 128 323 218 324 Type WSADATA 219 325 wVersion As Word 220 326 wHighVersion As Word 327 #ifdef _WIN64 328 iMaxSockets As Word 329 iMaxUdpDg As Word 330 lpVendorInfo As *Byte 331 szDescription[WSADESCRIPTION_LEN] As Byte 332 szSystemStatus[WSASYS_STATUS_LEN] As Byte 333 #else 221 334 szDescription[WSADESCRIPTION_LEN] As Byte 222 335 szSystemStatus[WSASYS_STATUS_LEN] As Byte 223 336 iMaxSockets As Word 224 337 iMaxUdpDg As Word 225 lpVendorInfo As BytePtr 226 End Type 227 Declare Function WSAStartup Lib "ws2_32.dll" (wVersionRequested As Word, ByRef lpWSAData As WSADATA) As Long 228 229 230 Declare Function accept Lib "ws2_32.dll" (s As SOCKET, ByRef addr As SOCKADDR_IN, ByVal addrlen As Long) As SOCKET 231 Declare Function bind Lib "ws2_32.dll" (s As SOCKET, ByRef sName As SOCKADDR_IN, ByVal namelen As Long) As Long 232 Declare Function ioctlsocket Lib "ws2_32.dll" (s As SOCKET, ByVal cmd As Long, argp As DWord) As Long 233 Declare Function listen Lib "ws2_32.dll" (s As SOCKET, ByVal backlog As Long) As Long 234 235 Declare Function recvfrom Lib "ws2_32.dll" (s As SOCKET, buf As BytePtr, length As Long, flags As Long, ByRef from As SOCKADDR_IN, fromlen As Long) As Long 236 Declare Function sendto Lib "ws2_32.dll" (s As SOCKET, buf As BytePtr, length As Long, flags As Long, ByRef sTo As SOCKADDR_IN, tolen As Long) As Long 237 238 Const INADDR_ANY = &h0 239 240 Declare Function htons Lib "ws2_32.dll" (netshort As Word) As Word 241 Declare Function htonl Lib "ws2_32.dll" (netshort As DWord) As DWord 242 Declare Function ntohs Lib "ws2_32.dll" (netshort As Word) As Word 243 Declare Function ntohl Lib "ws2_32.dll" (netshort As DWord) As DWord 244 245 #endif '_INC_WINSOCK2 338 lpVendorInfo As *Byte 339 #endif 340 End Type 341 342 TypeDef LPWSADATA = *WSADATA 343 344 ' Definitions related to sockets: types, address families, options, taken from the BSD file sys/socket.h. 345 346 Const INVALID_SOCKET = (Not 0) As ULONG_PTR 347 Const SOCKET_ERROR = (-1) 348 349 Const FROM_PROTOCOL_INFO = (-1) 350 351 ' Types 352 Const SOCK_STREAM = 1 353 Const SOCK_DGRAM = 2 354 Const SOCK_RAW = 3 355 Const SOCK_RDM = 4 356 Const SOCK_SEQPACKET = 5 357 358 ' Option flags per-socket. 359 Const SO_DEBUG = &h0001 360 Const SO_ACCEPTCONN = &h0002 361 Const SO_REUSEADDR = &h0004 362 Const SO_KEEPALIVE = &h0008 363 Const SO_DONTROUTE = &h0010 364 Const SO_BROADCAST = &h0020 365 Const SO_USELOOPBACK = &h0040 366 Const SO_LINGER = &h0080 367 Const SO_OOBINLINE = &h0100 368 369 Const SO_DONTLINGER = ((Not SO_LINGER) As Long) 370 Const SO_EXCLUSIVEADDRUSE = ((Not SO_REUSEADDR) As Long) 371 372 ' Additional options. 373 Const SO_SNDBUF = &h1001 374 Const SO_RCVBUF = &h1002 375 Const SO_SNDLOWAT = &h1003 376 Const SO_RCVLOWAT = &h1004 377 Const SO_SNDTIMEO = &h1005 378 Const SO_RCVTIMEO = &h1006 379 Const SO_ERROR = &h1007 380 Const SO_TYPE = &h1008 381 382 ' WinSock 2 extension -- new options 383 Const SO_GROUP_ID = &h2001 384 Const SO_GROUP_PRIORITY = &h2002 385 Const SO_MAX_MSG_SIZE = &h2003 386 Const SO_PROTOCOL_INFOA = &h2004 387 Const SO_PROTOCOL_INFOW = &h2005 388 #ifdef UNICODE 389 Const SO_PROTOCOL_INFO = SO_PROTOCOL_INFOW 390 #else 391 Const SO_PROTOCOL_INFO = SO_PROTOCOL_INFOA 392 #endif /* UNICODE */ 393 Const PVD_CONFIG = &h3001 394 Const SO_CONDITIONAL_ACCEPT = &h3002 395 396 ' TCP options. 397 Const TCP_NODELAY = &h0001 398 399 ' Address families. 400 Const AF_UNSPEC = 0 401 Const AF_UNIX = 1 402 Const AF_INET = 2 403 Const AF_IMPLINK = 3 404 Const AF_PUP = 4 405 Const AF_CHAOS = 5 406 Const AF_NS = 6 407 Const AF_IPX = AF_NS 408 Const AF_ISO = 7 409 Const AF_OSI = AF_ISO 410 Const AF_ECMA = 8 411 Const AF_DATAKIT = 9 412 Const AF_CCITT = 10 413 Const AF_SNA = 11 414 Const AF_DECnet = 12 415 Const AF_DLI = 13 416 Const AF_LAT = 14 417 Const AF_HYLINK = 15 418 Const AF_APPLETALK = 16 419 Const AF_NETBIOS = 17 420 Const AF_VOICEVIEW = 18 421 Const AF_FIREFOX = 19 422 Const AF_UNKNOWN1 = 20 423 Const AF_BAN = 21 424 Const AF_ATM = 22 425 Const AF_INET6 = 23 426 Const AF_CLUSTER = 24 427 Const AF_12844 = 25 428 Const AF_IRDA = 26 429 Const AF_NETDES = 28 430 431 Const AF_TCNPROCESS = 29 432 Const AF_TCNMESSAGE = 30 433 Const AF_ICLFXBM = 31 434 435 Const AF_MAX = 32 436 437 ' Structure used by kernel to store most addresses. 438 Type sockaddr 439 sa_family As Word 440 sa_data[ELM(14)] As Byte 441 End Type 442 443 ' Portable socket structure (RFC 2553). 444 445 ' Desired design of maximum size and alignment. 446 ' These are implementation specific. 447 Const _SS_MAXSIZE = 128 ' Maximum size. 448 Const _SS_ALIGNSIZE = (SizeOf (Int64)) 'Desired alignment. 449 450 ' Definitions used for sockaddr_storage structure paddings design. 451 Const _SS_PAD1SIZE = (_SS_ALIGNSIZE - SizeOf (Integer)) 452 Const _SS_PAD2SIZE = (_SS_MAXSIZE - (SizeOf (Integer) + _SS_PAD1SIZE + _SS_ALIGNSIZE)) 453 454 Type sockaddr_storage 455 ss_family As Integer 456 __ss_pad1[ELM(_SS_PAD1SIZE)] As Byte 457 __ss_align As Int64 458 __ss_pad2[ELM(_SS_PAD2SIZE)] As Byte 459 End Type 460 461 Type sockproto 462 sp_family As Word 463 sp_protocol As Word 464 End Type 465 466 ' Protocol families, same as address families for now. 467 Const PF_UNSPEC = AF_UNSPEC 468 Const PF_UNIX = AF_UNIX 469 Const PF_INET = AF_INET 470 Const PF_IMPLINK = AF_IMPLINK 471 Const PF_PUP = AF_PUP 472 Const PF_CHAOS = AF_CHAOS 473 Const PF_NS = AF_NS 474 Const PF_IPX = AF_IPX 475 Const PF_ISO = AF_ISO 476 Const PF_OSI = AF_OSI 477 Const PF_ECMA = AF_ECMA 478 Const PF_DATAKIT = AF_DATAKIT 479 Const PF_CCITT = AF_CCITT 480 Const PF_SNA = AF_SNA 481 Const PF_DECnet = AF_DECnet 482 Const PF_DLI = AF_DLI 483 Const PF_LAT = AF_LAT 484 Const PF_HYLINK = AF_HYLINK 485 Const PF_APPLETALK = AF_APPLETALK 486 Const PF_VOICEVIEW = AF_VOICEVIEW 487 Const PF_FIREFOX = AF_FIREFOX 488 Const PF_UNKNOWN1 = AF_UNKNOWN1 489 Const PF_BAN = AF_BAN 490 Const PF_ATM = AF_ATM 491 Const PF_INET6 = AF_INET6 492 493 Const PF_MAX = AF_MAX 494 495 ' Structure used for manipulating linger option. 496 Type linger 497 l_onoff As Word 498 l_linger As Word 499 End Type 500 501 ' Level number for (get/set)sockopt() to apply to socket itself. 502 Const SOL_SOCKET = &hffff 503 504 ' Maximum queue length specifiable by listen. 505 Const SOMAXCONN = &h7fffffff 506 507 Const MSG_OOB = &h1 508 Const MSG_PEEK = &h2 509 Const MSG_DONTROUTE = &h4 510 Const MSG_WAITALL = &h8 511 512 Const MSG_PARTIAL = &h8000 513 514 ' WinSock 2 extension -- new flags for WSASend(), WSASendTo(), WSARecv() and 515 ' WSARecvFrom() 516 Const MSG_INTERRUPT = &h10 517 518 Const MSG_MAXIOVLEN = 16 519 520 ' Define constant based on rfc883, used by gethostbyxxxx() calls. 521 Const MAXGETHOSTSTRUCT = 1024 522 523 ' WinSock 2 extension -- bit values and indices for FD_XXX network events 524 Const FD_READ_BIT = 0 525 Const FD_READ = (1 << FD_READ_BIT) 526 527 Const FD_WRITE_BIT = 1 528 Const FD_WRITE = (1 << FD_WRITE_BIT) 529 530 Const FD_OOB_BIT = 2 531 Const FD_OOB = (1 << FD_OOB_BIT) 532 533 Const FD_ACCEPT_BIT = 3 534 Const FD_ACCEPT = (1 << FD_ACCEPT_BIT) 535 536 Const FD_CONNECT_BIT = 4 537 Const FD_CONNECT = (1 << FD_CONNECT_BIT) 538 539 Const FD_CLOSE_BIT = 5 540 Const FD_CLOSE = (1 << FD_CLOSE_BIT) 541 542 Const FD_QOS_BIT = 6 543 Const FD_QOS = (1 << FD_QOS_BIT) 544 545 Const FD_GROUP_QOS_BIT = 7 546 Const FD_GROUP_QOS = (1 << FD_GROUP_QOS_BIT) 547 548 Const FD_ROUTING_INTERFACE_CHANGE_BIT = 8 549 Const FD_ROUTING_INTERFACE_CHANGE = (1 << FD_ROUTING_INTERFACE_CHANGE_BIT) 550 551 Const FD_ADDRESS_LIST_CHANGE_BIT = 9 552 Const FD_ADDRESS_LIST_CHANGE = (1 << FD_ADDRESS_LIST_CHANGE_BIT) 553 554 Const FD_MAX_EVENTS = 10 555 Const FD_ALL_EVENTS = ((1 << FD_MAX_EVENTS) - 1) 556 557 #include <api_winerror.sbp> 558 559 ' Compatibility macros. 560 561 'Const h_errno = WSAGetLastError() 562 Const HOST_NOT_FOUND = WSAHOST_NOT_FOUND 563 Const TRY_AGAIN = WSATRY_AGAIN 564 Const NO_RECOVERY = WSANO_RECOVERY 565 Const NO_DATA = WSANO_DATA 566 Const WSANO_ADDRESS = WSANO_DATA 567 Const NO_ADDRESS = WSANO_ADDRESS 568 569 ' WinSock 2 extension -- new error codes and type definition 570 571 '#ifdef _WIN32 572 573 TypeDef WSAEVENT = HANDLE 574 TypeDef LPWSAEVENT = *HANDLE 575 TypeDef WSAOVERLAPPED = OVERLAPPED 576 TypeDef LPWSAOVERLAPPED = *OVERLAPPED 577 578 Const WSA_IO_PENDING = (ERROR_IO_PENDING) 579 Const WSA_IO_INCOMPLETE = (ERROR_IO_INCOMPLETE) 580 Const WSA_INVALID_HANDLE = (ERROR_INVALID_HANDLE) 581 Const WSA_INVALID_PARAMETER = (ERROR_INVALID_PARAMETER) 582 Const WSA_NOT_ENOUGH_MEMORY = (ERROR_NOT_ENOUGH_MEMORY) 583 Const WSA_OPERATION_ABORTED = (ERROR_OPERATION_ABORTED) 584 585 Const WSA_INVALID_EVENT = (0 As WSAEVENT) 586 Const WSA_MAXIMUM_WAIT_EVENTS = (MAXIMUM_WAIT_OBJECTS) 587 Const WSA_WAIT_FAILED = (WAIT_FAILED) 588 Const WSA_WAIT_EVENT_0 = (WAIT_OBJECT_0) 589 Const WSA_WAIT_IO_COMPLETION = (WAIT_IO_COMPLETION) 590 Const WSA_WAIT_TIMEOUT = (WAIT_TIMEOUT) 591 Const WSA_INFINITE = (INFINITE) 592 593 '#elif defined _WIN16 594 '#endif 595 596 Type WSABUF 597 len As DWord 598 buf As *Byte 599 End Type 600 TypeDef LPWSABUF = *WSABUF 601 602 #include <qos.ab> 603 604 Type QOS 'struct _QualityOfService 605 SendingFlowspec As FLOWSPEC 606 ReceivingFlowspec As FLOWSPEC 607 ProviderSpecific As WSABUF 608 End Type 609 TypeDef LPQOS = *QOS 610 611 ' WinSock 2 extension -- manifest constants for return values of the condition function 612 Const CF_ACCEPT = &h0000 613 Const CF_REJECT = &h0001 614 Const CF_DEFER = &h0002 615 616 ' WinSock 2 extension -- manifest constants for shutdown() 617 Const SD_RECEIVE = &h00 618 Const SD_SEND = &h01 619 Const SD_BOTH = &h02 620 621 ' WinSock 2 extension -- data type and manifest constants for socket groups 622 TypeDef GROUP = DWord 623 624 Const SG_UNCONSTRAINED_GROUP = &h01 625 Const SG_CONSTRAINED_GROUP = &h02 626 627 ' WinSock 2 extension -- data type for WSAEnumNetworkEvents() 628 Type WSANETWORKEVENTS 629 lNetworkEvents As Long 630 iErrorCode[ELM(FD_MAX_EVENTS)] As Long 631 End Type 632 TypeDef LPWSANETWORKEVENTS = *WSANETWORKEVENTS 633 634 ' WinSock 2 extension -- WSAPROTOCOL_INFO structure and associated 635 ' manifest constants 636 637 Const MAX_PROTOCOL_CHAIN = 7 638 639 Const BASE_PROTOCOL = 1 640 Const LAYERED_PROTOCOL = 0 641 642 Type WSAPROTOCOLCHAIN 643 ChainLen As Long 644 ChainEntries[ELM(MAX_PROTOCOL_CHAIN)] As DWord 645 End Type 646 TypeDef LPWSAPROTOCOLCHAIN = *WSAPROTOCOLCHAIN 647 648 Const WSAPROTOCOL_LEN = 255 649 650 Type WSAPROTOCOL_INFOA 651 dwServiceFlags1 As DWord 652 dwServiceFlags2 As DWord 653 dwServiceFlags3 As DWord 654 dwServiceFlags4 As DWord 655 dwProviderFlags As DWord 656 ProviderId As GUID 657 dwCatalogEntryId As DWord 658 ProtocolChain As WSAPROTOCOLCHAIN 659 iVersion As Long 660 iAddressFamily As Long 661 iMaxSockAddr As Long 662 iMinSockAddr As Long 663 iSocketType As Long 664 iProtocol As Long 665 iProtocolMaxOffset As Long 666 iNetworkByteOrder As Long 667 iSecurityScheme As Long 668 dwMessageSize As DWord 669 dwProviderReserved As DWord 670 szProtocol[WSAPROTOCOL_LEN] As Byte 671 End Type 672 TypeDef LPWSAPROTOCOL_INFOA = *WSAPROTOCOL_INFOA 673 674 Type WSAPROTOCOL_INFOW 675 dwServiceFlags1 As DWord 676 dwServiceFlags2 As DWord 677 dwServiceFlags3 As DWord 678 dwServiceFlags4 As DWord 679 dwProviderFlags As DWord 680 ProviderId As GUID 681 dwCatalogEntryId As DWord 682 ProtocolChain As WSAPROTOCOLCHAIN 683 iVersion As Long 684 iAddressFamily As Long 685 iMaxSockAddr As Long 686 iMinSockAddr As Long 687 iSocketType As Long 688 iProtocol As Long 689 iProtocolMaxOffset As Long 690 iNetworkByteOrder As Long 691 iSecurityScheme As Long 692 dwMessageSize As DWord 693 dwProviderReserved As DWord 694 szProtocol[WSAPROTOCOL_LEN] As WCHAR 695 End Type 696 TypeDef LPWSAPROTOCOL_INFOW = *WSAPROTOCOL_INFOW 697 698 #ifdef UNICODE 699 TypeDef WSAPROTOCOL_INFO = WSAPROTOCOL_INFOW 700 TypeDef LPWSAPROTOCOL_INFO = LPWSAPROTOCOL_INFOW 701 #else 702 TypeDef WSAPROTOCOL_INFO = WSAPROTOCOL_INFOA 703 TypeDef LPWSAPROTOCOL_INFO = LPWSAPROTOCOL_INFOA 704 #endif 705 706 ' Flag bit definitions for dwProviderFlags 707 Const PFL_MULTIPLE_PROTO_ENTRIES = &h00000001 708 Const PFL_RECOMMENDED_PROTO_ENTRY = &h00000002 709 Const PFL_HIDDEN = &h00000004 710 Const PFL_MATCHES_PROTOCOL_ZERO = &h00000008 711 712 ' Flag bit definitions for dwServiceFlags1 713 Const XP1_CONNECTIONLESS = &h00000001 714 Const XP1_GUARANTEED_DELIVERY = &h00000002 715 Const XP1_GUARANTEED_ORDER = &h00000004 716 Const XP1_MESSAGE_ORIENTED = &h00000008 717 Const XP1_PSEUDO_STREAM = &h00000010 718 Const XP1_GRACEFUL_CLOSE = &h00000020 719 Const XP1_EXPEDITED_DATA = &h00000040 720 Const XP1_CONNECT_DATA = &h00000080 721 Const XP1_DISCONNECT_DATA = &h00000100 722 Const XP1_SUPPORT_BROADCAST = &h00000200 723 Const XP1_SUPPORT_MULTIPOINT = &h00000400 724 Const XP1_MULTIPOINT_CONTROL_PLANE = &h00000800 725 Const XP1_MULTIPOINT_DATA_PLANE = &h00001000 726 Const XP1_QOS_SUPPORTED = &h00002000 727 Const XP1_INTERRUPT = &h00004000 728 Const XP1_UNI_SEND = &h00008000 729 Const XP1_UNI_RECV = &h00010000 730 Const XP1_IFS_HANDLES = &h00020000 731 Const XP1_PARTIAL_MESSAGE = &h00040000 732 733 Const BIGENDIAN = &h0000 734 Const LITTLEENDIAN = &h0001 735 736 Const SECURITY_PROTOCOL_NONE = &h0000 737 738 ' WinSock 2 extension -- manifest constants for WSAJoinLeaf() 739 Const JL_SENDER_ONLY = &h01 740 Const JL_RECEIVER_ONLY = &h02 741 Const JL_BOTH = &h04 742 743 ' WinSock 2 extension -- manifest constants for WSASocket() 744 Const WSA_FLAG_OVERLAPPED = &h01 745 Const WSA_FLAG_MULTIPOINT_C_ROOT = &h02 746 Const WSA_FLAG_MULTIPOINT_C_LEAF = &h04 747 Const WSA_FLAG_MULTIPOINT_D_ROOT = &h08 748 Const WSA_FLAG_MULTIPOINT_D_LEAF = &h10 749 750 ' WinSock 2 extension -- manifest constants for WSAIoctl() 751 Const IOC_UNIX = &h00000000 752 Const IOC_WS2 = &h08000000 753 Const IOC_PROTOCOL = &h10000000 754 Const IOC_VENDOR = &h18000000 755 756 Const _WSAIO(x, y) = (IOC_VOID Or (x) Or (y)) 757 Const _WSAIOR(x, y) = (IOC_OUT Or (x) Or (y)) 758 Const _WSAIOW(x, y) = (IOC_IN Or (x) Or (y)) 759 Const _WSAIORW(x, y) = (IOC_INOUT Or (x) Or (y)) 760 761 Const SIO_ASSOCIATE_HANDLE = _WSAIOW(IOC_WS2, 1) 762 Const SIO_ENABLE_CIRCULAR_QUEUEING = _WSAIO(IOC_WS2, 2) 763 Const SIO_FIND_ROUTE = _WSAIOR(IOC_WS2, 3) 764 Const SIO_FLUSH = _WSAIO(IOC_WS2, 4) 765 Const SIO_GET_BROADCAST_ADDRESS = _WSAIOR(IOC_WS2, 5) 766 Const SIO_GET_EXTENSION_FUNCTION_POINTER = _WSAIORW(IOC_WS2, 6) 767 Const SIO_GET_QOS = _WSAIORW(IOC_WS2, 7) 768 Const SIO_GET_GROUP_QOS = _WSAIORW(IOC_WS2, 8) 769 Const SIO_MULTIPOINT_LOOPBACK = _WSAIOW(IOC_WS2, 9) 770 Const SIO_MULTICAST_SCOPE = _WSAIOW(IOC_WS2, 10) 771 Const SIO_SET_QOS = _WSAIOW(IOC_WS2, 11) 772 Const SIO_SET_GROUP_QOS = _WSAIOW(IOC_WS2, 12) 773 Const SIO_TRANSLATE_HANDLE = _WSAIORW(IOC_WS2, 13) 774 Const SIO_ROUTING_INTERFACE_QUERY = _WSAIORW(IOC_WS2, 20) 775 Const SIO_ROUTING_INTERFACE_CHANGE = _WSAIOW(IOC_WS2, 21) 776 Const SIO_ADDRESS_LIST_QUERY = _WSAIOR(IOC_WS2, 22) 777 Const SIO_ADDRESS_LIST_CHANGE = _WSAIO(IOC_WS2, 23) 778 Const SIO_QUERY_TARGET_PNP_HANDLE = _WSAIOR(IOC_WS2, 24) 779 Const SIO_ADDRESS_LIST_SORT = _WSAIORW(IOC_WS2, 25) 780 781 ' WinSock 2 extensions -- data types for the condition function in 782 ' WSAAccept() and overlapped I/O completion routine. 783 784 TypeDef LPCONDITIONPROC = *Function( 785 ByRef CallerId As WSABUF, 786 ByRef CallerData As WSABUF, 787 ByRef lpSQOS As QOS, 788 ByRef lpGQOS As QOS, 789 ByRef lpCalleeId As WSABUF, 790 ByRef lpCalleeData As WSABUF, 791 ByRef g As GROUP, 792 dwCallbackData As ULONG_PTR 793 ) As Long 794 795 TypeDef LPWSAOVERLAPPED_COMPLETION_ROUTINE = *Sub( 796 dwError As DWord, 797 cbTransferred As DWord, 798 ByRef Overlapped As WSAOVERLAPPED, 799 dwFlags As DWord) 800 801 ' WinSock 2 extension -- manifest constants and associated structures 802 ' for WSANSPIoctl() 803 Const SIO_NSP_NOTIFY_CHANGE = _WSAIOW(IOC_WS2, 25) 804 805 Const Enum WSACOMPLETIONTYPE 806 NSP_NOTIFY_IMMEDIATELY = 0 807 NSP_NOTIFY_HWND 808 NSP_NOTIFY_EVENT 809 NSP_NOTIFY_PORT 810 NSP_NOTIFY_APC 811 End Enum 812 813 TypeDef PWSACOMPLETIONTYPE = *WSACOMPLETIONTYPE 814 TypeDef LPWSACOMPLETIONTYPE = *WSACOMPLETIONTYPE 815 816 Type _System_WinSock_WSACOMPLETION_WINDOWMESSAGE 817 hWnd As HWND 818 uMsg As DWord 819 context As WPARAM 820 End Type 821 822 Type _System_WinSock_WSACOMPLETION_EVENT 823 lpOverlapped As LPWSAOVERLAPPED 824 End Type 825 826 Type _System_WinSock_WSACOMPLETION_APC 827 lpOverlapped As LPWSAOVERLAPPED 828 lpfnCompletionProc As LPWSAOVERLAPPED_COMPLETION_ROUTINE 829 End Type 830 831 Type _System_WinSock_WSACOMPLETION_PORT 832 lpOverlapped As LPWSAOVERLAPPED 833 hPort As HANDLE 834 Key As ULONG_PTR 835 End Type 836 837 Class WSACOMPLETION 838 Public 839 Type_ As WSACOMPLETIONTYPE 840 /* 841 Parameters As Union 842 WindowMessage As _System_WinSock_WSACOMPLETION_WINDOWMESSAGE 843 Event As _System_WinSock_WSACOMPLETION_EVENT 844 Apc As _System_WinSock_WSACOMPLETION_APC 845 Port As _System_WinSock_WSACOMPLETION_PORT 846 End Union 847 */ 848 Port As _System_WinSock_WSACOMPLETION_PORT 849 850 Function WindowMessage() As _System_WinSock_WSACOMPLETION_WINDOWMESSAGE 851 Dim p As *_System_WinSock_WSACOMPLETION_WINDOWMESSAGE 852 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_WINDOWMESSAGE 853 Return p[0] 854 End Function 855 856 Sub WindowMessage(w As _System_WinSock_WSACOMPLETION_WINDOWMESSAGE) 857 Dim p As *_System_WinSock_WSACOMPLETION_WINDOWMESSAGE 858 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_WINDOWMESSAGE 859 p[0] = w 860 End Sub 861 862 Function Event() As _System_WinSock_WSACOMPLETION_EVENT 863 Dim p As *_System_WinSock_WSACOMPLETION_EVENT 864 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_EVENT 865 Return p[0] 866 End Function 867 868 Sub Event(e As _System_WinSock_WSACOMPLETION_EVENT) 869 Dim p As *_System_WinSock_WSACOMPLETION_EVENT 870 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_EVENT 871 p[0] = e 872 End Sub 873 874 Function Apc() As _System_WinSock_WSACOMPLETION_APC 875 Dim p As *_System_WinSock_WSACOMPLETION_APC 876 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_APC 877 Return p[0] 878 End Function 879 880 Sub Apc(a As _System_WinSock_WSACOMPLETION_APC) 881 Dim p As *_System_WinSock_WSACOMPLETION_APC 882 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_APC 883 p[0] = a 884 End Sub 885 /* 886 Function Port() As _System_WinSock_WSACOMPLETION_PORT 887 Dim p As *_System_WinSock_WSACOMPLETION_PORT 888 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_PORT 889 Return p[0] 890 End Function 891 892 Sub Port(p As _System_WinSock_WSACOMPLETION_PORT) 893 Dim p As *_System_WinSock_WSACOMPLETION_PORT 894 p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_PORT 895 p[0] = p 896 End Sub 897 */ 898 End Class 899 900 TypeDef PWSACOMPLETION = *WSACOMPLETION 901 TypeDef LPWSACOMPLETION = *WSACOMPLETION 902 903 ' WinSock 2 extension -- manifest constants for SIO_TRANSLATE_HANDLE ioctl 904 Const TH_NETDEV = &h00000001 905 Const TH_TAPI = &h00000002 906 907 TypeDef SOCKADDR = sockaddr 908 TypeDef PSOCKADDR = *sockaddr 909 TypeDef LPSOCKADDR = *sockaddr 910 911 TypeDef SOCKADDR_STORAGE = sockaddr_storage 912 TypeDef PSOCKADDR_STORAGE = *sockaddr_storage 913 TypeDef LPSOCKADDR_STORAGE = *sockaddr_storage 914 915 ' Manifest constants and type definitions related to name resolution and 916 ' registration (RNR) API 917 918 #ifndef _tagBLOB_DEFINED 919 #define _tagBLOB_DEFINED 920 #define _BLOB_DEFINED 921 #define _LPBLOB_DEFINED 922 Type BLOB 923 cbSize As DWord 924 #ifdef MIDL_PASS 925 [size_is(cbSize)] pBlobData As *Byte 926 #else 927 pBlobData As *Byte 928 #endif 929 End Type 930 TypeDef LPBLOB = *BLOB 931 #endif 932 933 ' Service Install Flags 934 Const SERVICE_MULTIPLE = (&h00000001) 935 936 ' Name Spaces 937 938 Const NS_ALL = (0) 939 940 Const NS_SAP = (1) 941 Const NS_NDS = (2) 942 Const NS_PEER_BROWSE = (3) 943 Const NS_SLP = (5) 944 Const NS_DHCP = (6) 945 946 Const NS_TCPIP_LOCAL = (10) 947 Const NS_TCPIP_HOSTS = (11) 948 Const NS_DNS = (12) 949 Const NS_NETBT = (13) 950 Const NS_WINS = (14) 951 Const NS_NLA = (15) 952 953 Const NS_NBP = (20) 954 955 Const NS_MS = (30) 956 Const NS_STDA = (31) 957 Const NS_NTDS = (32) 958 959 Const NS_X500 = (40) 960 Const NS_NIS = (41) 961 Const NS_NISPLUS = (42) 962 963 Const NS_WRQ = (50) 964 965 Const NS_NETDES = (60) 966 967 ' Resolution flags for WSAGetAddressByName(). 968 Const RES_UNUSED_1 = (&h00000001) 969 Const RES_FLUSH_CACHE = (&h00000002) 970 #ifndef RES_SERVICE 971 #define RES_SERVICE 972 Const RES_SERVICE = (&h00000004) 973 #endif /* RES_SERVICE */ 974 975 ' Well known value names for Service Types 976 977 Const SERVICE_TYPE_VALUE_IPXPORTA = "IpxSocket" 978 'Const SERVICE_TYPE_VALUE_IPXPORTW = L"IpxSocket" 979 Const SERVICE_TYPE_VALUE_SAPIDA = "SapId" 980 'Const SERVICE_TYPE_VALUE_SAPIDW = L"SapId" 981 982 Const SERVICE_TYPE_VALUE_TCPPORTA = "TcpPort" 983 'Const SERVICE_TYPE_VALUE_TCPPORTW = L"TcpPort" 984 985 Const SERVICE_TYPE_VALUE_UDPPORTA = "UdpPort" 986 'Const SERVICE_TYPE_VALUE_UDPPORTW = L"UdpPort" 987 988 Const SERVICE_TYPE_VALUE_OBJECTIDA = "ObjectId" 989 'Const SERVICE_TYPE_VALUE_OBJECTIDW = L"ObjectId" 990 991 #ifdef UNICODE 992 /* 993 Const SERVICE_TYPE_VALUE_SAPID = SERVICE_TYPE_VALUE_SAPIDW 994 Const SERVICE_TYPE_VALUE_TCPPORT = SERVICE_TYPE_VALUE_TCPPORTW 995 Const SERVICE_TYPE_VALUE_UDPPORT = SERVICE_TYPE_VALUE_UDPPORTW 996 Const SERVICE_TYPE_VALUE_OBJECTID = SERVICE_TYPE_VALUE_OBJECTIDW 997 */ 998 #else 999 1000 Const SERVICE_TYPE_VALUE_SAPID = SERVICE_TYPE_VALUE_SAPIDA 1001 Const SERVICE_TYPE_VALUE_TCPPORT = SERVICE_TYPE_VALUE_TCPPORTA 1002 Const SERVICE_TYPE_VALUE_UDPPORT = SERVICE_TYPE_VALUE_UDPPORTA 1003 Const SERVICE_TYPE_VALUE_OBJECTID = SERVICE_TYPE_VALUE_OBJECTIDA 1004 1005 #endif 1006 1007 #ifndef __CSADDR_DEFINED__ 1008 #define __CSADDR_DEFINED__ 1009 1010 ' SockAddr Information 1011 Type SOCKET_ADDRESS 1012 lpSockaddr As LPSOCKADDR 1013 iSockaddrLength As Long 1014 End Type 1015 TypeDef PSOCKET_ADDRESS = *SOCKET_ADDRESS 1016 TypeDef LPSOCKET_ADDRESS = *SOCKET_ADDRESS 1017 1018 ' CSAddr Information 1019 Type CSADDR_INFO 1020 LocalAddr As SOCKET_ADDRESS 1021 RemoteAddr As SOCKET_ADDRESS 1022 iSocketType As Long 1023 iProtocol As Long 1024 End Type 1025 TypeDef PCSADDR_INFO = *CSADDR_INFO 1026 TypeDef LPCSADDR_INFO = *CSADDR_INFO 1027 #endif 1028 1029 ' Address list returned via SIO_ADDRESS_LIST_QUERY 1030 Type SOCKET_ADDRESS_LIST 1031 iAddressCount As Long 1032 Address[ELM(1)] As SOCKET_ADDRESS 1033 End Type 1034 TypeDef LPSOCKET_ADDRESS_LIST = *SOCKET_ADDRESS_LIST 1035 1036 ' Address Family/Protocol Tuples 1037 Type AFPROTOCOLS 1038 iAddressFamily As Long 1039 iProtocol As Long 1040 End Type 1041 TypeDef PAFPROTOCOLS = *AFPROTOCOLS 1042 TypeDef LPAFPROTOCOLS = *AFPROTOCOLS 1043 1044 ' Client Query API Typedefs 1045 1046 ' The comparators 1047 Const Enum WSAECOMPARATOR 1048 COMP_EQUAL = 0 1049 COMP_NOTLESS 1050 End Enum 1051 TypeDef PWSAECOMPARATOR = *WSAECOMPARATOR 1052 TypeDef LPWSAECOMPARATOR = *WSAECOMPARATOR 1053 1054 Type WSAVERSION 1055 dwVersion As DWord 1056 ecHow As WSAECOMPARATOR 1057 End Type 1058 TypeDef PWSAVERSION = *WSAVERSION 1059 TypeDef LPWSAVERSION = *WSAVERSION 1060 1061 Type WSAQUERYSETA 1062 dwSize As DWord 1063 lpszServiceInstanceName As LPSTR 1064 lpServiceClassId As *GUID 1065 lpVersion As LPWSAVERSION 1066 lpszComment As LPSTR 1067 dwNameSpace As DWord 1068 lpNSProviderId As *GUID 1069 lpszContext As LPSTR 1070 dwNumberOfProtocols As DWord 1071 lpafpProtocols As LPAFPROTOCOLS 1072 lpszQueryString As LPSTR 1073 dwNumberOfCsAddrs As DWord 1074 lpcsaBuffer As LPCSADDR_INFO 1075 dwOutputFlags As DWord 1076 lpBlob As LPBLOB 1077 End Type 1078 TypeDef PWSAQUERYSETA = *WSAQUERYSETA 1079 TypeDef LPWSAQUERYSETA = *WSAQUERYSETA 1080 1081 Type WSAQUERYSETW 1082 dwSize As DWord 1083 lpszServiceInstanceName As LPWSTR 1084 lpServiceClassId As *GUID 1085 lpVersion As LPWSAVERSION 1086 lpszComment As LPWSTR 1087 dwNameSpace As DWord 1088 lpNSProviderId As *GUID 1089 lpszContext As LPWSTR 1090 dwNumberOfProtocols As DWord 1091 lpafpProtocols As LPAFPROTOCOLS 1092 lpszQueryString As LPWSTR 1093 dwNumberOfCsAddrs As DWord 1094 lpcsaBuffer As LPCSADDR_INFO 1095 dwOutputFlags As DWord 1096 lpBlob As LPBLOB 1097 End Type 1098 TypeDef PWSAQUERYSETW = *WSAQUERYSETW 1099 TypeDef LPWSAQUERYSETW = *WSAQUERYSETW 1100 1101 #ifdef UNICODE 1102 TypeDef WSAQUERYSET = WSAQUERYSETW 1103 TypeDef PWSAQUERYSET = PWSAQUERYSETW 1104 TypeDef LPWSAQUERYSET = LPWSAQUERYSETW 1105 #else 1106 TypeDef WSAQUERYSET = WSAQUERYSETA 1107 TypeDef PWSAQUERYSET = PWSAQUERYSETA 1108 TypeDef LPWSAQUERYSET = LPWSAQUERYSETA 1109 #endif 1110 1111 Const LUP_DEEP = &h0001 1112 Const LUP_CONTAINERS = &h0002 1113 Const LUP_NOCONTAINERS = &h0004 1114 Const LUP_NEAREST = &h0008 1115 Const LUP_RETURN_NAME = &h0010 1116 Const LUP_RETURN_TYPE = &h0020 1117 Const LUP_RETURN_VERSION = &h0040 1118 Const LUP_RETURN_COMMENT = &h0080 1119 Const LUP_RETURN_ADDR = &h0100 1120 Const LUP_RETURN_BLOB = &h0200 1121 Const LUP_RETURN_ALIASES = &h0400 1122 Const LUP_RETURN_QUERY_STRING = &h0800 1123 Const LUP_RETURN_ALL = &h0FF0 1124 Const LUP_RES_SERVICE = &h8000 1125 1126 Const LUP_FLUSHCACHE = &h1000 1127 Const LUP_FLUSHPREVIOUS = &h2000 1128 1129 ' Return flags 1130 Const RESULT_IS_ALIAS = &h0001 1131 Const RESULT_IS_ADDED = &h0010 1132 Const RESULT_IS_CHANGED = &h0020 1133 Const RESULT_IS_DELETED = &h0040 1134 1135 ' Service Address Registration and Deregistration Data Types. 1136 1137 Const Enum WSAESETSERVICEOP 1138 RNRSERVICE_REGISTER = 0 1139 RNRSERVICE_DEREGISTER 1140 RNRSERVICE_DELETE 1141 End Enum 1142 TypeDef PWSAESETSERVICEOP = *WSAESETSERVICEOP 1143 TypeDef LPWSAESETSERVICEOP = *WSAESETSERVICEOP 1144 1145 ' Service Installation/Removal Data Types. 1146 1147 Type WSANSCLASSINFOA 1148 lpszName As LPSTR 1149 dwNameSpace As DWord 1150 dwValueType As DWord 1151 dwValueSize As DWord 1152 lpValue As VoidPtr 1153 End Type 1154 TypeDef PWSANSCLASSINFOA = *WSANSCLASSINFOA 1155 TypeDef LPWSANSCLASSINFOA = *WSANSCLASSINFOA 1156 1157 Type WSANSCLASSINFOW 1158 lpszName As LPWSTR 1159 dwNameSpace As DWord 1160 dwValueType As DWord 1161 dwValueSize As DWord 1162 lpValue As VoidPtr 1163 End Type 1164 TypeDef PWSANSCLASSINFOW = *WSANSCLASSINFOW 1165 TypeDef LPWSANSCLASSINFOW = *WSANSCLASSINFOW 1166 1167 #ifdef UNICODE 1168 TypeDef WSANSCLASSINFO = WSANSCLASSINFOW 1169 TypeDef PWSANSCLASSINFO = PWSANSCLASSINFOW 1170 TypeDef LPWSANSCLASSINFO = LPWSANSCLASSINFOW 1171 #else 1172 TypeDef WSANSCLASSINFO = WSANSCLASSINFOA 1173 TypeDef PWSANSCLASSINFO = PWSANSCLASSINFOA 1174 TypeDef LPWSANSCLASSINFO = LPWSANSCLASSINFOA 1175 #endif 1176 1177 Type WSASERVICECLASSINFOA 1178 lpServiceClassId As *GUID 1179 lpszServiceClassName As LPSTR 1180 dwCount As DWord 1181 lpClassInfos As LPWSANSCLASSINFOA 1182 End Type 1183 TypeDef PWSASERVICECLASSINFOA = *WSASERVICECLASSINFOA 1184 TypeDef LPWSASERVICECLASSINFOA = *WSASERVICECLASSINFOA 1185 1186 Type WSASERVICECLASSINFOW 1187 lpServiceClassId As *GUID 1188 lpszServiceClassName As LPWSTR 1189 dwCount As DWord 1190 lpClassInfos As LPWSANSCLASSINFOA 1191 End Type 1192 TypeDef PWSASERVICECLASSINFOW = *WSASERVICECLASSINFOW 1193 TypeDef LPWSASERVICECLASSINFOW = *WSASERVICECLASSINFOW 1194 1195 #ifdef UNICODE 1196 TypeDef WSASERVICECLASSINFO = WSASERVICECLASSINFOW 1197 TypeDef PWSASERVICECLASSINFO = PWSASERVICECLASSINFOW 1198 TypeDef LPWSASERVICECLASSINFO = LPWSASERVICECLASSINFOW 1199 #else 1200 TypeDef WSASERVICECLASSINFO = WSASERVICECLASSINFOA 1201 TypeDef PWSASERVICECLASSINFO = PWSASERVICECLASSINFOA 1202 TypeDef LPWSASERVICECLASSINFO = LPWSASERVICECLASSINFOA 1203 #endif 1204 1205 Type WSANAMESPACE_INFOA 1206 NSProviderId As GUID 1207 dwNameSpace As DWord 1208 fActive As BOOL 1209 dwVersion As DWord 1210 lpszIdentifier As LPSTR 1211 End Type 1212 TypeDef PWSANAMESPACE_INFOA = *WSANAMESPACE_INFOA 1213 TypeDef LPWSANAMESPACE_INFOA = *WSANAMESPACE_INFOA 1214 1215 Type WSANAMESPACE_INFOW 1216 NSProviderId As GUID 1217 dwNameSpace As DWord 1218 fActive As BOOL 1219 dwVersion As DWord 1220 lpszIdentifier As LPWSTR 1221 End Type 1222 TypeDef PWSANAMESPACE_INFOW = *WSANAMESPACE_INFOW 1223 TypeDef LPWSANAMESPACE_INFOW = *WSANAMESPACE_INFOW 1224 1225 #ifdef UNICODE 1226 TypeDef WSANAMESPACE_INFO = WSANAMESPACE_INFOW 1227 TypeDef PWSANAMESPACE_INFO = PWSANAMESPACE_INFOW 1228 TypeDef LPWSANAMESPACE_INFO = LPWSANAMESPACE_INFOW 1229 #else 1230 TypeDef WSANAMESPACE_INFO = WSANAMESPACE_INFOA 1231 TypeDef PWSANAMESPACE_INFO = PWSANAMESPACE_INFOA 1232 TypeDef LPWSANAMESPACE_INFO = LPWSANAMESPACE_INFOA 1233 #endif 1234 1235 ' Socket function prototypes 1236 1237 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1238 Declare Function accept Lib "ws2_32" (s As SOCKET, ByRef addr As sockaddr, ByRef addrlen As Long) As SOCKET 1239 #endif 1240 1241 #ifdef INCL_WINSOCK_API_TYPEDEFS 1242 TypeDef LPFN_ACCEPT = *Function(s As SOCKET, ByRef addr As sockaddr, ByRef addrlen As Long) As SOCKET 1243 #endif 1244 1245 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1246 Declare Function bind Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, addrlen As Long) As Long 1247 #endif 1248 1249 #ifdef INCL_WINSOCK_API_TYPEDEFS 1250 TypeDef LPFN_BIND = *Function(s As SOCKET, ByRef name As sockaddr, addrlen As Long) As Long 1251 #endif 1252 1253 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1254 Declare Function closesocket Lib "ws2_32" (s As SOCKET) As Long 1255 #endif 1256 1257 #ifdef INCL_WINSOCK_API_TYPEDEFS 1258 TypeDef LPFN_CLOSESOCKET = *Function(s As SOCKET) As Long 1259 #endif 1260 1261 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1262 Declare Function connect Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, namelen As Long) As Long 1263 #endif 1264 1265 #ifdef INCL_WINSOCK_API_TYPEDEFS 1266 TypeDef LPFN_CONNECT = *Function(s As SOCKET, ByRef name As sockaddr, namelen As Long) As Long 1267 #endif 1268 1269 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1270 Declare Function ioctlsocket Lib "ws2_32" (s As SOCKET, cmd As Long, ByRef argp As DWord) As Long 1271 #endif 1272 1273 #ifdef INCL_WINSOCK_API_TYPEDEFS 1274 TypeDef LPFN_IOCTLSOCKET = *Function(s As SOCKET, cmd As Long, ByRef argp As DWord) As Long 1275 #endif 1276 1277 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1278 Declare Function getpeername Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, ByRef namelen As Long) As Long 1279 #endif 1280 1281 #ifdef INCL_WINSOCK_API_TYPEDEFS 1282 TypeDef LPFN_GETPEERNAME = *Function(s As SOCKET, ByRef name As sockaddr, ByRef namelen As Long) As Long 1283 #endif 1284 1285 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1286 Declare Function getsockname Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, ByRef namelen As Long) As Long 1287 #endif 1288 1289 #ifdef INCL_WINSOCK_API_TYPEDEFS 1290 TypeDef LPFN_GETSOCKNAME = *Function(s As SOCKET, ByRef name As sockaddr, ByRef namelen As Long) As Long 1291 #endif 1292 1293 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1294 Declare Function getsockopt Lib "ws2_32" (s As SOCKET, level As Long, optname As Long, optval As *Byte, ByRef optlen As Long) As Long 1295 #endif 1296 1297 #ifdef INCL_WINSOCK_API_TYPEDEFS 1298 TypeDef LPFN_GETSOCKOPT = *Function(s As SOCKET, level As Long, optname As Long, optval As *Byte, ByRef optlen As Long) As Long 1299 #endif 1300 1301 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1302 Declare Function htonl Lib "ws2_32" (hostlong As DWord) As DWord 1303 #endif 1304 1305 #ifdef INCL_WINSOCK_API_TYPEDEFS 1306 TypeDef LPFN_HTONL = *Function(hostlong As DWord) As DWord 1307 #endif 1308 1309 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1310 Declare Function htons Lib "ws2_32" (hostshort As Word) As Word 1311 #endif 1312 1313 #ifdef INCL_WINSOCK_API_TYPEDEFS 1314 TypeDef LPFN_HTONS = *Function(hostshort As Word) As Word 1315 #endif 1316 1317 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1318 Declare Function inet_addr Lib "ws2_32" (cp As *Byte) As DWord 1319 #endif 1320 1321 #ifdef INCL_WINSOCK_API_TYPEDEFS 1322 TypeDef LPFN_INET_ADDR = *Function(cp As *Byte) As DWord 1323 #endif 1324 1325 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1326 Declare Function inet_ntoa Lib "ws2_32" (in As in_addr) As *Byte 1327 #endif 1328 1329 #ifdef INCL_WINSOCK_API_TYPEDEFS 1330 TypeDef LPFN_INET_NTOA = *Function(in As in_addr) As *Byte 1331 #endif 1332 1333 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1334 Declare Function listen Lib "ws2_32" (s As SOCKET, backlog As Long) As Long 1335 #endif 1336 1337 #ifdef INCL_WINSOCK_API_TYPEDEFS 1338 TypeDef LPFN_LISTEN = *Function(s As SOCKET, backlog As Long) As Long 1339 #endif 1340 1341 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1342 Declare Function ntohl Lib "ws2_32" (netlong As DWord) As DWord 1343 #endif 1344 1345 #ifdef INCL_WINSOCK_API_TYPEDEFS 1346 TypeDef LPFN_NTOHL = *Function(netlong As DWord) As DWord 1347 #endif 1348 1349 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1350 Declare Function ntohs Lib "ws2_32" (netshort As Word) As Word 1351 #endif 1352 1353 #ifdef INCL_WINSOCK_API_TYPEDEFS 1354 TypeDef LPFN_NTOHS = *Function(netshort As Word) As Word 1355 #endif 1356 1357 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1358 Declare Function recv Lib "ws2_32" (s As SOCKET, buf As *Byte, len As Long, flags As Long) As Long 1359 #endif 1360 1361 #ifdef INCL_WINSOCK_API_TYPEDEFS 1362 TypeDef LPFN_RECV = *Function(s As SOCKET, buf As *Byte, len As Long, flags As Long) As Long 1363 #endif 1364 1365 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1366 Declare Function recvfrom Lib "ws2_32" (s As SOCKET, buf As *Byte, len As Long, flags As Long, ByRef from As sockaddr, ByRef fromlen As Long) As Long 1367 #endif 1368 1369 #ifdef INCL_WINSOCK_API_TYPEDEFS 1370 TypeDef LPFN_RECVFROM = *Function(s As SOCKET, buf As *Byte, len As Long, flags As Long, ByRef from As sockaddr, ByRef fromlen As Long) As Long 1371 #endif 1372 1373 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1374 Declare Function select Lib "ws2_32" (nfds As Long, ByRef readfds As fd_set, ByRef writefds As fd_set, ByRef exceptfds As fd_set, ByRef timeout As timeval) As Long 1375 #endif 1376 1377 #ifdef INCL_WINSOCK_API_TYPEDEFS 1378 TypeDef LPFN_SELECT = *Function(nfds As Long, ByRef readfds As fd_set, ByRef writefds As fd_set, ByRef exceptfds As fd_set, ByRef timeout As timeval) As Long 1379 #endif 1380 1381 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1382 Declare Function send Lib "ws2_32" (s As SOCKET, buf As *Byte, len As Long, flags As Long) As Long 1383 #endif 1384 1385 #ifdef INCL_WINSOCK_API_TYPEDEFS 1386 TypeDef LPFN_SEND = *Function(s As SOCKET, buf As *Byte, len As Long, flags As Long) As Long 1387 #endif 1388 1389 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1390 Declare Function sendto Lib "ws2_32" (s As SOCKET, buf As *Byte, len As Long, flags As Long, ByRef to_ As sockaddr, tolen As Long) As Long 1391 #endif 1392 1393 #ifdef INCL_WINSOCK_API_TYPEDEFS 1394 TypeDef LPFN_SENDTO = *Function(s As SOCKET, buf As *Byte, len As Long, flags As Long, ByRef to_ As sockaddr, tolen As Long) As Long 1395 #endif 1396 1397 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1398 Declare Function setsockopt Lib "ws2_32" (s As SOCKET, level As Long, optname As Long, optval As *Byte, optlen As Long) As Long 1399 #endif 1400 1401 #ifdef INCL_WINSOCK_API_TYPEDEFS 1402 TypeDef LPFN_SETSOCKOPT = *Function(s As SOCKET, level As Long, optname As Long, optval As *Byte, optlen As Long) As Long 1403 #endif 1404 1405 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1406 Declare Function shutdown Lib "ws2_32" (s As SOCKET, how As Long) As Long 1407 #endif 1408 1409 #ifdef INCL_WINSOCK_API_TYPEDEFS 1410 TypeDef LPFN_SHUTDOWN = *Function(s As SOCKET, how As Long) As Long 1411 #endif 1412 1413 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1414 Declare Function socket Lib "ws2_32" (af As Long, type_ As Long, protocol As Long) As SOCKET 1415 #endif 1416 1417 #ifdef INCL_WINSOCK_API_TYPEDEFS 1418 TypeDef LPFN_SOCKET = *Function(af As Long, type_ As Long, protocol As Long) As SOCKET 1419 #endif 1420 1421 ' Database function prototypes 1422 1423 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1424 Declare Function gethostbyaddr Lib "ws2_32" (addr As PCSTR, len As Long, type_ As Long) As *hostent 1425 #endif 1426 1427 #ifdef INCL_WINSOCK_API_TYPEDEFS 1428 TypeDef LPFN_GETHOSTBYADDR = *Function(addr As PCSTR, len As Long, type_ As Long) As *hostent 1429 #endif 1430 1431 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1432 Declare Function gethostbyname Lib "ws2_32" (name As PCSTR) As *hostent 1433 #endif 1434 1435 #ifdef INCL_WINSOCK_API_TYPEDEFS 1436 TypeDef LPFN_GETHOSTBYNAME = *Function(name As PCSTR) As *hostent 1437 #endif 1438 1439 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1440 Declare Function gethostname Lib "ws2_32" (name As PCSTR, namelen As Long) As Long 1441 #endif 1442 1443 #ifdef INCL_WINSOCK_API_TYPEDEFS 1444 TypeDef LPFN_GETHOSTNAME = *Function(name As PCSTR, namelen As Long) As Long 1445 #endif 1446 1447 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1448 Declare Function getservbyport Lib "ws2_32" (port As Long, proto As PCSTR) As *servent 1449 #endif 1450 1451 #ifdef INCL_WINSOCK_API_TYPEDEFS 1452 TypeDef LPFN_GETSERVBYPORT = *Function(port As Long, proto As PCSTR) As *servent 1453 #endif 1454 1455 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1456 Declare Function getservbyname Lib "ws2_32" (name As PCSTR, proto As PCSTR) As *servent 1457 #endif 1458 1459 #ifdef INCL_WINSOCK_API_TYPEDEFS 1460 TypeDef LPFN_GETSERVBYNAME = *Function(name As PCSTR, proto As PCSTR) As *servent 1461 #endif 1462 1463 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1464 Declare Function getprotobynumber Lib "ws2_32" (number As Long) As *protoent 1465 #endif 1466 1467 #ifdef INCL_WINSOCK_API_TYPEDEFS 1468 TypeDef LPFN_GETPROTOBYNUMBER = *Function(number As Long) As *protoent 1469 #endif 1470 1471 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1472 Declare Function getprotobyname Lib "ws2_32" (name As PCSTR) As *protoent 1473 #endif 1474 1475 #ifdef INCL_WINSOCK_API_TYPEDEFS 1476 TypeDef LPFN_GETPROTOBYNAME = (name As PCSTR) As *protoent 1477 #endif 1478 1479 ' Microsoft Windows Extension function prototypes 1480 1481 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1482 Declare Function WSAStartup Lib "ws2_32" (wVersionRequested As Word, ByRef WSAData As WSADATA) As Long 1483 #endif 1484 1485 #ifdef INCL_WINSOCK_API_TYPEDEFS 1486 TypeDef LPFN_WSASTARTUP = *Function(wVersionRequested As Word, ByRef WSAData As WSADATA) As Long 1487 #endif 1488 1489 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1490 Declare Function WSACleanup Lib "ws2_32" () As Long 1491 #endif 1492 1493 #ifdef INCL_WINSOCK_API_TYPEDEFS 1494 TypeDef LPFN_WSACLEANUP = *Function() As Long 1495 #endif 1496 1497 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1498 Declare Sub WSASetLastError Lib "ws2_32" (iError As Long) 1499 #endif 1500 1501 #ifdef INCL_WINSOCK_API_TYPEDEFS 1502 TypeDef LPFN_WSASETLASTERROR = *Sub(iError As Long) 1503 #endif 1504 1505 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1506 Declare Function WSAGetLastError Lib "ws2_32" () As Long 1507 #endif 1508 1509 #ifdef INCL_WINSOCK_API_TYPEDEFS 1510 TypeDef LPFN_WSAGETLASTERROR = *Function() As Long 1511 #endif 1512 1513 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1514 Declare Function WSAIsBlocking Lib "ws2_32" () As BOOL 1515 #endif 1516 1517 #ifdef INCL_WINSOCK_API_TYPEDEFS 1518 TypeDef LPFN_WSAISBLOCKING = *Function() As BOOL 1519 #endif 1520 1521 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1522 Declare Function WSAUnhookBlockingHook Lib "ws2_32" () As Long 1523 #endif 1524 1525 #ifdef INCL_WINSOCK_API_TYPEDEFS 1526 TypeDef LPFN_WSAUNHOOKBLOCKINGHOOK = *Function() As Long 1527 #endif 1528 1529 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1530 Declare Function WSASetBlockingHook Lib "ws2_32" (lpBlockFunc As FARPROC) As FARPROC 1531 1532 #endif 1533 1534 #ifdef INCL_WINSOCK_API_TYPEDEFS 1535 TypeDef LPFN_WSASETBLOCKINGHOOK = *Function(lpBlockFunc As FARPROC) As FARPROC 1536 #endif 1537 1538 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1539 Declare Function WSACancelBlockingCall Lib "ws2_32" () As Long 1540 #endif 1541 1542 #ifdef INCL_WINSOCK_API_TYPEDEFS 1543 TypeDef LPFN_WSACANCELBLOCKINGCALL = *Function() As Long 1544 #endif 1545 1546 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1547 Declare Function WSAAsyncGetServByName Lib "ws2_32" (hwnd As HWND, msg As DWord, name As PCSTR, proto As PCSTR, buf As *Byte, buflen As Long) As HANDLE 1548 #endif 1549 1550 #ifdef INCL_WINSOCK_API_TYPEDEFS 1551 TypeDef LPFN_WSAASYNCGETSERVBYNAME = *Function(hwnd As HWND, msg As DWord, name As PCSTR, proto As PCSTR, buf As *Byte, buflen As Long) As HANDLE 1552 #endif 1553 1554 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1555 Declare Function WSAAsyncGetServByPort Lib "ws2_32" (hwnd As HWND, msg As DWord, port As Long, proto As PCSTR, buf As *Byte, buflen As Long) As HANDLE 1556 #endif 1557 1558 #ifdef INCL_WINSOCK_API_TYPEDEFS 1559 TypeDef LPFN_WSAASYNCGETSERVBYPORT = *Function(hwnd As HWND, msg As DWord, port As Long, proto As PCSTR, buf As *Byte, buflen As Long) As HANDLE 1560 #endif 1561 1562 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1563 Declare Function WSAAsyncGetProtoByName Lib "ws2_32" (hwnd As HWND, msg As DWord, name As PCSTR, buf As *Byte, buflen As Long) As HANDLE 1564 #endif 1565 1566 #ifdef INCL_WINSOCK_API_TYPEDEFS 1567 TypeDef LPFN_WSAASYNCGETPROTOBYNAME = *Function(hwnd As HWND, msg As DWord, name As PCSTR, buf As *Byte, buflen As Long) As HANDLE 1568 #endif 1569 1570 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1571 Declare Function WSAAsyncGetProtoByNumber Lib "ws2_32" (hwnd As HWND, msg As DWord, number As Long, buf As *Byte, buflen As Long) As HANDLE 1572 #endif 1573 1574 #ifdef INCL_WINSOCK_API_TYPEDEFS 1575 TypeDef LPFN_WSAASYNCGETPROTOBYNUMBER = *Function(hwnd As HWND, msg As DWord, number As Long, buf As *Byte, buflen As Long) As HANDLE 1576 #endif 1577 1578 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1579 Declare Function WSAAsyncGetHostByName Lib "ws2_32" (hwnd As HWND, msg As DWord, name As PCSTR, buf As *Byte, buflen As Long) As HANDLE 1580 #endif 1581 1582 #ifdef INCL_WINSOCK_API_TYPEDEFS 1583 TypeDef LPFN_WSAASYNCGETHOSTBYNAME = *Function(hwnd As HWND, msg As DWord, name As PCSTR, buf As *Byte, buflen As Long) As HANDLE 1584 #endif 1585 1586 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1587 Declare Function WSAAsyncGetHostByAddr Lib "ws2_32" (hwnd As HWND, msg As DWord, addr As PCSTR, len As Long, type_ As Long, buf As *Byte, buflen As Long) As HANDLE 1588 #endif 1589 1590 #ifdef INCL_WINSOCK_API_TYPEDEFS 1591 TypeDef LPFN_WSAASYNCGETHOSTBYADDR = *Function(hwnd As HWND, msg As DWord, addr As PCSTR, len As Long, type_ As Long, buf As *Byte, buflen As Long) As HANDLE 1592 #endif 1593 1594 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1595 Declare Function WSACancelAsyncRequest Lib "ws2_32" (hAsyncTaskHandle As HANDLE) As Long 1596 #endif 1597 1598 #ifdef INCL_WINSOCK_API_TYPEDEFS 1599 TypeDef LPFN_WSACANCELASYNCREQUEST = *Function(hAsyncTaskHandle As HANDLE) As Long 1600 #endif 1601 1602 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1603 Declare Function WSAAsyncSelect Lib "ws2_32" (s As SOCKET, hwnd As HWND, msg As DWord, Event As Long) As Long 1604 #endif 1605 1606 #ifdef INCL_WINSOCK_API_TYPEDEFS 1607 TypeDef LPFN_WSAASYNCSELECT = *Function(s As SOCKET, hwnd As HWND, msg As DWord, Event As Long) As Long 1608 #endif 1609 1610 /* WinSock 2 API new function prototypes */ 1611 1612 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1613 Declare Function WSAAccept Lib "ws2_32" (s As SOCKET, ByRef addr As sockaddr, ByRef addrlen As Long, lpfnCondition As LPCONDITIONPROC, CallbackData As ULONG_PTR) As SOCKET 1614 #endif 1615 1616 #ifdef INCL_WINSOCK_API_TYPEDEFS 1617 TypeDef LPFN_WSAACCEPT = *Function(s As SOCKET, ByRef addr As sockaddr, ByRef addrlen As Long, lpfnCondition As LPCONDITIONPROC, CallbackData As ULONG_PTR) As SOCKET 1618 #endif 1619 1620 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1621 Declare Function WSACloseEvent Lib "ws2_32" (hEvent As WSAEVENT) As BOOL 1622 #endif 1623 1624 #ifdef INCL_WINSOCK_API_TYPEDEFS 1625 TypeDef LPFN_WSACLOSEEVENT = *Function(hEvent As WSAEVENT) As BOOL 1626 #endif 1627 1628 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1629 Declare Function WSAConnect Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, namelen As Long, ByRef CallerData As WSABUF, ByRef CalleeData As WSABUF, ByRef SQOS As QOS, ByRef GQOS As QOS) As Long 1630 #endif 1631 1632 #ifdef INCL_WINSOCK_API_TYPEDEFS 1633 TypeDef LPFN_WSACONNECT = *Functions As SOCKET, ByRef name As sockaddr, namelen As Long, ByRef CallerData As WSABUF, ByRef CalleeData As WSABUF, ByRef SQOS As QOS, ByRef GQOS As QOS) As Long 1634 #endif 1635 1636 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1637 Declare Function WSACreateEvent Lib "ws2_32" () As WSAEVENT 1638 #endif 1639 1640 #ifdef INCL_WINSOCK_API_TYPEDEFS 1641 TypeDef LPFN_WSACREATEEVENT = *Function() As WSAEVENT 1642 #endif 1643 1644 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1645 Declare Function WSADuplicateSocketA Lib "ws2_32" (s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA) As Long 1646 Declare Function WSADuplicateSocketW Lib "ws2_32" (s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOW) As Long 1647 #ifdef UNICODE 1648 Declare Function WSADuplicateSocket Lib "ws2_32" Alias "WSADuplicateSocketW" (s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFO) As Long 1649 #else 1650 Declare Function WSADuplicateSocket Lib "ws2_32" Alias "WSADuplicateSocketA" (s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFO) As Long 1651 #endif 1652 #endif 1653 1654 #ifdef INCL_WINSOCK_API_TYPEDEFS 1655 TypeDef LPFN_WSADUPLICATESOCKETA = *Function(s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA) As Long 1656 TypeDef LPFN_WSADUPLICATESOCKETW = *Function(s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOW) As Long 1657 #ifdef UNICODE 1658 TypeDef LPFN_WSADUPLICATESOCKET = LPFN_WSADUPLICATESOCKETW 1659 #else 1660 TypeDef LPFN_WSADUPLICATESOCKET = LPFN_WSADUPLICATESOCKETA 1661 #endif 1662 #endif 1663 1664 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1665 Declare Function WSAEnumNetworkEvents Lib "ws2_32" (s As SOCKET, hEventObject As WSAEVENT, ByRef NetworkEvents As WSANETWORKEVENTS) As Long 1666 #endif 1667 1668 #ifdef INCL_WINSOCK_API_TYPEDEFS 1669 TypeDef LPFN_WSAENUMNETWORKEVENTS = *Function(s As SOCKET, hEventObject As WSAEVENT, ByRef NetworkEvents As WSANETWORKEVENTS) As Long 1670 #endif 1671 1672 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1673 Declare Function WSAEnumProtocolsA Lib "ws2_32" (Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFOA, ByRef BufferLength As DWord) As Long 1674 Declare Function WSAEnumProtocolsW Lib "ws2_32" (Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFOW, ByRef BufferLength As DWord) As Long 1675 #ifdef UNICODE 1676 Declare Function WSAEnumProtocols Lib "ws2_32" Alias "WSAEnumProtocolsW" (Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFO, ByRef BufferLength As DWord) As Long 1677 #else 1678 Declare Function WSAEnumProtocols Lib "ws2_32" Alias "WSAEnumProtocolsA" (Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFO, ByRef BufferLength As DWord) As Long 1679 #endif 1680 #endif 1681 1682 #ifdef INCL_WINSOCK_API_TYPEDEFS 1683 TypeDef LPFN_WSAENUMPROTOCOLSA = *Function(Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFOA, ByRef BufferLength As DWord) As Long 1684 TypeDef LPFN_WSAENUMPROTOCOLSW = *Function(Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFOW, ByRef BufferLength As DWord) As Long 1685 #ifdef UNICODE 1686 TypeDef LPFN_WSAENUMPROTOCOLS = LPFN_WSAENUMPROTOCOLSW 1687 #else 1688 TypeDef LPFN_WSAENUMPROTOCOLS = LPFN_WSAENUMPROTOCOLSA 1689 #endif 1690 #endif 1691 1692 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1693 Declare Function WSAEventSelect Lib "ws2_32" (s As SOCKET, hEventObject As WSAEVENT, NetworkEvents As Long) As Long 1694 #endif 1695 1696 #ifdef INCL_WINSOCK_API_TYPEDEFS 1697 TypeDef LPFN_WSAEVENTSELECT = *Function(s As SOCKET, hEventObject As WSAEVENT, NetworkEvents As Long) As Long 1698 #endif 1699 1700 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1701 Declare Function WSAGetOverlappedResult Lib "ws2_32" (s As SOCKET, ByRef Overlapped As WSAOVERLAPPED, ByRef cbTransfer As DWord, Wait As BOOL, ByRef Flags As DWord) As BOOL 1702 #endif 1703 1704 #ifdef INCL_WINSOCK_API_TYPEDEFS 1705 TypeDef LPFN_WSAGETOVERLAPPEDRESULT = *Function(s As SOCKET, ByRef Overlapped As WSAOVERLAPPED, ByRef cbTransfer As DWord, Wait As BOOL, ByRef Flags As DWord) As BOOL 1706 #endif 1707 1708 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1709 Declare Function WSAGetQOSByName Lib "ws2_32" (s As SOCKET, ByRef QOSName As WSABUF, ByRef qos As QOS) As BOOL 1710 #endif 1711 1712 #ifdef INCL_WINSOCK_API_TYPEDEFS 1713 TypeDef LPFN_WSAGETQOSBYNAME = *Function(s As SOCKET, ByRef QOSName As WSABUF, ByRef qos As QOS) As BOOL 1714 #endif 1715 1716 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1717 Declare Function WSAHtonl Lib "ws2_32" (s As SOCKET, hostlong As DWord, ByRef netlong As DWord) As Long 1718 #endif 1719 1720 #ifdef INCL_WINSOCK_API_TYPEDEFS 1721 TypeDef LPFN_WSAHTONL = *Function(s As SOCKET, hostlong As DWord, ByRef netlong As DWord) As Long 1722 #endif 1723 1724 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1725 Declare Function WSAHtons Lib "ws2_32" (s As SOCKET, hostshort As Word, ByRef netshort As Word) As Long 1726 #endif 1727 1728 #ifdef INCL_WINSOCK_API_TYPEDEFS 1729 TypeDef LPFN_WSAHTONS = *Function(s As SOCKET, hostshort As Word, ByRef netshort As Word) As Long 1730 #endif 1731 1732 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1733 Declare Function WSAIoctl Lib "ws2_32" (s As SOCKET, IoControlCode As DWord, pvInBuffer As VoidPtr, cbInBuffer As DWord, pvOutBuffer As VoidPtr, cbOutBuffer As DWord, 1734 ByRef cbBytesReturned As DWord, ByRef Overlapped As WSAOVERLAPPED, pCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long 1735 #endif 1736 1737 #ifdef INCL_WINSOCK_API_TYPEDEFS 1738 TypeDef LPFN_WSAIOCTL = *Function(s As SOCKET, IoControlCode As DWord, pvInBuffer As VoidPtr, cbInBuffer As DWord, pvOutBuffer As VoidPtr, cbOutBuffer As DWord, 1739 ByRef cbBytesReturned As DWord, ByRef Overlapped As WSAOVERLAPPED, pCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long 1740 #endif 1741 1742 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1743 Declare Function WSAJoinLeaf Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, namelen As Long, ByRef CallerData As WSABUF, ByRef CalleeData As WSABUF, 1744 ByRef SQOS As QOS, ByRef GQOS AS QOS, Flags As DWord) As SOCKET 1745 #endif 1746 1747 #ifdef INCL_WINSOCK_API_TYPEDEFS 1748 TypeDef LPFN_WSAJOINLEAF = *Function(s As SOCKET, ByRef name As sockaddr, namelen As Long, ByRef CallerData As WSABUF, ByRef CalleeData As WSABUF, 1749 ByRef SQOS As QOS, ByRef GQOS AS QOS, Flags As DWord) As SOCKET 1750 #endif 1751 1752 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1753 Declare Function WSANtohl Lib "ws2_32" (s As SOCKET, netlong As DWord, ByRef hostlong As DWord) As Long 1754 #endif 1755 1756 #ifdef INCL_WINSOCK_API_TYPEDEFS 1757 TypeDef LPFN_WSANTOHL = *Function(s As SOCKET, netlong As DWord, ByRef hostlong As DWord) As Long 1758 #endif 1759 1760 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1761 Declare Function WSANtohs Lib "ws2_32" (s As SOCKET, netshort As Word, ByRef hostshort As Word) As Long 1762 #endif 1763 1764 #ifdef INCL_WINSOCK_API_TYPEDEFS 1765 TypeDef LPFN_WSANTOHS = *Function(s As SOCKET, netshort As Word, ByRef hostshort As Word) As Long 1766 #endif 1767 1768 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1769 Declare Function WSARecv Lib "ws2_32" (s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesRecvd As DWord, ByRef Flags As DWord, 1770 ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long 1771 #endif 1772 1773 #ifdef INCL_WINSOCK_API_TYPEDEFS 1774 TypeDef LPFN_WSARECV = *Function(s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesRecvd As DWord, ByRef Flags As DWord, 1775 ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long 1776 #endif 1777 1778 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1779 Declare Function WSARecvDisconnect Lib "ws2_32" (s As SOCKET, ByRef InboundDisconnectData As WSABUF) As Long 1780 #endif 1781 1782 #ifdef INCL_WINSOCK_API_TYPEDEFS 1783 TypeDef LPFN_WSARECVDISCONNECT = *Function(s As SOCKET, ByRef InboundDisconnectData As WSABUF) As Long 1784 #endif 1785 1786 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1787 Declare Function WSARecvFrom Lib "ws2_32" (s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesRecvd As DWord, ByRef Flags As DWord, 1788 ByRef From As sockaddr, ByRef Fromlen As Long, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long 1789 #endif 1790 1791 #ifdef INCL_WINSOCK_API_TYPEDEFS 1792 TypeDef LPFN_WSARECVFROM = *Function(s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesRecvd As DWord, ByRef Flags As DWord, 1793 ByRef From As sockaddr, ByRef Fromlen As Long, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long 1794 #endif 1795 1796 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1797 Declare Function WSAResetEvent Lib "ws2_32" (hEvent As WSAEVENT) As BOOL 1798 #endif 1799 1800 #ifdef INCL_WINSOCK_API_TYPEDEFS 1801 TypeDef LPFN_WSARESETEVENT = *Function(hEvent As WSAEVENT) As BOOL 1802 #endif 1803 1804 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1805 Declare Function WSASend Lib "ws2_32" (s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesSent As DWord, ByRef Flags As DWord, 1806 ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long 1807 #endif 1808 1809 #ifdef INCL_WINSOCK_API_TYPEDEFS 1810 TypeDef LPFN_WSASEND = *Function(s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesSent As DWord, ByRef Flags As DWord, 1811 ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long 1812 #endif 1813 1814 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1815 Declare Function WSASendDisconnect Lib "ws2_32" (s As SOCKET, ByRef OutboundDisconnectData As WSABUF) As Long 1816 #endif 1817 1818 #ifdef INCL_WINSOCK_API_TYPEDEFS 1819 TypeDef LPFN_WSASENDDISCONNECT = *Function(s As SOCKET, ByRef OutboundDisconnectData As WSABUF) As Long 1820 #endif 1821 1822 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1823 Declare Function WSASendTo Lib "ws2_32" (s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesSent As DWord, ByRef Flags As DWord, 1824 ByRef To_ As sockaddr, ToLen As Long, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long 1825 #endif 1826 1827 #ifdef INCL_WINSOCK_API_TYPEDEFS 1828 TypeDef LPFN_WSASENDTO = *Function(s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesSent As DWord, ByRef Flags As DWord, 1829 ByRef To_ As sockaddr, ToLen As Long, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long 1830 #endif 1831 1832 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1833 Declare Function WSASetEvent Lib "ws2_32" (hEvent As WSAEVENT) As BOOL 1834 #endif 1835 1836 #ifdef INCL_WINSOCK_API_TYPEDEFS 1837 TypeDef LPFN_WSASETEVENT = *Function(hEvent As WSAEVENT) As BOOL 1838 #endif 1839 1840 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1841 Declare Function WSASocketA Lib "ws2_32" (af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOA, g As GROUP, Flags As DWord) As SOCKET 1842 Declare Function WSASocketW Lib "ws2_32" (af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOW, g As GROUP, Flags As DWord) As SOCKET 1843 #ifdef UNICODE 1844 Declare Function WSASocket Lib "ws2_32" Alias "WSASocketW" (af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFO, g As GROUP, Flags As DWord) As SOCKET 1845 #else 1846 Declare Function WSASocket Lib "ws2_32" Alias "WSASocketA" (af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFO, g As GROUP, Flags As DWord) As SOCKET 1847 #endif 1848 #endif 1849 1850 #ifdef INCL_WINSOCK_API_TYPEDEFS 1851 TypeDef LPFN_WSASOCKETA = *Function(af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOA, g As GROUP, Flags As DWord) As SOCKET 1852 TypeDef LPFN_WSASOCKETW = *Function(af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOW, g As GROUP, Flags As DWord) As SOCKET 1853 #ifdef UNICODE 1854 TypeDef LPFN_WSASOCKET = LPFN_WSASOCKETW 1855 #else 1856 TypeDef LPFN_WSASOCKET = LPFN_WSASOCKETA 1857 #endif 1858 #endif 1859 1860 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1861 Declare Function WSAWaitForMultipleEvents Lib "ws2_32" (cEvents As DWord, phEvents As *WSAEVENT, WaitAll As BOOL, Timeout As DWord, Alertable As BOOL) As DWord 1862 #endif 1863 1864 #ifdef INCL_WINSOCK_API_TYPEDEFS 1865 TypeDef LPFN_WSAWAITFORMULTIPLEEVENTS = *Function(cEvents As DWord, phEvents As *WSAEVENT, WaitAll As BOOL, Timeout As DWord, Alertable As BOOL) As DWord 1866 #endif 1867 1868 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1869 Declare Function WSAAddressToStringA Lib "ws2_32" (ByRef saAddress As SOCKADDR, AddressLength As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA, 1870 AddressString As PSTR, ByRef dwAddressStringLength As DWord) As Long 1871 Declare Function WSAAddressToStringW Lib "ws2_32" (ByRef saAddress As SOCKADDR, AddressLength As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA, 1872 AddressString As PWSTR, ByRef dwAddressStringLength As DWord) As Long 1873 #ifdef UNICODE 1874 Declare Function WSAAddressToString Lib "ws2_32" Alias "WSAAddressToStringW" (ByRef saAddress As SOCKADDR, AddressLength As DWord, 1875 ByRef ProtocolInfo As WSAPROTOCOL_INFO, AddressString As PSTR, ByRef dwAddressStringLength As DWord) As Long 1876 #else 1877 Declare Function WSAAddressToString Lib "ws2_32" Alias "WSAAddressToStringA" (ByRef saAddress As SOCKADDR, AddressLength As DWord, 1878 ByRef ProtocolInfo As WSAPROTOCOL_INFO, AddressString As PSTR, ByRef dwAddressStringLength As DWord) As Long 1879 #endif 1880 #endif 1881 1882 #ifdef INCL_WINSOCK_API_TYPEDEFS 1883 TypeDef LPFN_WSAADDRESSTOSTRINGA = *Function(ByRef saAddress As SOCKADDR, AddressLength As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA, 1884 AddressString As PSTR, ByRef dwAddressStringLength As DWord) As Long 1885 TypeDef LPFN_WSAADDRESSTOSTRINGW = *Function(ByRef saAddress As SOCKADDR, AddressLength As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA, 1886 AddressString As PWSTR, ByRef dwAddressStringLength As DWord) As Long 1887 #ifdef UNICODE 1888 TypeDef LPFN_WSAADDRESSTOSTRING = LPFN_WSAADDRESSTOSTRINGW 1889 #else 1890 TypeDef LPFN_WSAADDRESSTOSTRING = LPFN_WSAADDRESSTOSTRINGA 1891 #endif 1892 #endif 1893 1894 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1895 Declare Function WSAStringToAddressA Lib "ws2_32" (AddressString As PSTR, AddressFamily As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOA, 1896 ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long 1897 Declare Function WSAStringToAddressW Lib "ws2_32" (AddressString As PWSTR, AddressFamily As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOW, 1898 ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long 1899 #ifdef UNICODE 1900 Declare Function WSAStringToAddress Lib "ws2_32" Alias "WSAStringToAddressW" (AddressString As PSTR, AddressFamily As Long, 1901 ByRef ProtocolInfo As WSAPROTOCOL_INFO, ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long 1902 #else 1903 Declare Function WSAStringToAddress Lib "ws2_32" Alias "WSAStringToAddressA" (AddressString As PSTR, AddressFamily As Long, 1904 ByRef ProtocolInfo As WSAPROTOCOL_INFO, ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long 1905 #endif 1906 #endif 1907 1908 #ifdef INCL_WINSOCK_API_TYPEDEFS 1909 TypeDef LPFN_WSASTRINGTOADDRESSA = *Function(AddressString As PSTR, AddressFamily As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOA, 1910 ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long 1911 TypeDef LPFN_WSASTRINGTOADDRESSW = *Function(AddressString As PWSTR, AddressFamily As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOW, 1912 ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long 1913 #ifdef UNICODE 1914 TypeDef LPFN_WSASTRINGTOADDRESS = LPFN_WSASTRINGTOADDRESSW 1915 #else 1916 TypeDef LPFN_WSASTRINGTOADDRESS = LPFN_WSASTRINGTOADDRESSA 1917 #endif 1918 #endif 1919 1920 ' Registration and Name Resolution API functions 1921 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1922 Declare Function WSALookupServiceBeginA Lib "ws2_32" (ByRef qsRestrictions As WSAQUERYSETA, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long 1923 Declare Function WSALookupServiceBeginW Lib "ws2_32" (ByRef qsRestrictions As WSAQUERYSETW, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long 1924 #ifdef UNICODE 1925 Declare Function WSALookupServiceBegin Lib "ws2_32" Alias "WSALookupServiceBeginW" (ByRef qsRestrictions As WSAQUERYSET, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long 1926 #else 1927 Declare Function WSALookupServiceBegin Lib "ws2_32" Alias "WSALookupServiceBeginA" (ByRef qsRestrictions As WSAQUERYSET, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long 1928 #endif 1929 #endif 1930 1931 #ifdef INCL_WINSOCK_API_TYPEDEFS 1932 TypeDef LPFN_WSALOOKUPSERVICEBEGINA = *Function(ByRef qsRestrictions As WSAQUERYSETA, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long 1933 TypeDef LPFN_WSALOOKUPSERVICEBEGINW = *Function(ByRef qsRestrictions As WSAQUERYSETW, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long 1934 #ifdef UNICODE 1935 TypeDef LPFN_WSALOOKUPSERVICEBEGIN = LPFN_WSALOOKUPSERVICEBEGINW 1936 #else 1937 TypeDef LPFN_WSALOOKUPSERVICEBEGIN = LPFN_WSALOOKUPSERVICEBEGINA 1938 #endif 1939 #endif 1940 1941 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1942 Declare Function WSALookupServiceNextA Lib "ws2_32" (hLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSETA) As Long 1943 Declare Function WSALookupServiceNextW Lib "ws2_32" (hLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSETW) As Long 1944 #ifdef UNICODE 1945 Declare Function WSALookupServiceNext Lib "ws2_32" Alias "WSALookupServiceNextW" (hLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSET) As Long 1946 #else 1947 Declare Function WSALookupServiceNext Lib "ws2_32" Alias "WSALookupServiceNextA" (hLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSET) As Long 1948 #endif 1949 #endif 1950 1951 #ifdef INCL_WINSOCK_API_TYPEDEFS 1952 TypeDef LPFN_WSALOOKUPSERVICENEXTA = *FunctionhLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSETA) As Long 1953 TypeDef LPFN_WSALOOKUPSERVICENEXTW = *FunctionhLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSETW) As Long 1954 #ifdef UNICODE 1955 TypeDef LPFN_WSALOOKUPSERVICENEXT = LPFN_WSALOOKUPSERVICENEXTW 1956 #else 1957 TypeDef LPFN_WSALOOKUPSERVICENEXT = LPFN_WSALOOKUPSERVICENEXTA 1958 #endif 1959 #endif 1960 1961 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1962 Declare Function WSANSPIoctl Lib "ws2_32" (hLookup As HANDLE, ControlCode As DWord, pvInBuffer As VoidPtr, cbInBuffer As DWord, 1963 pvOutBuffer As VoidPtr, cbOutBuffer As DWord, ByRef cbBytesReturned As DWord, ByRef Completion As WSACOMPLETION) As Long 1964 #endif 1965 1966 #ifdef INCL_WINSOCK_API_TYPEDEFS 1967 TypeDef LPFN_WSANSPIOCTL = *Function(hLookup As HANDLE, ControlCode As DWord, pvInBuffer As VoidPtr, cbInBuffer As DWord, 1968 pvOutBuffer As VoidPtr, cbOutBuffer As DWord, ByRef cbBytesReturned As DWord, ByRef Completion As WSACOMPLETION) As Long 1969 #endif 1970 1971 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1972 Declare Function WSALookupServiceEnd Lib "ws2_32" (hLookup As HANDLE) As Long 1973 #endif 1974 1975 #ifdef INCL_WINSOCK_API_TYPEDEFS 1976 TypeDef LPFN_WSALOOKUPSERVICEEND = *Function(hLookup As HANDLE) As Long 1977 #endif 1978 1979 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 1980 Declare Function WSAInstallServiceClassA Lib "ws2_32" (ByRef ServiceClassInfo As WSASERVICECLASSINFOA) As Long 1981 Declare Function WSAInstallServiceClassW Lib "ws2_32" (ByRef ServiceClassInfo As WSASERVICECLASSINFOW) As Long 1982 #ifdef UNICODE 1983 Declare Function WSAInstallServiceClass Lib "ws2_32" Alias "WSAInstallServiceClassW" (ByRef ServiceClassInfo As WSASERVICECLASSINFO) As Long 1984 #else 1985 Declare Function WSAInstallServiceClass Lib "ws2_32" Alias "WSAInstallServiceClassA" (ByRef ServiceClassInfo As WSASERVICECLASSINFO) As Long 1986 #endif 1987 #endif 1988 1989 #ifdef INCL_WINSOCK_API_TYPEDEFS 1990 TypeDef LPFN_WSAINSTALLSERVICECLASSA = *Function(ByRef ServiceClassInfo As WSASERVICECLASSINFOA) As Long 1991 TypeDef LPFN_WSAINSTALLSERVICECLASSW = *Function(ByRef ServiceClassInfo As WSASERVICECLASSINFOW) As Long 1992 #ifdef UNICODE 1993 TypeDef LPFN_WSAINSTALLSERVICECLASS = LPFN_WSAINSTALLSERVICECLASSW 1994 #else 1995 TypeDef LPFN_WSAINSTALLSERVICECLASS = LPFN_WSAINSTALLSERVICECLASSA 1996 #endif 1997 #endif 1998 1999 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 2000 Declare Function WSARemoveServiceClass Lib "ws2_32" (ByRef ServiceClassId As GUID) As Long 2001 #endif 2002 2003 #ifdef INCL_WINSOCK_API_TYPEDEFS 2004 TypeDef LPFN_WSAREMOVESERVICECLASS = *Function(ByRef ServiceClassId As GUID) As Long 2005 #endif 2006 2007 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 2008 Declare Function WSAGetServiceClassInfoA Lib "ws2_32" (ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFOA) As Long 2009 Declare Function WSAGetServiceClassInfoW Lib "ws2_32" (ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFOW) As Long 2010 #ifdef UNICODE 2011 Declare Function WSAGetServiceClassInfo Lib "ws2_32" Alias "WSAGetServiceClassInfoW" (ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFO) As Long 2012 #else 2013 Declare Function WSAGetServiceClassInfo Lib "ws2_32" Alias "WSAGetServiceClassInfoA" (ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFO) As Long 2014 #endif 2015 #endif 2016 2017 #ifdef INCL_WINSOCK_API_TYPEDEFS 2018 TypeDef LPFN_WSAGETSERVICECLASSINFOA = *Function(ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFOA) As Long 2019 TypeDef LPFN_WSAGETSERVICECLASSINFOW = *Function(ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFOW) As Long 2020 #ifdef UNICODE 2021 TypeDef LPFN_WSAGETSERVICECLASSINFO = LPFN_WSAGETSERVICECLASSINFOW 2022 #else 2023 TypeDef LPFN_WSAGETSERVICECLASSINFO = LPFN_WSAGETSERVICECLASSINFOA 2024 #endif 2025 #endif 2026 2027 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 2028 Declare Function WSAEnumNameSpaceProvidersA Lib "ws2_32" (ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFOA) As Long 2029 Declare Function WSAEnumNameSpaceProvidersW Lib "ws2_32" (ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFOW) As Long 2030 #ifdef UNICODE 2031 Declare Function WSAEnumNameSpaceProviders Lib "ws2_32" Alias "WSAEnumNameSpaceProvidersW" (ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFO) As Long 2032 #else 2033 Declare Function WSAEnumNameSpaceProviders Lib "ws2_32" Alias "WSAEnumNameSpaceProvidersA" (ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFO) As Long 2034 #endif 2035 #endif 2036 2037 #ifdef INCL_WINSOCK_API_TYPEDEFS 2038 TypeDef LPFN_WSAENUMNAMESPACEPROVIDERSA = *Function(ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFOA) As Long 2039 TypeDef LPFN_WSAENUMNAMESPACEPROVIDERSW = *Function(ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFOW) As Long 2040 #ifdef UNICODE 2041 TypeDef LPFN_WSAENUMNAMESPACEPROVIDERS = LPFN_WSAENUMNAMESPACEPROVIDERSW 2042 #else 2043 TypeDef LPFN_WSAENUMNAMESPACEPROVIDERS = LPFN_WSAENUMNAMESPACEPROVIDERSA 2044 #endif 2045 #endif 2046 2047 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 2048 Declare Function WSAGetServiceClassNameByClassIdA Lib "ws2_32" (ByRef ServiceClassId As GUID, ServiceClassName As PSTR, ByRef BufferLength As DWord) As Long 2049 Declare Function WSAGetServiceClassNameByClassIdW Lib "ws2_32" (ByRef ServiceClassId As GUID, ServiceClassName As PWSTR, ByRef BufferLength As DWord) As Long 2050 #ifdef UNICODE 2051 Declare Function WSAGetServiceClassNameByClassId Lib "ws2_32" Alias "WSAGetServiceClassNameByClassIdW" (ByRef ServiceClassId As GUID, ServiceClassName As PWSTR, ByRef BufferLength As DWord) As Long 2052 #else 2053 Declare Function WSAGetServiceClassNameByClassId Lib "ws2_32" Alias "WSAGetServiceClassNameByClassIdA" (ByRef ServiceClassId As GUID, ServiceClassName As PSTR, ByRef BufferLength As DWord) As Long 2054 #endif 2055 #endif 2056 2057 #ifdef INCL_WINSOCK_API_TYPEDEFS 2058 TypeDef LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA = *Function(ByRef ServiceClassId As GUID, ServiceClassName As PSTR, ByRef BufferLength As DWord) As Long 2059 TypeDef LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW = *Function(ByRef ServiceClassId As GUID, ServiceClassName As PWSTR, ByRef BufferLength As DWord) As Long 2060 #ifdef UNICODE 2061 TypeDef LPFN_WSAGETSERVICECLASSNAMEBYCLASSID = LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW 2062 #else 2063 TypeDef LPFN_WSAGETSERVICECLASSNAMEBYCLASSID = LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA 2064 #endif 2065 #endif 2066 2067 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 2068 Declare Function WSASetServiceA Lib "ws2_32" (ByRef qsRegInfo As WSAQUERYSETA, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long 2069 Declare Function WSASetServiceW Lib "ws2_32" (ByRef qsRegInfo As WSAQUERYSETW, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long 2070 #ifdef UNICODE 2071 Declare Function WSASetService Lib "ws2_32" Alias "WSASetServiceW" (ByRef qsRegInfo As WSAQUERYSET, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long 2072 #else 2073 Declare Function WSASetService Lib "ws2_32" Alias "WSASetServiceA" (ByRef qsRegInfo As WSAQUERYSET, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long 2074 #endif 2075 #endif 2076 2077 #ifdef INCL_WINSOCK_API_TYPEDEFS 2078 TypeDef LPFN_WSASETSERVICEA = *Function(ByRef qsRegInfo As WSAQUERYSETA, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long 2079 TypeDef LPFN_WSASETSERVICEW = *Function(ByRef qsRegInfo As WSAQUERYSETW, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long 2080 #ifdef UNICODE 2081 TypeDef LPFN_WSASETSERVICE = LPFN_WSASETSERVICEW 2082 #else 2083 TypeDef LPFN_WSASETSERVICE = LPFN_WSASETSERVICEA 2084 #endif 2085 #endif 2086 2087 #ifndef NO_INCL_WINSOCK_API_PROTOTYPES 2088 Declare Function WSAProviderConfigChange Lib "ws2_32" (ByRef NotificationHandle As HANDLE, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long 2089 #endif 2090 2091 #ifdef INCL_WINSOCK_API_TYPEDEFS 2092 TypeDef LPFN_WSAPROVIDERCONFIGCHANGE = *Function(ByRef NotificationHandle As HANDLE, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long 2093 #endif 2094 2095 ' Microsoft Windows Extended data types 2096 TypeDef SOCKADDR_IN = sockaddr_in 2097 TypeDef PSOCKADDR_IN = *sockaddr_in 2098 TypeDef LPSOCKADDR_IN = *sockaddr_in 2099 2100 TypeDef LINGER = linger 2101 TypeDef PLINGER = *linger 2102 TypeDef LPLINGER = *linger 2103 2104 TypeDef IN_ADDR = in_addr 2105 TypeDef PIN_ADDR = *in_addr 2106 TypeDef LPIN_ADDR = *in_addr 2107 2108 TypeDef FD_SET = fd_set 2109 TypeDef PFD_SET = *fd_set 2110 TypeDef LPFD_SET = *fd_set 2111 2112 TypeDef HOSTENT = hostent 2113 TypeDef PHOSTENT = *hostent 2114 TypeDef LPHOSTENT = *hostent 2115 2116 TypeDef SERVENT = servent 2117 TypeDef PSERVENT = *servent 2118 TypeDef LPSERVENT = *servent 2119 2120 TypeDef PROTOENT = protoent 2121 TypeDef PPROTOENT = *protoent 2122 TypeDef LPPROTOENT = *protoent 2123 2124 TypeDef TIMEVAL = timeval 2125 TypeDef PTIMEVAL = *timeval 2126 TypeDef LPTIMEVAL = *timeval 2127 2128 ' Windows message parameter composition and decomposition macros. 2129 Const WSAMAKEASYNCREPLY(buflen, error) = MAKELONG(buflen, error) 2130 Const WSAMAKESELECTREPLY(event, error) = MAKELONG(event, error) 2131 Const WSAGETASYNCBUFLEN(lParam) = LOWORD(lParam) 2132 Const WSAGETASYNCERROR(lParam) = HIWORD(lParam) 2133 Const WSAGETSELECTEVENT(lParam) = LOWORD(lParam) 2134 Const WSAGETSELECTERROR(lParam) = HIWORD(lParam) 2135 2136 #ifdef IPV6STRICT 2137 '#include <wsipv6ok.ab> 2138 #endif 2139 2140 #endif
Note:
See TracChangeset
for help on using the changeset viewer.