#pragma once
// Win32 system error codes (a subset of the Windows SDK winerror.h),
// plus the Winsock codes consumers map to errno. Values are the stable
// Win32 error numbers. Included by <windows.h>.

#define ERROR_SUCCESS                  0
#define ERROR_INVALID_FUNCTION         1
#define ERROR_FILE_NOT_FOUND           2
#define ERROR_PATH_NOT_FOUND           3
#define ERROR_TOO_MANY_OPEN_FILES      4
#define ERROR_ACCESS_DENIED            5
#define ERROR_INVALID_HANDLE           6
#define ERROR_ARENA_TRASHED            7
#define ERROR_NOT_ENOUGH_MEMORY        8
#define ERROR_INVALID_BLOCK            9
#define ERROR_BAD_ENVIRONMENT          10
#define ERROR_BAD_FORMAT               11
#define ERROR_INVALID_ACCESS           12
#define ERROR_INVALID_DATA             13
#define ERROR_OUTOFMEMORY              14
#define ERROR_INVALID_DRIVE            15
#define ERROR_CURRENT_DIRECTORY        16
#define ERROR_NOT_SAME_DEVICE          17
#define ERROR_NO_MORE_FILES            18
#define ERROR_WRITE_PROTECT            19
#define ERROR_BAD_UNIT                 20
#define ERROR_NOT_READY                21
#define ERROR_BAD_COMMAND              22
#define ERROR_CRC                      23
#define ERROR_BAD_LENGTH               24
#define ERROR_SEEK                     25
#define ERROR_NOT_DOS_DISK             26
#define ERROR_SECTOR_NOT_FOUND         27
#define ERROR_OUT_OF_PAPER             28
#define ERROR_WRITE_FAULT              29
#define ERROR_READ_FAULT               30
#define ERROR_GEN_FAILURE              31
#define ERROR_SHARING_VIOLATION        32
#define ERROR_LOCK_VIOLATION           33
#define ERROR_WRONG_DISK               34
#define ERROR_SHARING_BUFFER_EXCEEDED  36
#define ERROR_HANDLE_EOF               38
#define ERROR_HANDLE_DISK_FULL         39
#define ERROR_NOT_SUPPORTED            50
#define ERROR_BAD_NETPATH              53
#define ERROR_NETWORK_BUSY             54
#define ERROR_DEV_NOT_EXIST            55
#define ERROR_BAD_NET_RESP             58
#define ERROR_UNEXP_NET_ERR            59
#define ERROR_NETNAME_DELETED          64
#define ERROR_NETWORK_ACCESS_DENIED    65
#define ERROR_BAD_DEV_TYPE             66
#define ERROR_BAD_NET_NAME             67
#define ERROR_FILE_EXISTS              80
#define ERROR_CANNOT_MAKE              82
#define ERROR_FAIL_I24                 83
#define ERROR_INVALID_PARAMETER        87
#define ERROR_NET_WRITE_FAULT          88
#define ERROR_NO_PROC_SLOTS            89
#define ERROR_TOO_MANY_SEMAPHORES      100
#define ERROR_DRIVE_LOCKED             108
#define ERROR_BROKEN_PIPE              109
#define ERROR_BUFFER_OVERFLOW          111
#define ERROR_DISK_FULL                112
#define ERROR_INVALID_TARGET_HANDLE    114
#define ERROR_SEM_TIMEOUT              121
#define ERROR_INSUFFICIENT_BUFFER      122
#define ERROR_INVALID_NAME             123
#define ERROR_INVALID_LEVEL            124
#define ERROR_MOD_NOT_FOUND            126
#define ERROR_PROC_NOT_FOUND           127
#define ERROR_WAIT_NO_CHILDREN         128
#define ERROR_CHILD_NOT_COMPLETE       129
#define ERROR_DIRECT_ACCESS_HANDLE     130
#define ERROR_NEGATIVE_SEEK            131
#define ERROR_SEEK_ON_DEVICE           132
#define ERROR_DIR_NOT_EMPTY            145
#define ERROR_NOT_LOCKED               158
#define ERROR_BAD_PATHNAME             161
#define ERROR_MAX_THRDS_REACHED        164
#define ERROR_LOCK_FAILED              167
#define ERROR_ALREADY_EXISTS           183
#define ERROR_INVALID_STARTING_CODESEG 188
#define ERROR_INVALID_STACKSEG         189
#define ERROR_INVALID_MODULETYPE       190
#define ERROR_INVALID_EXE_SIGNATURE    191
#define ERROR_EXE_MARKED_INVALID       192
#define ERROR_BAD_EXE_FORMAT           193
#define ERROR_ITERATED_DATA_EXCEEDS_64k 194
#define ERROR_INVALID_MINALLOCSIZE     195
#define ERROR_DYNLINK_FROM_INVALID_RING 196
#define ERROR_IOPL_NOT_ENABLED         197
#define ERROR_INVALID_SEGDPL           198
#define ERROR_AUTODATASEG_EXCEEDS_64k  199
#define ERROR_RING2SEG_MUST_BE_MOVABLE 200
#define ERROR_RELOC_CHAIN_XEEDS_SEGLIM 201
#define ERROR_INFLOOP_IN_RELOC_CHAIN   202
#define ERROR_FILENAME_EXCED_RANGE     206
#define ERROR_NESTING_NOT_ALLOWED      215
#define ERROR_PIPE_BUSY                231
#define ERROR_NO_DATA                  232
#define ERROR_MORE_DATA                234
#define ERROR_DIRECTORY                267
#define ERROR_PIPE_CONNECTED           535
#define ERROR_OPERATION_ABORTED        995
#define ERROR_IO_INCOMPLETE            996
#define ERROR_IO_PENDING               997
#define ERROR_INVALID_FLAGS            1004
#define ERROR_NO_UNICODE_TRANSLATION   1113
#define ERROR_NO_SYSTEM_RESOURCES      1450
#define ERROR_NOT_FOUND                1168
#define ERROR_CONNECTION_REFUSED       1225
#define ERROR_PORT_UNREACHABLE         1234
#define ERROR_CONNECTION_ABORTED       1236
#define ERROR_UNRECOGNIZED_VOLUME      1785
#define ERROR_CANT_ACCESS_FILE         1920
#define ERROR_TIMEOUT                  1460
#define ERROR_NOT_ENOUGH_QUOTA         1816

// Winsock error codes (10000+). Consumers translate them to errno or map
// the errno spellings onto them on Windows.
#define WSAEINTR                       10004
#define WSAEBADF                       10009
#define WSAEACCES                      10013
#define WSAEFAULT                      10014
#define WSAEINVAL                      10022
#define WSAEMFILE                      10024
#define WSAEWOULDBLOCK                 10035
#define WSAEINPROGRESS                 10036
#define WSAEALREADY                    10037
#define WSAENOTSOCK                    10038
#define WSAEDESTADDRREQ                10039
#define WSAEMSGSIZE                    10040
#define WSAEPROTOTYPE                  10041
#define WSAENOPROTOOPT                 10042
#define WSAEPROTONOSUPPORT             10043
#define WSAESOCKTNOSUPPORT             10044
#define WSAEOPNOTSUPP                  10045
#define WSAEPFNOSUPPORT                10046
#define WSAEAFNOSUPPORT                10047
#define WSAEADDRINUSE                  10048
#define WSAEADDRNOTAVAIL               10049
#define WSAENETDOWN                    10050
#define WSAENETUNREACH                 10051
#define WSAENETRESET                   10052
#define WSAECONNABORTED                10053
#define WSAECONNRESET                  10054
#define WSAENOBUFS                     10055
#define WSAEISCONN                     10056
#define WSAENOTCONN                    10057
#define WSAESHUTDOWN                   10058
#define WSAETOOMANYREFS                10059
#define WSAETIMEDOUT                   10060
#define WSAECONNREFUSED                10061
#define WSAELOOP                       10062
#define WSAENAMETOOLONG                10063
#define WSAEHOSTDOWN                   10064
#define WSAEHOSTUNREACH                10065
#define WSAENOTEMPTY                   10066
#define WSAEPROCLIM                    10067
#define WSAEUSERS                      10068
#define WSAEDQUOT                      10069
#define WSAESTALE                      10070
#define WSAEREMOTE                     10071
#define WSAEDISCON                     10101
#define WSAENOMORE                     10102
#define WSAECANCELLED                  10103
#define WSASYSNOTREADY                 10091
#define WSAVERNOTSUPPORTED             10092
#define WSANOTINITIALISED              10093
#define WSAHOST_NOT_FOUND              11001
#define WSATRY_AGAIN                   11002
#define WSANO_RECOVERY                 11003
#define WSANO_DATA                     11004
