1 module async.types;
2 package:
3 enum LOG = false; //trace
4 enum DEBUG = false;
5 
6 import std.typecons: Flag;
7 alias isIPv6 = Flag!"IPv6";
8 alias isTCP = Flag!"TCP";
9 alias isForced = Flag!"ForceFind";
10 
11 mixin template DefStatus() {
12 
13 	/// Check this property to make sure the event loop hasn't failed
14 	@property bool hasError() const
15 	{
16 		return m_evLoop.status.code != Status.OK && m_evLoop.status.code != Status.ASYNC;
17 	}
18 
19 	/*
20 	 * The status code is Status.ASYNC if the call is delayed (yield), Status.ABORT if an
21 	 * unrecoverable socket/fd error occurs (throw), or Status.ERROR if an internal error
22 	 * occured (assert).
23 	*/
24 	@property StatusInfo status() const {
25 		return m_evLoop.status;
26 	}
27 
28 	/// Returns a human-readable error message from the underlying operating system.
29 	@property string error() const {
30 		return m_evLoop.error;
31 	}
32 }
33 
34 mixin template ContextMgr() {
35 	T getContext(T)()
36 		if (isPointer!T)
37 	{
38 		return cast(T*) m_ctxt;
39 	}
40 
41 	T getContext(T)()
42 		if (is(T == class))
43 	{
44 		return cast(T) m_ctxt;
45 	}
46 
47 	void setContext(T)(T ctxt)
48 		if (isPointer!T || is(T == class))
49 	{
50 		m_ctxt = cast(void*) ctxt;
51 	}
52 }
53 
54 struct StatusInfo {
55 	Status code = Status.OK;
56 	string text;
57 }
58 
59 enum Status : char {
60 	OK					=	0,
61 	ASYNC				=	1,
62 	RETRY				=	2,
63 	ERROR				=	3,
64 	ABORT				=	4,
65 	EVLOOP_TIMEOUT		=	5,
66 	EVLOOP_FAILURE		=	6,
67 	NOT_IMPLEMENTED		=	7
68 }
69 
70 enum EWIN : size_t {
71 	ERROR_SUCCESS							=	0,
72 	NO_ERROR								=	0,
73 	ERROR_INVALID_FUNCTION					=	1,
74 	ERROR_FILE_NOT_FOUND					=	2,
75 	ERROR_PATH_NOT_FOUND					=	3,
76 	ERROR_TOO_MANY_OPEN_FILES				=	4,
77 	ERROR_ACCESS_DENIED						=	5,
78 	ERROR_INVALID_HANDLE					=	6,
79 	ERROR_ARENA_TRASHED						=	7,
80 	ERROR_NOT_ENOUGH_MEMORY					=	8,
81 	ERROR_INVALID_BLOCK						=	9,
82 	ERROR_BAD_ENVIRONMENT					=	10,
83 	ERROR_BAD_FORMAT						=	11,
84 	ERROR_INVALID_ACCESS					=	12,
85 	ERROR_INVALID_DATA						=	13,
86 	ERROR_OUTOFMEMORY						=	14,
87 	ERROR_INVALID_DRIVE						=	15,
88 	ERROR_CURRENT_DIRECTORY					=	16,
89 	ERROR_NOT_SAME_DEVICE					=	17,
90 	ERROR_NO_MORE_FILES						=	18,
91 	ERROR_WRITE_PROTECT						=	19,
92 	ERROR_BAD_UNIT							=	20,
93 	ERROR_NOT_READY							=	21,
94 	ERROR_BAD_COMMAND						=	22,
95 	ERROR_CRC								=	23,
96 	ERROR_BAD_LENGTH						=	24,
97 	ERROR_SEEK								=	25,
98 	ERROR_NOT_DOS_DISK						=	26,
99 	ERROR_SECTOR_NOT_FOUND					=	27,
100 	ERROR_OUT_OF_PAPER						=	28,
101 	ERROR_WRITE_FAULT						=	29,
102 	ERROR_READ_FAULT						=	30,
103 	ERROR_GEN_FAILURE						=	31,
104 	ERROR_SHARING_VIOLATION					=	32,
105 	ERROR_LOCK_VIOLATION					=	33,
106 	ERROR_WRONG_DISK						=	34,
107 	ERROR_SHARING_BUFFER_EXCEEDED			=	36,
108 	ERROR_HANDLE_EOF						=	38,
109 	ERROR_HANDLE_DISK_FULL					=	39,
110 	ERROR_NOT_SUPPORTED						=	50,
111 	ERROR_REM_NOT_LIST						=	51,
112 	ERROR_DUP_NAME							=	52,
113 	ERROR_BAD_NETPATH						=	53,
114 	ERROR_NETWORK_BUSY						=	54,
115 	ERROR_DEV_NOT_EXIST						=	55,
116 	ERROR_TOO_MANY_CMDS						=	56,
117 	ERROR_ADAP_HDW_ERR						=	57,
118 	ERROR_BAD_NET_RESP						=	58,
119 	ERROR_UNEXP_NET_ERR						=	59,
120 	ERROR_BAD_REM_ADAP						=	60,
121 	ERROR_PRINTQ_FULL						=	61,
122 	ERROR_NO_SPOOL_SPACE					=	62,
123 	ERROR_PRINT_CANCELLED					=	63,
124 	ERROR_NETNAME_DELETED					=	64,
125 	ERROR_NETWORK_ACCESS_DENIED				=	65,
126 	ERROR_BAD_DEV_TYPE						=	66,
127 	ERROR_BAD_NET_NAME						=	67,
128 	ERROR_TOO_MANY_NAMES					=	68,
129 	ERROR_TOO_MANY_SESS						=	69,
130 	ERROR_SHARING_PAUSED					=	70,
131 	ERROR_REQ_NOT_ACCEP						=	71,
132 	ERROR_REDIR_PAUSED						=	72,
133 	ERROR_FILE_EXISTS						=	80,
134 	ERROR_CANNOT_MAKE						=	82,
135 	ERROR_FAIL_I24							=	83,
136 	ERROR_OUT_OF_STRUCTURES					=	84,
137 	ERROR_ALREADY_ASSIGNED					=	85,
138 	ERROR_INVALID_PASSWORD					=	86,
139 	ERROR_INVALID_PARAMETER					=	87,
140 	ERROR_NET_WRITE_FAULT					=	88,
141 	ERROR_NO_PROC_SLOTS						=	89,
142 	ERROR_TOO_MANY_SEMAPHORES				=	100,
143 	ERROR_EXCL_SEM_ALREADY_OWNED			=	101,
144 	ERROR_SEM_IS_SET						=	102,
145 	ERROR_TOO_MANY_SEM_REQUESTS				=	103,
146 	ERROR_INVALID_AT_INTERRUPT_TIME			=	104,
147 	ERROR_SEM_OWNER_DIED					=	105,
148 	ERROR_SEM_USER_LIMIT					=	106,
149 	ERROR_DISK_CHANGE						=	107,
150 	ERROR_DRIVE_LOCKED						=	108,
151 	ERROR_BROKEN_PIPE						=	109,
152 	ERROR_OPEN_FAILED						=	110,
153 	ERROR_BUFFER_OVERFLOW					=	111,
154 	ERROR_DISK_FULL							=	112,
155 	ERROR_NO_MORE_SEARCH_HANDLES			=	113,
156 	ERROR_INVALID_TARGET_HANDLE				=	114,
157 	ERROR_INVALID_CATEGORY					=	117,
158 	ERROR_INVALID_VERIFY_SWITCH				=	118,
159 	ERROR_BAD_DRIVER_LEVEL					=	119,
160 	ERROR_CALL_NOT_IMPLEMENTED				=	120,
161 	ERROR_SEM_TIMEOUT						=	121,
162 	ERROR_INSUFFICIENT_BUFFER				=	122,
163 	ERROR_INVALID_NAME						=	123,
164 	ERROR_INVALID_LEVEL						=	124,
165 	ERROR_NO_VOLUME_LABEL					=	125,
166 	ERROR_MOD_NOT_FOUND						=	126,
167 	ERROR_PROC_NOT_FOUND					=	127,
168 	ERROR_WAIT_NO_CHILDREN					=	128,
169 	ERROR_CHILD_NOT_COMPLETE				=	129,
170 	ERROR_DIRECT_ACCESS_HANDLE				=	130,
171 	ERROR_NEGATIVE_SEEK						=	131,
172 	ERROR_SEEK_ON_DEVICE					=	132,
173 	ERROR_IS_JOIN_TARGET					=	133,
174 	ERROR_IS_JOINED							=	134,
175 	ERROR_IS_SUBSTED						=	135,
176 	ERROR_NOT_JOINED						=	136,
177 	ERROR_NOT_SUBSTED						=	137,
178 	ERROR_JOIN_TO_JOIN						=	138,
179 	ERROR_SUBST_TO_SUBST					=	139,
180 	ERROR_JOIN_TO_SUBST						=	140,
181 	ERROR_SUBST_TO_JOIN						=	141,
182 	ERROR_BUSY_DRIVE						=	142,
183 	ERROR_SAME_DRIVE						=	143,
184 	ERROR_DIR_NOT_ROOT						=	144,
185 	ERROR_DIR_NOT_EMPTY						=	145,
186 	ERROR_IS_SUBST_PATH						=	146,
187 	ERROR_IS_JOIN_PATH						=	147,
188 	ERROR_PATH_BUSY							=	148,
189 	ERROR_IS_SUBST_TARGET					=	149,
190 	ERROR_SYSTEM_TRACE						=	150,
191 	ERROR_INVALID_EVENT_COUNT				=	151,
192 	ERROR_TOO_MANY_MUXWAITERS				=	152,
193 	ERROR_INVALID_LIST_FORMAT				=	153,
194 	ERROR_LABEL_TOO_LONG					=	154,
195 	ERROR_TOO_MANY_TCBS						=	155,
196 	ERROR_SIGNAL_REFUSED					=	156,
197 	ERROR_DISCARDED							=	157,
198 	ERROR_NOT_LOCKED						=	158,
199 	ERROR_BAD_THREADID_ADDR					=	159,
200 	ERROR_BAD_ARGUMENTS						=	160,
201 	ERROR_BAD_PATHNAME						=	161,
202 	ERROR_SIGNAL_PENDING					=	162,
203 	ERROR_MAX_THRDS_REACHED					=	164,
204 	ERROR_LOCK_FAILED						=	167,
205 	WAIT_TIMEOUT							=	258,
206 	WAIT_FAILED								=	0xFFFFFFFF,
207 	/*
208 	ERROR_BUSY								=	170,
209 	ERROR_CANCEL_VIOLATION					=	173,
210 	ERROR_ATOMIC_LOCKS_NOT_SUPPORTED		=	174,
211 	ERROR_INVALID_SEGMENT_NUMBER			=	180,
212 	ERROR_INVALID_ORDINAL					=	182,
213 	ERROR_ALREADY_EXISTS					=	183,
214 	ERROR_INVALID_FLAG_NUMBER				=	186,
215 	ERROR_SEM_NOT_FOUND						=	187,
216 	ERROR_INVALID_STARTING_CODESEG			=	188,
217 	ERROR_INVALID_STACKSEG					=	189,
218 	ERROR_INVALID_MODULETYPE				=	190,
219 	ERROR_INVALID_EXE_SIGNATURE				=	191,
220 	ERROR_EXE_MARKED_INVALID				=	192,
221 	ERROR_BAD_EXE_FORMAT					=	193,
222 	ERROR_ITERATED_DATA_EXCEEDS_64k			=	194,
223 	ERROR_INVALID_MINALLOCSIZE				=	195,
224 	ERROR_DYNLINK_FROM_INVALID_RING			=	196,
225 	ERROR_IOPL_NOT_ENABLED					=	197,
226 	ERROR_INVALID_SEGDPL					=	198,
227 	ERROR_AUTODATASEG_EXCEEDS_64k			=	199,
228 	ERROR_RING2SEG_MUST_BE_MOVABLE			=	200,
229 	ERROR_RELOC_CHAIN_XEEDS_SEGLIM			=	201,
230 	ERROR_INFLOOP_IN_RELOC_CHAIN			=	202,
231 	ERROR_ENVVAR_NOT_FOUND					=	203,
232 	ERROR_NO_SIGNAL_SENT					=	205,
233 	ERROR_FILENAME_EXCED_RANGE				=	206,
234 	ERROR_RING2_STACK_IN_USE				=	207,
235 	ERROR_META_EXPANSION_TOO_LONG			=	208,
236 	ERROR_INVALID_SIGNAL_NUMBER				=	209,
237 	ERROR_THREAD_1_INACTIVE					=	210,
238 	ERROR_LOCKED							=	212,
239 	ERROR_TOO_MANY_MODULES					=	214,
240 	ERROR_NESTING_NOT_ALLOWED				=	215,
241 	ERROR_BAD_PIPE							=	230,
242 	ERROR_PIPE_BUSY							=	231,
243 	ERROR_NO_DATA							=	232,
244 	ERROR_PIPE_NOT_CONNECTED				=	233,
245 	ERROR_MORE_DATA							=	234,
246 	ERROR_VC_DISCONNECTED					=	240,
247 	ERROR_INVALID_EA_NAME					=	254,
248 	ERROR_EA_LIST_INCONSISTENT				=	255,
249 	ERROR_NO_MORE_ITEMS						=	259,
250 	ERROR_CANNOT_COPY						=	266,
251 	ERROR_DIRECTORY							=	267,
252 	ERROR_EAS_DIDNT_FIT						=	275,
253 	ERROR_EA_FILE_CORRUPT					=	276,
254 	ERROR_EA_TABLE_FULL						=	277,
255 	ERROR_INVALID_EA_HANDLE					=	278,
256 	ERROR_EAS_NOT_SUPPORTED					=	282,
257 	ERROR_NOT_OWNER							=	288,
258 	ERROR_TOO_MANY_POSTS					=	298,
259 	ERROR_PARTIAL_COPY						=	299,
260 	ERROR_MR_MID_NOT_FOUND					=	317,
261 	ERROR_INVALID_ADDRESS					=	487,
262 	ERROR_ARITHMETIC_OVERFLOW				=	534,
263 	ERROR_PIPE_CONNECTED					=	535,
264 	ERROR_PIPE_LISTENING					=	536,
265 	ERROR_EA_ACCESS_DENIED					=	994,
266 	ERROR_OPERATION_ABORTED					=	995,
267 	ERROR_IO_INCOMPLETE						=	996,
268 	ERROR_IO_PENDING						=	997,
269 	ERROR_NOACCESS							=	998,
270 	ERROR_SWAPERROR							=	999,
271 	ERROR_STACK_OVERFLOW					=	1001,
272 	ERROR_INVALID_MESSAGE					=	1002,
273 	ERROR_CAN_NOT_COMPLETE					=	1003,
274 	ERROR_INVALID_FLAGS						=	1004,
275 	ERROR_UNRECOGNIZED_VOLUME				=	1005,
276 	ERROR_FILE_INVALID						=	1006,
277 	ERROR_FULLSCREEN_MODE					=	1007,
278 	ERROR_NO_TOKEN							=	1008,
279 	ERROR_BADDB								=	1009,
280 	ERROR_BADKEY							=	1010,
281 	ERROR_CANTOPEN							=	1011,
282 	ERROR_CANTREAD							=	1012,
283 	ERROR_CANTWRITE							=	1013,
284 	ERROR_REGISTRY_RECOVERED				=	1014,
285 	ERROR_REGISTRY_CORRUPT					=	1015,
286 	ERROR_REGISTRY_IO_FAILED				=	1016,
287 	ERROR_NOT_REGISTRY_FILE					=	1017,
288 	ERROR_KEY_DELETED						=	1018,
289 	ERROR_NO_LOG_SPACE						=	1019,
290 	ERROR_KEY_HAS_CHILDREN					=	1020,
291 	ERROR_CHILD_MUST_BE_VOLATILE			=	1021,
292 	ERROR_NOTIFY_ENUM_DIR					=	1022,
293 	ERROR_DEPENDENT_SERVICES_RUNNING		=	1051,
294 	ERROR_INVALID_SERVICE_CONTROL			=	1052,
295 	ERROR_SERVICE_REQUEST_TIMEOUT			=	1053,
296 	ERROR_SERVICE_NO_THREAD					=	1054,
297 	ERROR_SERVICE_DATABASE_LOCKED			=	1055,
298 	ERROR_SERVICE_ALREADY_RUNNING			=	1056,
299 	ERROR_INVALID_SERVICE_ACCOUNT			=	1057,
300 	ERROR_SERVICE_DISABLED					=	1058,
301 	ERROR_CIRCULAR_DEPENDENCY				=	1059,
302 	ERROR_SERVICE_DOES_NOT_EXIST			=	1060,
303 	ERROR_SERVICE_CANNOT_ACCEPT_CTRL		=	1061,
304 	ERROR_SERVICE_NOT_ACTIVE				=	1062,
305 	ERROR_FAILED_SERVICE_CONTROLLER_CONNECT	=	1063,
306 	ERROR_EXCEPTION_IN_SERVICE				=	1064,
307 	ERROR_DATABASE_DOES_NOT_EXIST			=	1065,
308 	ERROR_SERVICE_SPECIFIC_ERROR			=	1066,
309 	ERROR_PROCESS_ABORTED					=	1067,
310 	ERROR_SERVICE_DEPENDENCY_FAIL			=	1068,
311 	ERROR_SERVICE_LOGON_FAILED				=	1069,
312 	ERROR_SERVICE_START_HANG				=	1070,
313 	ERROR_INVALID_SERVICE_LOCK				=	1071,
314 	ERROR_SERVICE_MARKED_FOR_DELETE			=	1072,
315 	ERROR_SERVICE_EXISTS					=	1073,
316 	ERROR_ALREADY_RUNNING_LKG				=	1074,
317 	ERROR_SERVICE_DEPENDENCY_DELETED		=	1075,
318 	ERROR_BOOT_ALREADY_ACCEPTED				=	1076,
319 	ERROR_SERVICE_NEVER_STARTED				=	1077,
320 	ERROR_DUPLICATE_SERVICE_NAME			=	1078,
321 	ERROR_END_OF_MEDIA						=	1100,
322 	ERROR_FILEMARK_DETECTED					=	1101,
323 	ERROR_BEGINNING_OF_MEDIA				=	1102,
324 	ERROR_SETMARK_DETECTED					=	1103,
325 	ERROR_NO_DATA_DETECTED					=	1104,
326 	ERROR_PARTITION_FAILURE					=	1105,
327 	ERROR_INVALID_BLOCK_LENGTH				=	1106,
328 	ERROR_DEVICE_NOT_PARTITIONED			=	1107,
329 	ERROR_UNABLE_TO_LOCK_MEDIA				=	1108,
330 	ERROR_UNABLE_TO_UNLOAD_MEDIA			=	1109,
331 	ERROR_MEDIA_CHANGED						=	1110,
332 	ERROR_BUS_RESET							=	1111,
333 	ERROR_NO_MEDIA_IN_DRIVE					=	1112,
334 	ERROR_NO_UNICODE_TRANSLATION			=	1113,
335 	ERROR_DLL_INIT_FAILED					=	1114,
336 	ERROR_SHUTDOWN_IN_PROGRESS				=	1115,
337 	ERROR_NO_SHUTDOWN_IN_PROGRESS			=	1116,
338 	ERROR_IO_DEVICE							=	1117,
339 	ERROR_SERIAL_NO_DEVICE					=	1118,
340 	ERROR_IRQ_BUSY							=	1119,
341 	ERROR_MORE_WRITES						=	1120,
342 	ERROR_COUNTER_TIMEOUT					=	1121,
343 	ERROR_FLOPPY_ID_MARK_NOT_FOUND			=	1122,
344 	ERROR_FLOPPY_WRONG_CYLINDER				=	1123,
345 	ERROR_FLOPPY_UNKNOWN_ERROR				=	1124,
346 	ERROR_FLOPPY_BAD_REGISTERS				=	1125,
347 	ERROR_DISK_RECALIBRATE_FAILED			=	1126,
348 	ERROR_DISK_OPERATION_FAILED				=	1127,
349 	ERROR_DISK_RESET_FAILED					=	1128,
350 	ERROR_EOM_OVERFLOW						=	1129,
351 	ERROR_NOT_ENOUGH_SERVER_MEMORY			=	1130,
352 	ERROR_POSSIBLE_DEADLOCK					=	1131,
353 	ERROR_MAPPED_ALIGNMENT					=	1132,
354 	ERROR_SET_POWER_STATE_VETOED			=	1140,
355 	ERROR_SET_POWER_STATE_FAILED			=	1141,
356 	ERROR_TOO_MANY_LINKS					=	1142,
357 	ERROR_OLD_WIN_VERSION					=	1150,
358 	ERROR_APP_WRONG_OS						=	1151,
359 	ERROR_SINGLE_INSTANCE_APP				=	1152,
360 	ERROR_RMODE_APP							=	1153,
361 	ERROR_INVALID_DLL						=	1154,
362 	ERROR_NO_ASSOCIATION					=	1155,
363 	ERROR_DDE_FAIL							=	1156,
364 	ERROR_DLL_NOT_FOUND						=	1157,
365 	ERROR_BAD_USERNAME						=	2202,
366 	ERROR_NOT_CONNECTED						=	2250,
367 	ERROR_OPEN_FILES						=	2401,
368 	ERROR_ACTIVE_CONNECTIONS				=	2402,
369 	ERROR_DEVICE_IN_USE						=	2404,
370 	ERROR_BAD_DEVICE						=	1200,
371 	ERROR_CONNECTION_UNAVAIL				=	1201,
372 	ERROR_DEVICE_ALREADY_REMEMBERED			=	1202,
373 	ERROR_NO_NET_OR_BAD_PATH				=	1203,
374 	ERROR_BAD_PROVIDER						=	1204,
375 	ERROR_CANNOT_OPEN_PROFILE				=	1205,
376 	ERROR_BAD_PROFILE						=	1206,
377 	ERROR_NOT_CONTAINER						=	1207,
378 	ERROR_EXTENDED_ERROR					=	1208,
379 	ERROR_INVALID_GROUPNAME					=	1209,
380 	ERROR_INVALID_COMPUTERNAME				=	1210,
381 	ERROR_INVALID_EVENTNAME					=	1211,
382 	ERROR_INVALID_DOMAINNAME				=	1212,
383 	ERROR_INVALID_SERVICENAME				=	1213,
384 	ERROR_INVALID_NETNAME					=	1214,
385 	ERROR_INVALID_SHARENAME					=	1215,
386 	ERROR_INVALID_PASSWORDNAME				=	1216,
387 	ERROR_INVALID_MESSAGENAME				=	1217,
388 	ERROR_INVALID_MESSAGEDEST				=	1218,
389 	ERROR_SESSION_CREDENTIAL_CONFLICT		=	1219,
390 	ERROR_REMOTE_SESSION_LIMIT_EXCEEDED		=	1220,
391 	ERROR_DUP_DOMAINNAME					=	1221,
392 	ERROR_NO_NETWORK						=	1222,
393 	ERROR_CANCELLED							=	1223,
394 	ERROR_USER_MAPPED_FILE					=	1224,
395 	ERROR_CONNECTION_REFUSED				=	1225,
396 	ERROR_GRACEFUL_DISCONNECT				=	1226,
397 	ERROR_ADDRESS_ALREADY_ASSOCIATED		=	1227,
398 	ERROR_ADDRESS_NOT_ASSOCIATED			=	1228,
399 	ERROR_CONNECTION_INVALID				=	1229,
400 	ERROR_CONNECTION_ACTIVE					=	1230,
401 	ERROR_NETWORK_UNREACHABLE				=	1231,
402 	ERROR_HOST_UNREACHABLE					=	1232,
403 	ERROR_PROTOCOL_UNREACHABLE				=	1233,
404 	ERROR_PORT_UNREACHABLE					=	1234,
405 	ERROR_REQUEST_ABORTED					=	1235,
406 	ERROR_CONNECTION_ABORTED				=	1236,
407 	ERROR_RETRY								=	1237,
408 	ERROR_CONNECTION_COUNT_LIMIT			=	1238,
409 	ERROR_LOGIN_TIME_RESTRICTION			=	1239,
410 	ERROR_LOGIN_WKSTA_RESTRICTION			=	1240,
411 	ERROR_INCORRECT_ADDRESS					=	1241,
412 	ERROR_ALREADY_REGISTERED				=	1242,
413 	ERROR_SERVICE_NOT_FOUND					=	1243,
414 	ERROR_NOT_AUTHENTICATED					=	1244,
415 	ERROR_NOT_LOGGED_ON						=	1245,
416 	ERROR_CONTINUE							=	1246,
417 	ERROR_ALREADY_INITIALIZED				=	1247,
418 	ERROR_NO_MORE_DEVICES					=	1248,
419 	ERROR_NOT_ALL_ASSIGNED					=	1300,
420 	ERROR_SOME_NOT_MAPPED					=	1301,
421 	ERROR_NO_QUOTAS_FOR_ACCOUNT				=	1302,
422 	ERROR_LOCAL_USER_SESSION_KEY			=	1303,
423 	ERROR_NULL_LM_PASSWORD					=	1304,
424 	ERROR_UNKNOWN_REVISION					=	1305,
425 	ERROR_REVISION_MISMATCH					=	1306,
426 	ERROR_INVALID_OWNER						=	1307,
427 	ERROR_INVALID_PRIMARY_GROUP				=	1308,
428 	ERROR_NO_IMPERSONATION_TOKEN			=	1309,
429 	ERROR_CANT_DISABLE_MANDATORY			=	1310,
430 	ERROR_NO_LOGON_SERVERS					=	1311,
431 	ERROR_NO_SUCH_LOGON_SESSION				=	1312,
432 	ERROR_NO_SUCH_PRIVILEGE					=	1313,
433 	ERROR_PRIVILEGE_NOT_HELD				=	1314,
434 	ERROR_INVALID_ACCOUNT_NAME				=	1315,
435 	ERROR_USER_EXISTS						=	1316,
436 	ERROR_NO_SUCH_USER						=	1317,
437 	ERROR_GROUP_EXISTS						=	1318,
438 	ERROR_NO_SUCH_GROUP						=	1319,
439 	ERROR_MEMBER_IN_GROUP					=	1320,
440 	ERROR_MEMBER_NOT_IN_GROUP				=	1321,
441 	ERROR_LAST_ADMIN						=	1322,
442 	ERROR_WRONG_PASSWORD					=	1323,
443 	ERROR_ILL_FORMED_PASSWORD				=	1324,
444 	ERROR_PASSWORD_RESTRICTION				=	1325,
445 	ERROR_LOGON_FAILURE						=	1326,
446 	ERROR_ACCOUNT_RESTRICTION				=	1327,
447 	ERROR_INVALID_LOGON_HOURS				=	1328,
448 	ERROR_INVALID_WORKSTATION				=	1329,
449 	ERROR_PASSWORD_EXPIRED					=	1330,
450 	ERROR_ACCOUNT_DISABLED					=	1331,
451 	ERROR_NONE_MAPPED						=	1332,
452 	ERROR_TOO_MANY_LUIDS_REQUESTED			=	1333,
453 	ERROR_LUIDS_EXHAUSTED					=	1334,
454 	ERROR_INVALID_SUB_AUTHORITY				=	1335,
455 	ERROR_INVALID_ACL						=	1336,
456 	ERROR_INVALID_SID						=	1337,
457 	ERROR_INVALID_SECURITY_DESCR			=	1338,
458 	ERROR_BAD_INHERITANCE_ACL				=	1340,
459 	ERROR_SERVER_DISABLED					=	1341,
460 	ERROR_SERVER_NOT_DISABLED				=	1342,
461 	ERROR_INVALID_ID_AUTHORITY				=	1343,
462 	ERROR_ALLOTTED_SPACE_EXCEEDED			=	1344,
463 	ERROR_INVALID_GROUP_ATTRIBUTES			=	1345,
464 	ERROR_BAD_IMPERSONATION_LEVEL			=	1346,
465 	ERROR_CANT_OPEN_ANONYMOUS				=	1347,
466 	ERROR_BAD_VALIDATION_CLASS				=	1348,
467 	ERROR_BAD_TOKEN_TYPE					=	1349,
468 	ERROR_NO_SECURITY_ON_OBJECT				=	1350,
469 	ERROR_CANT_ACCESS_DOMAIN_INFO			=	1351,
470 	ERROR_INVALID_SERVER_STATE				=	1352,
471 	ERROR_INVALID_DOMAIN_STATE				=	1353,
472 	ERROR_INVALID_DOMAIN_ROLE				=	1354,
473 	ERROR_NO_SUCH_DOMAIN					=	1355,
474 	ERROR_DOMAIN_EXISTS						=	1356,
475 	ERROR_DOMAIN_LIMIT_EXCEEDED				=	1357,
476 	ERROR_INTERNAL_DB_CORRUPTION			=	1358,
477 	ERROR_INTERNAL_ERROR					=	1359,
478 	ERROR_GENERIC_NOT_MAPPED				=	1360,
479 	ERROR_BAD_DESCRIPTOR_FORMAT				=	1361,
480 	ERROR_NOT_LOGON_PROCESS					=	1362,
481 	ERROR_LOGON_SESSION_EXISTS				=	1363,
482 	ERROR_NO_SUCH_PACKAGE					=	1364,
483 	ERROR_BAD_LOGON_SESSION_STATE			=	1365,
484 	ERROR_LOGON_SESSION_COLLISION			=	1366,
485 	ERROR_INVALID_LOGON_TYPE				=	1367,
486 	ERROR_CANNOT_IMPERSONATE				=	1368,
487 	ERROR_RXACT_INVALID_STATE				=	1369,
488 	ERROR_RXACT_COMMIT_FAILURE				=	1370,
489 	ERROR_SPECIAL_ACCOUNT					=	1371,
490 	ERROR_SPECIAL_GROUP						=	1372,
491 	ERROR_SPECIAL_USER						=	1373,
492 	ERROR_MEMBERS_PRIMARY_GROUP				=	1374,
493 	ERROR_TOKEN_ALREADY_IN_USE				=	1375,
494 	ERROR_NO_SUCH_ALIAS						=	1376,
495 	ERROR_MEMBER_NOT_IN_ALIAS				=	1377,
496 	ERROR_MEMBER_IN_ALIAS					=	1378,
497 	ERROR_ALIAS_EXISTS						=	1379,
498 	ERROR_LOGON_NOT_GRANTED					=	1380,
499 	ERROR_TOO_MANY_SECRETS					=	1381,
500 	ERROR_SECRET_TOO_LONG					=	1382,
501 	ERROR_INTERNAL_DB_ERROR					=	1383,
502 	ERROR_TOO_MANY_CONTEXT_IDS				=	1384,
503 	ERROR_LOGON_TYPE_NOT_GRANTED			=	1385,
504 	ERROR_NT_CROSS_ENCRYPTION_REQUIRED		=	1386,
505 	ERROR_NO_SUCH_MEMBER					=	1387,
506 	ERROR_INVALID_MEMBER					=	1388,
507 	ERROR_TOO_MANY_SIDS						=	1389,
508 	ERROR_LM_CROSS_ENCRYPTION_REQUIRED		=	1390,
509 	ERROR_NO_INHERITANCE					=	1391,
510 	ERROR_FILE_CORRUPT						=	1392,
511 	ERROR_DISK_CORRUPT						=	1393,
512 	ERROR_NO_USER_SESSION_KEY				=	1394,
513 	ERROR_LICENSE_QUOTA_EXCEEDED			=	1395,
514 */	ERROR_INVALID_WINDOW_HANDLE				=	1400,
515 /*	ERROR_INVALID_MENU_HANDLE				=	1401,
516 	ERROR_INVALID_CURSOR_HANDLE				=	1402,
517 	ERROR_INVALID_ACCEL_HANDLE				=	1403,
518 	ERROR_INVALID_HOOK_HANDLE				=	1404,
519 	ERROR_INVALID_DWP_HANDLE				=	1405,
520 	ERROR_TLW_WITH_WSCHILD					=	1406,
521 	ERROR_CANNOT_FIND_WND_CLASS				=	1407,
522 	ERROR_WINDOW_OF_OTHER_THREAD			=	1408,
523 	ERROR_HOTKEY_ALREADY_REGISTERED			=	1409,
524 	ERROR_CLASS_ALREADY_EXISTS				=	1410,
525 	ERROR_CLASS_DOES_NOT_EXIST				=	1411,
526 	ERROR_CLASS_HAS_WINDOWS					=	1412,
527 	ERROR_INVALID_INDEX						=	1413,
528 	ERROR_INVALID_ICON_HANDLE				=	1414,
529 	ERROR_PRIVATE_DIALOG_INDEX				=	1415,
530 	ERROR_LISTBOX_ID_NOT_FOUND				=	1416,
531 	ERROR_NO_WILDCARD_CHARACTERS			=	1417,
532 	ERROR_CLIPBOARD_NOT_OPEN				=	1418,
533 	ERROR_HOTKEY_NOT_REGISTERED				=	1419,
534 	ERROR_WINDOW_NOT_DIALOG					=	1420,
535 	ERROR_CONTROL_ID_NOT_FOUND				=	1421,
536 	ERROR_INVALID_COMBOBOX_MESSAGE			=	1422,
537 	ERROR_WINDOW_NOT_COMBOBOX				=	1423,
538 	ERROR_INVALID_EDIT_HEIGHT				=	1424,
539 	ERROR_DC_NOT_FOUND						=	1425,
540 	ERROR_INVALID_HOOK_FILTER				=	1426,
541 	ERROR_INVALID_FILTER_PROC				=	1427,
542 	ERROR_HOOK_NEEDS_HMOD					=	1428,
543 	ERROR_GLOBAL_ONLY_HOOK					=	1429,
544 	ERROR_JOURNAL_HOOK_SET					=	1430,
545 	ERROR_HOOK_NOT_INSTALLED				=	1431,
546 	ERROR_INVALID_LB_MESSAGE				=	1432,
547 	ERROR_SETCOUNT_ON_BAD_LB				=	1433,
548 	ERROR_LB_WITHOUT_TABSTOPS				=	1434,
549 	ERROR_DESTROY_OBJECT_OF_OTHER_THREAD	=	1435,
550 	ERROR_CHILD_WINDOW_MENU					=	1436,
551 	ERROR_NO_SYSTEM_MENU					=	1437,
552 	ERROR_INVALID_MSGBOX_STYLE				=	1438,
553 	ERROR_INVALID_SPI_VALUE					=	1439,
554 	ERROR_SCREEN_ALREADY_LOCKED				=	1440,
555 	ERROR_HWNDS_HAVE_DIFF_PARENT			=	1441,
556 	ERROR_NOT_CHILD_WINDOW					=	1442,
557 	ERROR_INVALID_GW_COMMAND				=	1443,
558 	ERROR_INVALID_THREAD_ID					=	1444,
559 	ERROR_NON_MDICHILD_WINDOW				=	1445,
560 	ERROR_POPUP_ALREADY_ACTIVE				=	1446,
561 	ERROR_NO_SCROLLBARS						=	1447,
562 	ERROR_INVALID_SCROLLBAR_RANGE			=	1448,
563 	ERROR_INVALID_SHOWWIN_COMMAND			=	1449,
564 	ERROR_NO_SYSTEM_RESOURCES				=	1450,
565 	ERROR_NONPAGED_SYSTEM_RESOURCES			=	1451,
566 	ERROR_PAGED_SYSTEM_RESOURCES			=	1452,
567 	ERROR_WORKING_SET_QUOTA					=	1453,
568 	ERROR_PAGEFILE_QUOTA					=	1454,
569 	ERROR_COMMITMENT_LIMIT					=	1455,
570 	ERROR_MENU_ITEM_NOT_FOUND				=	1456,
571 	ERROR_EVENTLOG_FILE_CORRUPT				=	1500,
572 	ERROR_EVENTLOG_CANT_START				=	1501,
573 	ERROR_LOG_FILE_FULL						=	1502,
574 	ERROR_EVENTLOG_FILE_CHANGED				=	1503,
575 	RPC_S_INVALID_STRING_BINDING			=	1700,
576 	RPC_S_WRONG_KIND_OF_BINDING				=	1701,
577 	RPC_S_INVALID_BINDING					=	1702,
578 	RPC_S_PROTSEQ_NOT_SUPPORTED				=	1703,
579 	RPC_S_INVALID_RPC_PROTSEQ				=	1704,
580 	RPC_S_INVALID_STRING_UUID				=	1705,
581 	RPC_S_INVALID_ENDPOINT_FORMAT			=	1706,
582 	RPC_S_INVALID_NET_ADDR					=	1707,
583 	RPC_S_NO_ENDPOINT_FOUND					=	1708,
584 	RPC_S_INVALID_TIMEOUT					=	1709,
585 	RPC_S_OBJECT_NOT_FOUND					=	1710,
586 	RPC_S_ALREADY_REGISTERED				=	1711,
587 	RPC_S_TYPE_ALREADY_REGISTERED			=	1712,
588 	RPC_S_ALREADY_LISTENING					=	1713,
589 	RPC_S_NO_PROTSEQS_REGISTERED			=	1714,
590 	RPC_S_NOT_LISTENING						=	1715,
591 	RPC_S_UNKNOWN_MGR_TYPE					=	1716,
592 	RPC_S_UNKNOWN_IF						=	1717,
593 	RPC_S_NO_BINDINGS						=	1718,
594 	RPC_S_NO_PROTSEQS						=	1719,
595 	RPC_S_CANT_CREATE_ENDPOINT				=	1720,
596 	RPC_S_OUT_OF_RESOURCES					=	1721,
597 	RPC_S_SERVER_UNAVAILABLE				=	1722,
598 	RPC_S_SERVER_TOO_BUSY					=	1723,
599 	RPC_S_INVALID_NETWORK_OPTIONS			=	1724,
600 	RPC_S_NO_CALL_ACTIVE					=	1725,
601 	RPC_S_CALL_FAILED						=	1726,
602 	RPC_S_CALL_FAILED_DNE					=	1727,
603 	RPC_S_PROTOCOL_ERROR					=	1728,
604 	RPC_S_UNSUPPORTED_TRANS_SYN				=	1730,
605 	RPC_S_UNSUPPORTED_TYPE					=	1732,
606 	RPC_S_INVALID_TAG						=	1733,
607 	RPC_S_INVALID_BOUND						=	1734,
608 	RPC_S_NO_ENTRY_NAME						=	1735,
609 	RPC_S_INVALID_NAME_SYNTAX				=	1736,
610 	RPC_S_UNSUPPORTED_NAME_SYNTAX			=	1737,
611 	RPC_S_UUID_NO_ADDRESS					=	1739,
612 	RPC_S_DUPLICATE_ENDPOINT				=	1740,
613 	RPC_S_UNKNOWN_AUTHN_TYPE				=	1741,
614 	RPC_S_MAX_CALLS_TOO_SMALL				=	1742,
615 	RPC_S_STRING_TOO_LONG					=	1743,
616 	RPC_S_PROTSEQ_NOT_FOUND					=	1744,
617 	RPC_S_PROCNUM_OUT_OF_RANGE				=	1745,
618 	RPC_S_BINDING_HAS_NO_AUTH				=	1746,
619 	RPC_S_UNKNOWN_AUTHN_SERVICE				=	1747,
620 	RPC_S_UNKNOWN_AUTHN_LEVEL				=	1748,
621 	RPC_S_INVALID_AUTH_IDENTITY				=	1749,
622 	RPC_S_UNKNOWN_AUTHZ_SERVICE				=	1750,
623 	EPT_S_INVALID_ENTRY						=	1751,
624 	EPT_S_CANT_PERFORM_OP					=	1752,
625 	EPT_S_NOT_REGISTERED					=	1753,
626 	RPC_S_NOTHING_TO_EXPORT					=	1754,
627 	RPC_S_INCOMPLETE_NAME					=	1755,
628 	RPC_S_INVALID_VERS_OPTION				=	1756,
629 	RPC_S_NO_MORE_MEMBERS					=	1757,
630 	RPC_S_NOT_ALL_OBJS_UNEXPORTED			=	1758,
631 	RPC_S_INTERFACE_NOT_FOUND				=	1759,
632 	RPC_S_ENTRY_ALREADY_EXISTS				=	1760,
633 	RPC_S_ENTRY_NOT_FOUND					=	1761,
634 	RPC_S_NAME_SERVICE_UNAVAILABLE			=	1762,
635 	RPC_S_INVALID_NAF_ID					=	1763,
636 	RPC_S_CANNOT_SUPPORT					=	1764,
637 	RPC_S_NO_CONTEXT_AVAILABLE				=	1765,
638 	RPC_S_INTERNAL_ERROR					=	1766,
639 	RPC_S_ZERO_DIVIDE						=	1767,
640 	RPC_S_ADDRESS_ERROR						=	1768,
641 	RPC_S_FP_DIV_ZERO						=	1769,
642 	RPC_S_FP_UNDERFLOW						=	1770,
643 	RPC_S_FP_OVERFLOW						=	1771,
644 	RPC_X_NO_MORE_ENTRIES					=	1772,
645 	RPC_X_SS_CHAR_TRANS_OPEN_FAIL			=	1773,
646 	RPC_X_SS_CHAR_TRANS_SHORT_FILE			=	1774,
647 	RPC_X_SS_IN_NULL_CONTEXT				=	1775,
648 	RPC_X_SS_CONTEXT_DAMAGED				=	1777,
649 	RPC_X_SS_HANDLES_MISMATCH				=	1778,
650 	RPC_X_SS_CANNOT_GET_CALL_HANDLE			=	1779,
651 	RPC_X_NULL_REF_POINTER					=	1780,
652 	RPC_X_ENUM_VALUE_OUT_OF_RANGE			=	1781,
653 	RPC_X_BYTE_COUNT_TOO_SMALL				=	1782,
654 	RPC_X_BAD_STUB_DATA						=	1783,
655 	ERROR_INVALID_USER_BUFFER				=	1784,
656 	ERROR_UNRECOGNIZED_MEDIA				=	1785,
657 	ERROR_NO_TRUST_LSA_SECRET				=	1786,
658 	ERROR_NO_TRUST_SAM_ACCOUNT				=	1787,
659 	ERROR_TRUSTED_DOMAIN_FAILURE			=	1788,
660 	ERROR_TRUSTED_RELATIONSHIP_FAILURE		=	1789,
661 	ERROR_TRUST_FAILURE						=	1790,
662 	RPC_S_CALL_IN_PROGRESS					=	1791,
663 	ERROR_NETLOGON_NOT_STARTED				=	1792,
664 	ERROR_ACCOUNT_EXPIRED					=	1793,
665 	ERROR_REDIRECTOR_HAS_OPEN_HANDLES		=	1794,
666 	ERROR_PRINTER_DRIVER_ALREADY_INSTALLED	=	1795,
667 	ERROR_UNKNOWN_PORT						=	1796,
668 	ERROR_UNKNOWN_PRINTER_DRIVER			=	1797,
669 	ERROR_UNKNOWN_PRINTPROCESSOR			=	1798,
670 	ERROR_INVALID_SEPARATOR_FILE			=	1799,
671 	ERROR_INVALID_PRIORITY					=	1800,
672 	ERROR_INVALID_PRINTER_NAME				=	1801,
673 	ERROR_PRINTER_ALREADY_EXISTS			=	1802,
674 	ERROR_INVALID_PRINTER_COMMAND			=	1803,
675 	ERROR_INVALID_DATATYPE					=	1804,
676 	ERROR_INVALID_ENVIRONMENT				=	1805,
677 	RPC_S_NO_MORE_BINDINGS					=	1806,
678 	ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT	=	1807,
679 	ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT	=	1808,
680 	ERROR_NOLOGON_SERVER_TRUST_ACCOUNT		=	1809,
681 	ERROR_DOMAIN_TRUST_INCONSISTENT			=	1810,
682 	ERROR_SERVER_HAS_OPEN_HANDLES			=	1811,
683 	ERROR_RESOURCE_DATA_NOT_FOUND			=	1812,
684 	ERROR_RESOURCE_TYPE_NOT_FOUND			=	1813,
685 	ERROR_RESOURCE_NAME_NOT_FOUND			=	1814,
686 	ERROR_RESOURCE_LANG_NOT_FOUND			=	1815,
687 	ERROR_NOT_ENOUGH_QUOTA					=	1816,
688 	RPC_S_NO_INTERFACES						=	1817,
689 	RPC_S_CALL_CANCELLED					=	1818,
690 	RPC_S_BINDING_INCOMPLETE				=	1819,
691 	RPC_S_COMM_FAILURE						=	1820,
692 	RPC_S_UNSUPPORTED_AUTHN_LEVEL			=	1821,
693 	RPC_S_NO_PRINC_NAME						=	1822,
694 	RPC_S_NOT_RPC_ERROR						=	1823,
695 	RPC_S_UUID_LOCAL_ONLY					=	1824,
696 	RPC_S_SEC_PKG_ERROR						=	1825,
697 	RPC_S_NOT_CANCELLED						=	1826,
698 	RPC_X_INVALID_ES_ACTION					=	1827,
699 	RPC_X_WRONG_ES_VERSION					=	1828,
700 	RPC_X_WRONG_STUB_VERSION				=	1829,
701 	RPC_S_GROUP_MEMBER_NOT_FOUND			=	1898,
702 	EPT_S_CANT_CREATE						=	1899,
703 	RPC_S_INVALID_OBJECT					=	1900,
704 	ERROR_INVALID_TIME						=	1901,
705 	ERROR_INVALID_FORM_NAME					=	1902,
706 	ERROR_INVALID_FORM_SIZE					=	1903,
707 	ERROR_ALREADY_WAITING					=	1904,
708 	ERROR_PRINTER_DELETED					=	1905,
709 	ERROR_INVALID_PRINTER_STATE				=	1906,
710 	ERROR_PASSWORD_MUST_CHANGE				=	1907,
711 	ERROR_DOMAIN_CONTROLLER_NOT_FOUND		=	1908,
712 	ERROR_ACCOUNT_LOCKED_OUT				=	1909,
713 	ERROR_NO_BROWSER_SERVERS_FOUND			=	6118,
714 	ERROR_INVALID_PIXEL_FORMAT				=	2000,
715 	ERROR_BAD_DRIVER						=	2001,
716 	ERROR_INVALID_WINDOW_STYLE				=	2002,
717 	ERROR_METAFILE_NOT_SUPPORTED			=	2003,
718 	ERROR_TRANSFORM_NOT_SUPPORTED			=	2004,
719 	ERROR_CLIPPING_NOT_SUPPORTED			=	2005,
720 	ERROR_UNKNOWN_PRINT_MONITOR				=	3000,
721 	ERROR_PRINTER_DRIVER_IN_USE				=	3001,
722 	ERROR_SPOOL_FILE_NOT_FOUND				=	3002,
723 	ERROR_SPL_NO_STARTDOC					=	3003,
724 	ERROR_SPL_NO_ADDJOB						=	3004,
725 	ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED	=	3005,
726 	ERROR_PRINT_MONITOR_ALREADY_INSTALLED	=	3006,
727 	ERROR_WINS_INTERNAL						=	4000,
728 	ERROR_CAN_NOT_DEL_LOCAL_WINS			=	4001,
729 	ERROR_STATIC_INIT						=	4002,
730 	ERROR_INC_BACKUP						=	4003,
731 	ERROR_FULL_BACKUP						=	4004,
732 	ERROR_REC_NON_EXISTENT					=	4005,
733 	ERROR_RPL_NOT_ALLOWED					=	4006,*/
734 	WSA_OK					=	0,		/* No error */
735 	WSA_INVALID_HANDLE		=	6,		/* Specified event object handle is invalid. */
736 	WSA_NOT_ENOUGH_MEMORY	= 	8,		/* Insufficient memory available. */
737 	WSA_INVALID_PARAMETER 	=	87,		/* One or more parameters are invalid. */
738 	WSA_OPERATION_ABORTED	=	995,	/* Overlapped operation aborted. */
739 	WSA_IO_INCOMPLETE		=	996,	/* Overlapped I/O event object not in signaled state. */
740 	WSA_IO_PENDING			=	997,	/* Overlapped operations will complete later. */
741 	WSAEINTR				=	10004,	/* Interrupted function call. */
742 	WSAEBADF				=	10009,	/* File handle is not valid. */
743 	WSAEACCES				=	10013,	/* Permission denied. */
744 	WSAEFAULT				=	10014,	/* Bad address. */
745 	WSAEINVAL				=	10022,	/* Invalid argument. */
746 	WSAEMFILE				=	10024,	/* Too many open files. */
747 	WSAEWOULDBLOCK			=	10035,	/* Resource temporarily unavailable. */
748 	WSAEINPROGRESS			=	10036,	/* Operation now in progress. */
749 	WSAEALREADY				=	10037,	/* Operation already in progress. */
750 	WSAENOTSOCK				=	10038,	/* Socket operation on nonsocket. */
751 	WSAEDESTADDRREQ			=	10039,	/* Destination address required. */
752 	WSAEMSGSIZE				=	10040,	/* Message too long. */
753 	WSAEPROTOTYPE			=	10041,	/* Protocol wrong type for socket. */
754 	WSAENOPROTOOPT			=	10042,	/* Bad protocol option. */
755 	WSAEPROTONOSUPPORT		=	10043,	/* Protocol not supported. */
756 	WSAESOCKTNOSUPPORT		=	10044,	/* Socket type not supported. */
757 	WSAEOPNOTSUPP			=	10045,	/* Operation not supported. */
758 	WSAEPFNOSUPPORT			=	10046,	/* Protocol family not supported. */
759 	WSAEAFNOSUPPORT			=	10047,	/* Address family not supported by protocol family. */
760 	WSAEADDRINUSE			=	10048,	/* Address already in use. */
761 	WSAEADDRNOTAVAIL		=	10049,	/* Cannot assign requested address. */
762 	WSAENETDOWN				=	10050,	/* Network is down. */
763 	WSAENETUNREACH			=	10051,	/* Network is unreachable. */
764 	WSAENETRESET			=	10052,	/* Network dropped connection on reset. */
765 	WSAECONNABORTED			=	10053,	/* Software caused connection abort. */
766 	WSAECONNRESET			=	10054,	/* Connection reset by peer. */
767 	WSAENOBUFS				=	10055,	/* No buffer space available. */
768 	WSAEISCONN				=	10056,	/* Socket is already connected. */
769 	WSAENOTCONN				=	10057,	/* Socket is not connected. */
770 	WSAESHUTDOWN			=	10058,	/* Cannot send after socket shutdown. */
771 	WSAETOOMANYREFS			=	10059,	/* Too many references. */
772 	WSAETIMEDOUT			=	10060,	/* Connection timed out. */
773 	WSAECONNREFUSED			=	10061,	/* Connection refused. */
774 	WSAELOOP				=	10062,	/* Cannot translate name. */
775 	WSAENAMETOOLONG			=	10063,	/* Name too long. */
776 	WSAEHOSTDOWN			=	10064,	/* Host is down. */
777 	WSAEHOSTUNREACH			=	10065,	/* No route to host. */
778 	WSAENOTEMPTY			=	10066,	/* Directory not empty. */
779 	WSAEPROCLIM				=	10067,	/* Too many processes. */
780 	WSAEUSERS				=	10068,	/* User quota exceeded. */
781 	WSAEDQUOT				=	10069,	/* Disk quota exceeded. */
782 	WSAESTALE				=	10070,	/* Stale file handle reference. */
783 	WSAEREMOTE				=	10071,	/* Item is remote. */
784 	WSASYSNOTREADY			=	10091,	/* Network subsystem is unavailable. */
785 	WSAVERNOTSUPPORTED		=	10092,	/* Winsock.dll version out of range. */
786 	WSANOTINITIALISED		=	10093,	/* Successful WSAStartup not yet performed. */
787 	WSAEDISCON				=	10101,	/* Graceful shutdown in progress. */
788 	WSAENOMORE				=	10102,	/* No more results. */
789 	WSAECANCELLED			=	10103,	/* Call has been canceled. */
790 	WSAEINVALIDPROCTABLE	=	10104,	/* Procedure call table is invalid. */
791 	WSAEINVALIDPROVIDER		=	10105,	/* Service provider is invalid. */
792 	WSAEPROVIDERFAILEDINIT	=	10106,	/* Service provider failed to initialize. */
793 	WSASYSCALLFAILURE		=	10107,	/* System call failure. */
794 	WSASERVICE_NOT_FOUND	=	10108,	/* Service not found. */
795 	WSATYPE_NOT_FOUND		=	10109,	/* Class type not found. */
796 	WSA_E_NO_MORE			=	10110,	/* No more results. */
797 	WSA_E_CANCELLED			=	10111,	/* Call was canceled. */
798 	WSAEREFUSED				=	10112,	/* Database query was refused. */
799 	WSAHOST_NOT_FOUND		=	11001,	/* Host not found. */
800 	WSATRY_AGAIN			=	11002,	/* Nonauthoritative host not found. */
801 	WSANO_RECOVERY			=	11003,	/* This is a nonrecoverable error. */
802 	WSANO_DATA				=	11004,	/* Valid name, no data record of requested type. */
803 	WSA_QOS_RECEIVERS		=	11005,	/* QOS receivers. */
804 	WSA_QOS_SENDERS			=	11006,	/* QOS senders. */
805 	WSA_QOS_NO_SENDERS		=	11007,	/* No QOS senders. */
806 	WSA_QOS_NO_RECEIVERS	=	11008,	/* QOS no receivers. */
807 	WSA_QOS_REQUEST_CONFIRMED	=	11009,	/* QOS request confirmed. */
808 	WSA_QOS_ADMISSION_FAILURE	=	11010,	/* QOS admission error. */
809 	WSA_QOS_POLICY_FAILURE		=	11011,	/* QOS policy failure. */
810 	WSA_QOS_BAD_STYLE			=	11012,	/* QOS bad style. */
811 	WSA_QOS_BAD_OBJECT			=	11013,	/* QOS bad object. */
812 	WSA_QOS_TRAFFIC_CTRL_ERROR	=	11014,	/* QOS traffic control error. */
813 	WSA_QOS_GENERIC_ERROR		=	11015,	/* QOS generic error. */
814 	WSA_QOS_ESERVICETYPE		=	11016,	/* QOS service type error. */
815 	WSA_QOS_EFLOWSPEC			=	11017,	/* QOS flowspec error. */
816 	WSA_QOS_EPROVSPECBUF		=	11018,	/* Invalid QOS provider buffer. */
817 	WSA_QOS_EFILTERSTYLE		=	11019,	/* Invalid QOS filter style. */
818 	WSA_QOS_EFILTERTYPE			=	11020,	/* Invalid QOS filter type. */
819 	WSA_QOS_EFILTERCOUNT		=	11021,	/* Incorrect QOS filter count. */
820 	WSA_QOS_EOBJLENGTH			=	11022,	/* Invalid QOS object length. */
821 	WSA_QOS_EFLOWCOUNT			=	11023,	/* Incorrect QOS flow count. */
822 	WSA_QOS_EUNKOWNPSOBJ		=	11024,	/* Unrecognized QOS object. */
823 	WSA_QOS_EPOLICYOBJ			=	11025,	/* Invalid QOS policy object. */
824 	WSA_QOS_EFLOWDESC			=	11026,	/* Invalid QOS flow descriptor. */
825 	WSA_QOS_EPSFLOWSPEC			=	11027,	/* Invalid QOS provider-specific flowspec. */
826 	WSA_QOS_EPSFILTERSPEC		=	11028,	/* Invalid QOS provider-specific filterspec. */
827 	WSA_QOS_ESDMODEOBJ			=	11029,	/* Invalid QOS shape discard mode object. */
828 	WSA_QOS_ESHAPERATEOBJ		=	11030,	/* Invalid QOS shaping rate object. */
829 	WSA_QOS_RESERVED_PETYPE		=	11031	/* Reserved policy QOS element type. */
830 }
831 
832 version(OSX) enum EPosix : int {
833 
834 	EAI_OVERFLOW	=		-12,	/* Argument buffer overflow.  */
835 	EAI_SYSTEM		=		-11,	/* System error returned in `errno'.  */
836 	EAI_MEMORY		=		-10,	/* Memory allocation failure.  */
837 	EAI_ADDRFAMILY	=		-9,		/* Address family for NAME not supported. */
838 	EAI_SERVICE		=		-8,		/* SERVICE not supported for `ai_socktype'.  */
839 	EAI_SOCKTYPE	=		-7,		/* `ai_socktype' not supported.  */
840 	EAI_FAMILY		=		-6,		/* `ai_family' not supported.  */
841 	EAI_FAIL		=		-4,		/* Non-recoverable failure in name res.  */
842 	EAI_AGAIN		=		-3,		/* Temporary failure in name resolution.  */
843 	EAI_NONAME		=		-2,		/* NAME or SERVICE is unknown.  */
844 	/*EAI_BADFLAGS	=		-1,    	Invalid value for `ai_flags' field.  */
845 	EINVALID		=		-1,
846 	EOK				=		0,
847 	EPERM			=	1,		/* Operation not permitted */
848 	ENOENT			=	2,		/* No such file or directory */
849 	ESRCH			=	3,		/* No such process */
850 	EINTR			=	4,		/* Interrupted system call */
851 	EIO				=	5,		/* Input/output error */
852 	ENXIO			=	6,		/* Device not configured */
853 	E2BIG			=	7,		/* Argument list too long */
854 	ENOEXEC			=	8,		/* Exec format error */
855 	EBADF			=	9,		/* Bad file descriptor */
856 	ECHILD			=	10,		/* No child processes */
857 	EDEADLK			=	11,		/* Resource deadlock avoided */
858 	/* 11 was EAGAIN */
859 	ENOMEM			=	12,		/* Cannot allocate memory */
860 	EACCES			=	13,		/* Permission denied */
861 	EFAULT			=	14,		/* Bad address */
862 	ENOTBLK			=	15,		/* Block device required */
863 	EBUSY			=	16,		/* Device busy */
864 	EEXIST			=	17,		/* File exists */
865 	EXDEV			=	18,		/* Cross-device link */
866 	ENODEV			=	19,		/* Operation not supported by device */
867 	ENOTDIR			=	20,		/* Not a directory */
868 	EISDIR			=	21,		/* Is a directory */
869 	EINVAL			=	22,		/* Invalid argument */
870 	ENFILE			=	23,		/* Too many open files in system */
871 	EMFILE			=	24,		/* Too many open files */
872 	ENOTTY			=	25,		/* Inappropriate ioctl for device */
873 	ETXTBSY			=	26,		/* Text file busy */
874 	EFBIG			=	27,		/* File too large */
875 	ENOSPC			=	28,		/* No space left on device */
876 	ESPIPE			=	29,		/* Illegal seek */
877 	EROFS			=	30,		/* Read-only filesystem */
878 	EMLINK			=	31,		/* Too many links */
879 	EPIPE			=	32,		/* Broken pipe */
880 	/* math software */
881 	EDOM			=	33,		/* Numerical argument out of domain */
882 	ERANGE			=	34,		/* Result too large */
883 
884 	/* non-blocking and interrupt i/o */
885 	EAGAIN			=	35,		/* Resource temporarily unavailable */
886 	EWOULDBLOCK		= 	EAGAIN,	/* Operation would block */
887 	EINPROGRESS		=	36,		/* Operation now in progress */
888 	EALREADY		=	37,		/* Operation already in progress */
889 
890 	/* ipc/network software -- argument errors */
891 	ENOTSOCK		=	38,		/* Socket operation on non-socket */
892 	EDESTADDRREQ	=	39,		/* Destination address required */
893 	EMSGSIZE		=	40,		/* Message too long */
894 	EPROTOTYPE		=	41,		/* Protocol wrong type for socket */
895 	ENOPROTOOPT		=	42,		/* Protocol not available */
896 	EPROTONOSUPPORT	=	43,		/* Protocol not supported */
897 	ESOCKTNOSUPPORT	=	44,		/* Socket type not supported */
898 	EOPNOTSUPP		=	45,		/* Operation not supported */
899 	ENOTSUP			=	EOPNOTSUPP,		/* Operation not supported */
900 	EPFNOSUPPORT	=	46,		/* Protocol family not supported */
901 	EAFNOSUPPORT	=	47,		/* Address family not supported by protocol family */
902 	EADDRINUSE		=	48,		/* Address already in use */
903 	EADDRNOTAVAIL	=	49,		/* Can't assign requested address */
904 
905 	/* ipc/network software -- operational errors */
906 	ENETDOWN		=	50,		/* Network is down */
907 	ENETUNREACH		=	51,		/* Network is unreachable */
908 	ENETRESET		=	52,		/* Network dropped connection on reset */
909 	ECONNABORTED	=	53,		/* Software caused connection abort */
910 	ECONNRESET		=	54,		/* Connection reset by peer */
911 	ENOBUFS			=	55,		/* No buffer space available */
912 	EISCONN			=	56,		/* Socket is already connected */
913 	ENOTCONN		=	57,		/* Socket is not connected */
914 	ESHUTDOWN		=	58,		/* Can't send after socket shutdown */
915 	ETOOMANYREFS	=	59,		/* Too many references: can't splice */
916 	ETIMEDOUT		=	60,		/* Operation timed out */
917 	ECONNREFUSED	=	61,		/* Connection refused */
918 
919 	ELOOP			=	62,		/* Too many levels of symbolic links */
920 	ENAMETOOLONG	=	63,		/* File name too long */
921 
922 	/* should be rearranged */
923 	EHOSTDOWN		=	64,		/* Host is down */
924 	EHOSTUNREACH	=	65,		/* No route to host */
925 	ENOTEMPTY		=	66,		/* Directory not empty */
926 
927 	/* quotas & mush */
928 	EPROCLIM		=	67,		/* Too many processes */
929 	EUSERS			=	68,		/* Too many users */
930 	EDQUOT			=	69,		/* Disc quota exceeded */
931 
932 	/* Network File System */
933 	ESTALE			=	70,		/* Stale NFS file handle */
934 	EREMOTE			=	71,		/* Too many levels of remote in path */
935 	EBADRPC			=	72,		/* RPC struct is bad */
936 	ERPCMISMATCH	=	73,		/* RPC version wrong */
937 	EPROGUNAVAIL	=	74,		/* RPC prog. not avail */
938 	EPROGMISMATCH	=	75,		/* Program version wrong */
939 	EPROCUNAVAIL	=	76,		/* Bad procedure for program */
940 
941 	ENOLCK			=	77,		/* No locks available */
942 	ENOSYS			=	78,		/* Function not implemented */
943 	EFTYPE			=	79,		/* Inappropriate file type or format */
944 	EAUTH			=	80,		/* Authentication error */
945 	ENEEDAUTH		=	81,		/* Need authenticator */
946 	EIDRM			=	82,		/* Identifier removed */
947 	ENOMSG			=	83,		/* No message of desired type */
948 	EOVERFLOW		=	84,		/* Value too large to be stored in data type */
949 	ECANCELED		=	85,		/* Operation canceled */
950 	EILSEQ			=	86,		/* Illegal byte sequence */
951 	ENOATTR			=	87,		/* Attribute not found */
952 
953 	EDOOFUS			=	88,		/* Programming error */
954 
955 	EBADMSG			=	89,		/* Bad message */
956 	EMULTIHOP		=	90,		/* Multihop attempted */
957 	ENOLINK			=	91,		/* Link has been severed */
958 	EPROTO			=	92,		/* Protocol error */
959 	ENOTCAPABLE		=	93,		/* Capabilities insufficient */
960 	ECAPMODE		=	94,		/* Not permitted in capability mode */
961 	ELAST			=	94		/* Must be equal largest errno */
962 }
963 
964 version(linux) enum EPosix : int {
965 
966 	EAI_OVERFLOW	=		-12,	/* Argument buffer overflow.  */
967 	EAI_SYSTEM		=		-11,	/* System error returned in `errno'.  */
968 	EAI_MEMORY		=		-10,	/* Memory allocation failure.  */
969 	EAI_ADDRFAMILY	=		-9,		/* Address family for NAME not supported. */
970 	EAI_SERVICE		=		-8,		/* SERVICE not supported for `ai_socktype'.  */
971 	EAI_SOCKTYPE	=		-7,		/* `ai_socktype' not supported.  */
972 	EAI_FAMILY		=		-6,		/* `ai_family' not supported.  */
973 	EAI_FAIL		=		-4,		/* Non-recoverable failure in name res.  */
974 	EAI_AGAIN		=		-3,		/* Temporary failure in name resolution.  */
975 	EAI_NONAME		=		-2,		/* NAME or SERVICE is unknown.  */
976 	/*EAI_BADFLAGS	=		-1,    	Invalid value for `ai_flags' field.  */
977 	EINVALID		=		-1,
978 	EOK				=		0,
979 	EPERM			=		1,      /* Operation not permitted */
980 	ENOENT			=		2,      /* No such file or directory */
981 	ESRCH			=		3,      /* No such process */
982 	EINTR			=		4,      /* Interrupted system call */
983 	EIO				=		5,      /* I/O error */
984 	ENXIO			=		6,      /* No such device or address */
985 	E2BIG			=		7,      /* Argument list too long */
986 	ENOEXEC			=		8,      /* Exec format error */
987 	EBADF			=		9,      /* Bad file number */
988 	ECHILD			=		10,      /* No child processes */
989 	EAGAIN			=		11,      /* Try again */
990 	ENOMEM			=		12,      /* Out of memory */
991 	EACCES			=		13,      /* Permission denied */
992 	EFAULT			=		14,      /* Bad address */
993 	ENOTBLK			=		15,      /* Block device required */
994 	EBUSY			=		16,      /* Device or resource busy */
995 	EEXIST			=		17,      /* File exists */
996 	EXDEV			=		18,      /* Cross-device link */
997 	ENODEV			=		19,      /* No such device */
998 	ENOTDIR			=		20,      /* Not a directory */
999 	EISDIR			=		21,      /* Is a directory */
1000 	EINVAL			=		22,      /* Invalid argument */
1001 	ENFILE			=		23,      /* File table overflow */
1002 	EMFILE			=		24,      /* Too many open files */
1003 	ENOTTY			=		25,      /* Not a typewriter */
1004 	ETXTBSY			=		26,      /* Text file busy */
1005 	EFBIG			=		27,      /* File too large */
1006 	ENOSPC			=		28,      /* No space left on device */
1007 	ESPIPE			=		29,      /* Illegal seek */
1008 	EROFS			=		30,      /* Read-only file system */
1009 	EMLINK			=		31,      /* Too many links */
1010 	EPIPE			=		32,	     /* Broken pipe */
1011 	EDOM			=		33,      /* Math argument out of domain of func */
1012 	ERANGE			=		34,      /* Math result not representable */
1013 	EDEADLK			=		35,      /* Resource deadlock would occur */
1014 	ENAMETOOLONG	=		36,      /* File name too long */
1015 	ENOLCK			=		37,      /* No record locks available */
1016 	ENOSYS			=		38,      /* Function not implemented */
1017 	ENOTEMPTY		=		39,      /* Directory not empty */
1018 	ELOOP			=		40,      /* Too many symbolic links encountered */
1019 	EWOULDBLOCK		=		EAGAIN,  /* Operation would block */
1020 	ENOMSG			=		42,      /* No message of desired type */
1021 	EIDRM			=		43,      /* Identifier removed */
1022 	ECHRNG			=		44,      /* Channel number out of range */
1023 	EL2NSYNC		=		45,      /* Level 2 not synchronized */
1024 	EL3HLT			=		46,      /* Level 3 halted */
1025 	EL3RST			=		47,      /* Level 3 reset */
1026 	ELNRNG			=		48,      /* Link number out of range */
1027 	EUNATCH			=		49,      /* Protocol driver not attached */
1028 	ENOCSI			=		50,      /* No CSI structure available */
1029 	EL2HLT			=		51,      /* Level 2 halted */
1030 	EBADE			=		52,      /* Invalid exchange */
1031 	EBADR			=		53,      /* Invalid request descriptor */
1032 	EXFULL			=		54,      /* Exchange full */
1033 	ENOANO			=		55,      /* No anode */
1034 	EBADRQC			=		56,      /* Invalid request code */
1035 	EBADSLT			=		57,      /* Invalid slot */
1036 	ESHUTDOWN2		=		58,
1037 	EDEADLOCK		=		EDEADLK,
1038 	EBFONT			=		59,      /* Bad font file format */
1039 	ENOSTR			=		60,      /* Device not a stream */
1040 	ENODATA			=		61,      /* No data available */
1041 	ETIME			=		62,      /* Timer expired */
1042 	ENOSR			=		63,      /* Out of streams resources */
1043 	ENONET			=		64,      /* Machine is not on the network */
1044 	ENOPKG			=		65,      /* Package not installed */
1045 	EREMOTE			=		66,      /* Object is remote */
1046 	ENOLINK			=		67,      /* Link has been severed */
1047 	EADV			=		68,      /* Advertise error */
1048 	ESRMNT			=		69,      /* Srmount error */
1049 	ECOMM			=		70,      /* Communication error on send */
1050 	EPROTO			=		71,      /* Protocol error */
1051 	EMULTIHOP		=		72,      /* Multihop attempted */
1052 	EDOTDOT			=		73,      /* RFS specific error */
1053 	EBADMSG			=		74,      /* Not a data message */
1054 	EOVERFLOW		=		75,      /* Value too large for defined data type */
1055 	ENOTUNIQ		=		76,      /* Name not unique on network */
1056 	EBADFD			=		77,      /* File descriptor in bad state */
1057 	EREMCHG			=		78,      /* Remote address changed */
1058 	ELIBACC			=		79,      /* Can not access a needed shared library */
1059 	ELIBBAD			=		80,      /* Accessing a corrupted shared library */
1060 	ELIBSCN			=		81,      /* .lib section in a.out corrupted */
1061 	ELIBMAX			=		82,      /* Attempting to link in too many shared libraries */
1062 	ELIBEXEC		=		83,      /* Cannot exec a shared library directly */
1063 	EILSEQ			=		84,      /* Illegal byte sequence */
1064 	ERESTART		=		85,      /* Interrupted system call should be restarted */
1065 	ESTRPIPE		=		86,      /* Streams pipe error */
1066 	EUSERS			=		87,      /* Too many users */
1067 	ENOTSOCK		=		88,      /* Socket operation on non-socket */
1068 	EDESTADDRREQ	=		89,      /* Destination address required */
1069 	EMSGSIZE		=		90,      /* Message too long */
1070 	EPROTOTYPE		=		91,      /* Protocol wrong type for socket */
1071 	ENOPROTOOPT		=		92,      /* Protocol not available */
1072 	EPROTONOSUPPORT	=		93,      /* Protocol not supported */
1073 	ESOCKTNOSUPPORT	=		94,      /* Socket type not supported */
1074 	EOPNOTSUPP		=		95,      /* Operation not supported on transport endpoint */
1075 	EPFNOSUPPORT	=		96,      /* Protocol family not supported */
1076 	EAFNOSUPPORT	=		97,      /* Address family not supported by protocol */
1077 	EADDRINUSE		=		98,      /* Address already in use */
1078 	EADDRNOTAVAIL	=		99,      /* Cannot assign requested address */
1079 	ENETDOWN		=		100,     /* Network is down */
1080 	ENETUNREACH		=		101,     /* Network is unreachable */
1081 	ENETRESET		=		102,     /* Network dropped connection because of reset */
1082 	ECONNABORTED	=		103,     /* Software caused connection abort */
1083 	ECONNRESET		=		104,     /* Connection reset by peer */
1084 	ENOBUFS			=		105,     /* No buffer space available */
1085 	EISCONN			=		106,     /* Transport endpoint is already connected */
1086 	ENOTCONN		=		107,     /* Transport endpoint is not connected */
1087 	ESHUTDOWN		=		108,     /* Cannot send after transport endpoint shutdown */
1088 	ETOOMANYREFS	=		109,     /* Too many references: cannot splice */
1089 	ETIMEDOUT		=		110,     /* Connection timed out */
1090 	ECONNREFUSED	=		111,     /* Connection refused */
1091 	EHOSTDOWN		=		112,     /* Host is down */
1092 	EHOSTUNREACH	=		113,     /* No route to host */
1093 	EALREADY		=		114,     /* Operation already in progress */
1094 	EINPROGRESS		=		115,     /* Operation now in progress */
1095 	ESTALE			=		116,     /* Stale file handle */
1096 	EUCLEAN			=		117,     /* Structure needs cleaning */
1097 	ENOTNAM			=		118,     /* Not a XENIX named type file */
1098 	ENAVAIL			=		119,     /* No XENIX semaphores available */
1099 	EISNAM			=		120,     /* Is a named type file */
1100 	EREMOTEIO		=		121,     /* Remote I/O error */
1101 	EDQUOT			=		122,     /* Quota exceeded */
1102 	ENOMEDIUM		=		123,     /* No medium found */
1103 	EMEDIUMTYPE		=		124,     /* Wrong medium type */
1104 	ECANCELED		=		125,     /* Operation Canceled */
1105 	ENOKEY			=		126,     /* Required key not available */
1106 	EKEYEXPIRED		=		127,     /* Key has expired */
1107 	EKEYREVOKED		=		128,     /* Key has been revoked */
1108 	EKEYREJECTED	=		129,     /* Key was rejected by service */
1109 	/* for robust mutexes */
1110 	EOWNERDEAD		=		130,     /* Owner died */
1111 	ENOTRECOVERABLE	=		131,     /* State not recoverable */
1112 	ERFKILL			=		132,     /* Operation not possible due to RF-kill */
1113 	EHWPOISON		=		133     /* Memory page has hardware error */
1114 }
1115 
1116 string[EWIN] EWSAMessages;
1117 version(Posix) string[EPosix] EPosixMessages;
1118 
1119 static this() {
1120 	with (EWIN){
1121 		EWSAMessages = [
1122 			WSA_OK					:	"No error",
1123 			WSA_INVALID_HANDLE		:	"Specified event object handle is invalid.",
1124 			WSA_NOT_ENOUGH_MEMORY	: 	"Insufficient memory available.",
1125 			WSA_INVALID_PARAMETER 	:	"One or more parameters are invalid.",
1126 			WSA_OPERATION_ABORTED	:	"Overlapped operation aborted.",
1127 			WSA_IO_INCOMPLETE		:	"Overlapped I/O event object not in signaled state.",
1128 			WSA_IO_PENDING			:	"Overlapped operations will complete later.",
1129 			WSAEINTR				:	"Interrupted function call.",
1130 			WSAEBADF				:	"File handle is not valid.",
1131 			WSAEACCES				:	"Permission denied.",
1132 			WSAEFAULT				:	"Bad address.",
1133 			WSAEINVAL				:	"Invalid argument.",
1134 			WSAEMFILE				:	"Too many open files.",
1135 			WSAEWOULDBLOCK			:	"Resource temporarily unavailable.",
1136 			WSAEINPROGRESS			:	"Operation now in progress.",
1137 			WSAEALREADY				:	"Operation already in progress.",
1138 			WSAENOTSOCK				:	"Socket operation on nonsocket.",
1139 			WSAEDESTADDRREQ			:	"Destination address required.",
1140 			WSAEMSGSIZE				:	"Message too long.",
1141 			WSAEPROTOTYPE			:	"Protocol wrong type for socket.",
1142 			WSAENOPROTOOPT			:	"Bad protocol option.",
1143 			WSAEPROTONOSUPPORT		:	"Protocol not supported.",
1144 			WSAESOCKTNOSUPPORT		:	"Socket type not supported.",
1145 			WSAEOPNOTSUPP			:	"Operation not supported.",
1146 			WSAEPFNOSUPPORT			:	"Protocol family not supported.",
1147 			WSAEAFNOSUPPORT			:	"Address family not supported by protocol family.",
1148 			WSAEADDRINUSE			:	"Address already in use.",
1149 			WSAEADDRNOTAVAIL		:	"Cannot assign requested address.",
1150 			WSAENETDOWN				:	"Network is down.",
1151 			WSAENETUNREACH			:	"Network is unreachable.",
1152 			WSAENETRESET			:	"Network dropped connection on reset.",
1153 			WSAECONNABORTED			:	"Software caused connection abort.",
1154 			WSAECONNRESET			:	"Connection reset by peer.",
1155 			WSAENOBUFS				:	"No buffer space available.",
1156 			WSAEISCONN				:	"Socket is already connected.",
1157 			WSAENOTCONN				:	"Socket is not connected.",
1158 			WSAESHUTDOWN			:	"Cannot send after socket shutdown.",
1159 			WSAETOOMANYREFS			:	"Too many references.",
1160 			WSAETIMEDOUT			:	"Connection timed out.",
1161 			WSAECONNREFUSED			:	"Connection refused.",
1162 			WSAELOOP				:	"Cannot translate name.",
1163 			WSAENAMETOOLONG			:	"Name too long.",
1164 			WSAEHOSTDOWN			:	"Host is down.",
1165 			WSAEHOSTUNREACH			:	"No route to host.",
1166 			WSAENOTEMPTY			:	"Directory not empty.",
1167 			WSAEPROCLIM				:	"Too many processes.",
1168 			WSAEUSERS				:	"User quota exceeded.",
1169 			WSAEDQUOT				:	"Disk quota exceeded.",
1170 			WSAESTALE				:	"Stale file handle reference.",
1171 			WSAEREMOTE				:	"Item is remote.",
1172 			WSASYSNOTREADY			:	"Network subsystem is unavailable.",
1173 			WSAVERNOTSUPPORTED		:	"Winsock.dll version out of range.",
1174 			WSANOTINITIALISED		:	"Successful WSAStartup not yet performed.",
1175 			WSAEDISCON				:	"Graceful shutdown in progress.",
1176 			WSAENOMORE				:	"No more results.",
1177 			WSAECANCELLED			:	"Call has been canceled.",
1178 			WSAEINVALIDPROCTABLE	:	"Procedure call table is invalid.",
1179 			WSAEINVALIDPROVIDER		:	"Service provider is invalid.",
1180 			WSAEPROVIDERFAILEDINIT	:	"Service provider failed to initialize.",
1181 			WSASYSCALLFAILURE		:	"System call failure.",
1182 			WSASERVICE_NOT_FOUND	:	"Service not found.",
1183 			WSATYPE_NOT_FOUND		:	"Class type not found.",
1184 			WSA_E_NO_MORE			:	"No more results.",
1185 			WSA_E_CANCELLED			:	"Call was canceled.",
1186 			WSAEREFUSED				:	"Database query was refused.",
1187 			WSAHOST_NOT_FOUND		:	"Host not found.",
1188 			WSATRY_AGAIN			:	"Nonauthoritative host not found.",
1189 			WSANO_RECOVERY			:	"This is a nonrecoverable error.",
1190 			WSANO_DATA				:	"Valid name, no data record of requested type."/*,
1191 			WSA_QOS_RECEIVERS		:	"QOS receivers.",
1192 			WSA_QOS_SENDERS			:	"QOS senders.",
1193 			WSA_QOS_NO_SENDERS		:	"No QOS senders.",
1194 			WSA_QOS_NO_RECEIVERS	:	"QOS no receivers.",
1195 			WSA_QOS_REQUEST_CONFIRMED	:	"QOS request confirmed.",
1196 			WSA_QOS_ADMISSION_FAILURE	:	"QOS admission error.",
1197 			WSA_QOS_POLICY_FAILURE		:	"QOS policy failure.",
1198 			WSA_QOS_BAD_STYLE			:	"QOS bad style.",
1199 			WSA_QOS_BAD_OBJECT			:	"QOS bad object.",
1200 			WSA_QOS_TRAFFIC_CTRL_ERROR	:	"QOS traffic control error.",
1201 			WSA_QOS_GENERIC_ERROR		:	"QOS generic error.",
1202 			WSA_QOS_ESERVICETYPE		:	"QOS service type error.",
1203 			WSA_QOS_EFLOWSPEC			:	"QOS flowspec error.",
1204 			WSA_QOS_EPROVSPECBUF		:	"Invalid QOS provider buffer.",
1205 			WSA_QOS_EFILTERSTYLE		:	"Invalid QOS filter style.",
1206 			WSA_QOS_EFILTERTYPE			:	"Invalid QOS filter type.",
1207 			WSA_QOS_EFILTERCOUNT		:	"Incorrect QOS filter count.",
1208 			WSA_QOS_EOBJLENGTH			:	"Invalid QOS object length.",
1209 			WSA_QOS_EFLOWCOUNT			:	"Incorrect QOS flow count.",
1210 			WSA_QOS_EUNKOWNPSOBJ		:	"Unrecognized QOS object.",
1211 			WSA_QOS_EPOLICYOBJ			:	"Invalid QOS policy object.",
1212 			WSA_QOS_EFLOWDESC			:	"Invalid QOS flow descriptor.",
1213 			WSA_QOS_EPSFLOWSPEC			:	"Invalid QOS provider-specific flowspec.",
1214 			WSA_QOS_EPSFILTERSPEC		:	"Invalid QOS provider-specific filterspec.",
1215 			WSA_QOS_ESDMODEOBJ			:	"Invalid QOS shape discard mode object.",
1216 			WSA_QOS_ESHAPERATEOBJ		:	"Invalid QOS shaping rate object.",
1217 			WSA_QOS_RESERVED_PETYPE		:	"Reserved policy QOS element type."*/
1218 		];
1219 	}
1220 
1221 	version(Posix) with (EPosix){
1222 		EPosixMessages = [
1223 			EAI_OVERFLOW	:		"Argument buffer overflow.",
1224 			EAI_SYSTEM		:		"System error returned in `errno'.",
1225 			EAI_MEMORY		:		"Memory allocation failure. ",
1226 			EAI_ADDRFAMILY	:		"Address family for NAME not supported.",
1227 			EAI_SERVICE		:		"SERVICE not supported for `ai_socktype'.",
1228 			EAI_SOCKTYPE	:		"`ai_socktype' not supported.",
1229 			EAI_FAMILY		:		"`ai_family' not supported.",
1230 			EAI_FAIL		:		"Non-recoverable failure in name res.",
1231 			EAI_AGAIN		:		"Temporary failure in name resolution.",
1232 			EAI_NONAME		:		"NAME or SERVICE is unknown.",
1233 			EINVALID		:		"Invalid arguments",
1234 			EPERM			:		"Operation not permitted",
1235 			ENOENT			:		"No such file or directory",
1236 			ESRCH			:		"No such process",
1237 			EINTR			:		"Interrupted system call",
1238 			EIO				:		"I/O error",
1239 			ENXIO			:		"No such device or address",
1240 			E2BIG			:		"Argument list too long",
1241 			ENOEXEC			:		"Exec format error",
1242 			EBADF			:		"Bad file number",
1243 			ECHILD			:		"No child processes",
1244 			EAGAIN			:		"Try again",
1245 			ENOMEM			:		"Out of memory",
1246 			EACCES			:		"Permission denied",
1247 			EFAULT			:		"Bad address",
1248 			ENOTBLK			:		"Block device required",
1249 			EBUSY			:		"Device or resource busy",
1250 			EEXIST			:		"File exists",
1251 			EXDEV			:		"Cross-device link",
1252 			ENODEV			:		"No such device",
1253 			ENOTDIR			:		"Not a directory",
1254 			EISDIR			:		"Is a directory",
1255 			EINVAL			:		"Invalid argument",
1256 			ENFILE			:		"File table overflow",
1257 			EMFILE			:		"Too many open files",
1258 			ENOTTY			:		"Not a typewriter",
1259 			ETXTBSY			:		"Text file busy",
1260 			EFBIG			:		"File too large",
1261 			ENOSPC			:		"No space left on device",
1262 			ESPIPE			:		"Illegal seek",
1263 			EROFS			:		"Read-only file system",
1264 			EMLINK			:		"Too many links",
1265 			EPIPE			:		"Broken pipe",
1266 			EDOM			:		"Math argument out of domain of func",
1267 			ERANGE			:		"Math result not representable",
1268 			EDEADLK			:		"Resource deadlock would occur",
1269 			ENAMETOOLONG	:		"File name too long",
1270 			ENOLCK			:		"No record locks available",
1271 			ENOSYS			:		"Function not implemented",
1272 			ENOTEMPTY		:		"Directory not empty",
1273 			ELOOP			:		"Too many symbolic links encountered",
1274 			EWOULDBLOCK		:		"Operation would block",
1275 			ENOMSG			:		"No message of desired type",
1276 			EIDRM			:		"Identifier removed",
1277 /*			ECHRNG			:		"Channel number out of range",
1278 			EL2NSYNC		:		"Level 2 not synchronized",
1279 			EL3HLT			:		"Level 3 halted",
1280 			EL3RST			:		"Level 3 reset",
1281 			ELNRNG			:		"Link number out of range",
1282 			EUNATCH			:		"Protocol driver not attached",
1283 			ENOCSI			:		"No CSI structure available",
1284 			EL2HLT			:		"Level 2 halted",
1285 			EBADE			:		"Invalid exchange",
1286 			EBADR			:		"Invalid request descriptor",
1287 			EXFULL			:		"Exchange full",
1288 			ENOANO			:		"No anode",
1289 			EBADRQC			:		"Invalid request code",
1290 			EBADSLT			:		"Invalid slot",
1291 			EDEADLOCK		:		"Resource deadlock would occur",
1292 			EBFONT			:		"Bad font file format",
1293 			ENOSTR			:		"Device not a stream",
1294 			ENODATA			:		"No data available",
1295 			ETIME			:		"Timer expired",
1296 			ENOSR			:		"Out of streams resources",
1297 			ENONET			:		"Machine is not on the network",*/
1298 //			ENOPKG			:		"Package not installed",
1299 			EREMOTE			:		"Object is remote",
1300 			ENOLINK			:		"Link has been severed",
1301 //			EADV			:		"Advertise error",
1302 //			ESRMNT			:		"Srmount error",
1303 //			ECOMM			:		"Communication error on send",
1304 			EPROTO			:		"Protocol error",
1305 			EMULTIHOP		:		"Multihop attempted",
1306 //			EDOTDOT			:		"RFS specific error",
1307 			EBADMSG			:		"Not a data message",
1308 			EOVERFLOW		:		"Value too large for defined data type",
1309 //			ENOTUNIQ		:		"Name not unique on network",
1310 //			EBADFD			:		"File descriptor in bad state",
1311 //			EREMCHG			:		"Remote address changed",
1312 //			ELIBACC			:		"Can not access a needed shared library",
1313 //			ELIBBAD			:		"Accessing a corrupted shared library",
1314 //			ELIBSCN			:		".lib section in a.out corrupted",
1315 //			ELIBMAX			:		"Attempting to link in too many shared libraries",
1316 //			ELIBEXEC		:		"Cannot exec a shared library directly",
1317 			EILSEQ			:		"Illegal byte sequence",
1318 //			ERESTART		:		"Interrupted system call should be restarted",
1319 //			ESTRPIPE		:		"Streams pipe error",
1320 			EUSERS			:		"Too many users",
1321 			ENOTSOCK		:		"Socket operation on non-socket",
1322 			EDESTADDRREQ	:		"Destination address required",
1323 			EMSGSIZE		:		"Message too long",
1324 			EPROTOTYPE		:		"Protocol wrong type for socket",
1325 			ENOPROTOOPT		:		"Protocol not available",
1326 			EPROTONOSUPPORT	:		"Protocol not supported",
1327 			ESOCKTNOSUPPORT	:		"Socket type not supported",
1328 			EOPNOTSUPP		:		"Operation not supported on transport endpoint",
1329 			EPFNOSUPPORT	:		"Protocol family not supported",
1330 			EAFNOSUPPORT	:		"Address family not supported by protocol",
1331 			EADDRINUSE		:		"Address already in use",
1332 			EADDRNOTAVAIL	:		"Cannot assign requested address",
1333 			ENETDOWN		:		"Network is down",
1334 			ENETUNREACH		:		"Network is unreachable",
1335 			ENETRESET		:		"Network dropped connection because of reset",
1336 			ECONNABORTED	:		"Software caused connection abort",
1337 			ECONNRESET		:		"Connection reset by peer",
1338 			ENOBUFS			:		"No buffer space available",
1339 			EISCONN			:		"Transport endpoint is already connected",
1340 			ENOTCONN		:		"Transport endpoint is not connected",
1341 			ESHUTDOWN		:		"Cannot send after transport endpoint shutdown",
1342 			ETOOMANYREFS	:		"Too many references: cannot splice",
1343 			ETIMEDOUT		:		"Connection timed out",
1344 			ECONNREFUSED	:		"Connection refused",
1345 			EHOSTDOWN		:		"Host is down",
1346 			EHOSTUNREACH	:		"No route to host",
1347 			EALREADY		:		"Operation already in progress",
1348 			EINPROGRESS		:		"Operation now in progress",
1349 			ESTALE			:		"Stale file handle",
1350 /*			EUCLEAN			:		"Structure needs cleaning",
1351 			ENOTNAM			:		"Not a XENIX named type file",
1352 			ENAVAIL			:		"No XENIX semaphores available",
1353 			EISNAM			:		"Is a named type file",
1354 			EREMOTEIO		:		"Remote I/O error",
1355 			EDQUOT			:		"Quota exceeded",
1356 			ENOMEDIUM		:		"No medium found",
1357 			EMEDIUMTYPE		:		"Wrong medium type",
1358 */			ECANCELED		:		"Operation Canceled"
1359 /*			ENOKEY			:		"Required key not available",
1360 			EKEYEXPIRED		:		"Key has expired",
1361 			EKEYREVOKED		:		"Key has been revoked",
1362 			EKEYREJECTED	:		"Key was rejected by service",
1363 
1364 			EOWNERDEAD		:		"Owner died",
1365 			ENOTRECOVERABLE	:		"State not recoverable",
1366 			ERFKILL			:		"Operation not possible due to RF-kill",
1367 			EHWPOISON		:		"Memory page has hardware error"
1368 */		];
1369 	}
1370 }