source: trunk/src/wsock32/wsock32const.h@ 1372

Last change on this file since 1372 was 1372, checked in by phaller, 26 years ago

Fix: WSA async rewrite

File size: 6.0 KB
Line 
1/* $Id: wsock32const.h,v 1.1 1999-10-20 10:03:55 phaller Exp $ */
2
3/* WSOCK32.H--definitions & conversions for Odin's wsock32.dll.
4 * Unused/unneeded Microsoft declarations removed.
5 *
6 * This header file corresponds to version 1.1 of the Windows Sockets specification.
7 *
8 * This file includes parts which are Copyright (c) 1982-1986 Regents
9 * of the University of California. All rights reserved. The
10 * Berkeley Software License Agreement specifies the terms and
11 * conditions for redistribution.
12 *
13 */
14
15#ifndef _WINSOCK32CONST_
16#define _WINSOCK32CONST_
17
18/*
19 * Definitions related to sockets: types, address families, options,
20 * taken from the BSD file sys/socket.h.
21 */
22
23/*
24 * This is used instead of -1, since the
25 * SOCKET type is unsigned.
26 */
27#define INVALID_SOCKET (SOCKET)(~0)
28#define SOCKET_ERROR (-1)
29
30/*
31 * All Windows Sockets error constants are biased by WSABASEERR from
32 * the "normal"
33 */
34#define WSABASEERR 10000
35/*
36 * Windows Sockets definitions of regular Microsoft C error constants
37 */
38#define WSAEINTR (WSABASEERR+4)
39#define WSAEBADF (WSABASEERR+9)
40#define WSAEACCES (WSABASEERR+13)
41#define WSAEFAULT (WSABASEERR+14)
42#define WSAEINVAL (WSABASEERR+22)
43#define WSAEMFILE (WSABASEERR+24)
44
45/*
46 * Windows Sockets definitions of regular Berkeley error constants
47 */
48#define WSAEWOULDBLOCK (WSABASEERR+35)
49#define WSAEINPROGRESS (WSABASEERR+36)
50#define WSAEALREADY (WSABASEERR+37)
51#define WSAENOTSOCK (WSABASEERR+38)
52#define WSAEDESTADDRREQ (WSABASEERR+39)
53#define WSAEMSGSIZE (WSABASEERR+40)
54#define WSAEPROTOTYPE (WSABASEERR+41)
55#define WSAENOPROTOOPT (WSABASEERR+42)
56#define WSAEPROTONOSUPPORT (WSABASEERR+43)
57#define WSAESOCKTNOSUPPORT (WSABASEERR+44)
58#define WSAEOPNOTSUPP (WSABASEERR+45)
59#define WSAEPFNOSUPPORT (WSABASEERR+46)
60#define WSAEAFNOSUPPORT (WSABASEERR+47)
61#define WSAEADDRINUSE (WSABASEERR+48)
62#define WSAEADDRNOTAVAIL (WSABASEERR+49)
63#define WSAENETDOWN (WSABASEERR+50)
64#define WSAENETUNREACH (WSABASEERR+51)
65#define WSAENETRESET (WSABASEERR+52)
66#define WSAECONNABORTED (WSABASEERR+53)
67#define WSAECONNRESET (WSABASEERR+54)
68#define WSAENOBUFS (WSABASEERR+55)
69#define WSAEISCONN (WSABASEERR+56)
70#define WSAENOTCONN (WSABASEERR+57)
71#define WSAESHUTDOWN (WSABASEERR+58)
72#define WSAETOOMANYREFS (WSABASEERR+59)
73#define WSAETIMEDOUT (WSABASEERR+60)
74#define WSAECONNREFUSED (WSABASEERR+61)
75#define WSAELOOP (WSABASEERR+62)
76#define WSAENAMETOOLONG (WSABASEERR+63)
77#define WSAEHOSTDOWN (WSABASEERR+64)
78#define WSAEHOSTUNREACH (WSABASEERR+65)
79#define WSAENOTEMPTY (WSABASEERR+66)
80#define WSAEPROCLIM (WSABASEERR+67)
81#define WSAEUSERS (WSABASEERR+68)
82#define WSAEDQUOT (WSABASEERR+69)
83#define WSAESTALE (WSABASEERR+70)
84#define WSAEREMOTE (WSABASEERR+71)
85
86#define WSAEDISCON (WSABASEERR+101)
87
88/*
89 * Extended Windows Sockets error constant definitions
90 */
91#define WSASYSNOTREADY (WSABASEERR+91)
92#define WSAVERNOTSUPPORTED (WSABASEERR+92)
93#define WSANOTINITIALISED (WSABASEERR+93)
94
95/*
96 * Error return codes from gethostbyname() and gethostbyaddr()
97 * (when using the resolver). Note that these errors are
98 * retrieved via WSAGetLastError() and must therefore follow
99 * the rules for avoiding clashes with error numbers from
100 * specific implementations or language run-time systems.
101 * For this reason the codes are based at WSABASEERR+1001.
102 * Note also that [WSA]NO_ADDRESS is defined only for
103 * compatibility purposes.
104 */
105
106#define Wh_errno WSAGetLastError()
107
108/* Authoritative Answer: Host not found */
109#define WSAHOST_NOT_FOUND (WSABASEERR+1001)
110#define WHOST_NOT_FOUND WSAHOST_NOT_FOUND
111
112/* Non-Authoritative: Host not found, or SERVERFAIL */
113#define WSATRY_AGAIN (WSABASEERR+1002)
114#define WTRY_AGAIN WSATRY_AGAIN
115
116/* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
117#define WSANO_RECOVERY (WSABASEERR+1003)
118#define WNO_RECOVERY WSANO_RECOVERY
119
120/* Valid name, no data record of requested type */
121#define WSANO_DATA (WSABASEERR+1004)
122#define WNO_DATA WSANO_DATA
123
124/* no address, look for MX record */
125#define WSANO_ADDRESS WSANO_DATA
126#define WNO_ADDRESS WSANO_ADDRESS
127
128
129/*
130 * Windows message parameter composition and decomposition
131 * macros.
132 *
133 * WSAMAKEASYNCREPLY is intended for use by the Windows Sockets implementation
134 * when constructing the response to a WSAAsyncGetXByY() routine.
135 */
136#define OS2WSAMAKEASYNCREPLY(buflen,error) MAKELONG(buflen,error)
137/*
138 * WSAMAKESELECTREPLY is intended for use by the Windows Sockets implementation
139 * when constructing the response to WSAAsyncSelect().
140 */
141#define OS2WSAMAKESELECTREPLY(event,error) MAKELONG(event,error)
142/*
143 * WSAGETASYNCBUFLEN is intended for use by the Windows Sockets application
144 * to extract the buffer length from the lParam in the response
145 * to a WSAGetXByY().
146 */
147#define OS2WSAGETASYNCBUFLEN(lParam) LOWORD(lParam)
148/*
149 * WSAGETASYNCERROR is intended for use by the Windows Sockets application
150 * to extract the error code from the lParam in the response
151 * to a WSAGetXByY().
152 */
153#define OS2WSAGETASYNCERROR(lParam) HIWORD(lParam)
154/*
155 * WSAGETSELECTEVENT is intended for use by the Windows Sockets application
156 * to extract the event code from the lParam in the response
157 * to a WSAAsyncSelect().
158 */
159#define OS2WSAGETSELECTEVENT(lParam) LOWORD(lParam)
160/*
161 * WSAGETSELECTERROR is intended for use by the Windows Sockets application
162 * to extract the error code from the lParam in the response
163 * to a WSAAsyncSelect().
164 */
165#define OS2WSAGETSELECTERROR(lParam) HIWORD(lParam)
166
167#endif /* _WINSOCK32CONST_ */
168
169
Note: See TracBrowser for help on using the repository browser.