module std::os::win32 @if(env::WIN32);

extern fn Win32_DWORD getLastError() @extern("GetLastError");

const Win32_DWORD ERROR_INVALID_FUNCTION = 0x1;
const Win32_DWORD ERROR_FILE_NOT_FOUND = 0x2;
const Win32_DWORD ERROR_PATH_NOT_FOUND = 0x3;
const Win32_DWORD ERROR_TOO_MANY_OPEN_FILES = 0x4;
const Win32_DWORD ERROR_ACCESS_DENIED = 0x5;
const Win32_DWORD ERROR_INVALID_HANDLE = 0x6;
const Win32_DWORD ERROR_ARENA_TRASHED = 0x7;
const Win32_DWORD ERROR_NOT_ENOUGH_MEMORY = 0x8;
const Win32_DWORD ERROR_INVALID_BLOCK = 0x9;
const Win32_DWORD ERROR_BAD_ENVIRONMENT = 0xA;
const Win32_DWORD ERROR_BAD_FORMAT = 0xB;
const Win32_DWORD ERROR_INVALID_ACCESS = 0xC;
const Win32_DWORD ERROR_INVALID_DATA = 0xD;
const Win32_DWORD ERROR_OUTOFMEMORY = 0xE;
const Win32_DWORD ERROR_INVALID_DRIVE = 0xF;
const Win32_DWORD ERROR_CURRENT_DIRECTORY = 0x10;
const Win32_DWORD ERROR_NOT_SAME_DEVICE = 0x11;
const Win32_DWORD ERROR_NO_MORE_FILES = 0x12;
const Win32_DWORD ERROR_WRITE_PROTECT = 0x13;
const Win32_DWORD ERROR_BAD_UNIT = 0x14;
const Win32_DWORD ERROR_NOT_READY = 0x15;
const Win32_DWORD ERROR_BAD_COMMAND = 0x16;
const Win32_DWORD ERROR_CRC = 0x17;
const Win32_DWORD ERROR_BAD_LENGTH = 0x18;
const Win32_DWORD ERROR_SEEK = 0x19;
const Win32_DWORD ERROR_NOT_DOS_DISK = 0x1A;
const Win32_DWORD ERROR_SECTOR_NOT_FOUND = 0x1B;
const Win32_DWORD ERROR_OUT_OF_PAPER = 0x1C;
const Win32_DWORD ERROR_WRITE_FAULT = 0x1D;
const Win32_DWORD ERROR_READ_FAULT = 0x1E;
const Win32_DWORD ERROR_GEN_FAILURE = 0x1F;
const Win32_DWORD ERROR_SHARING_VIOLATION = 0x20;
const Win32_DWORD ERROR_LOCK_VIOLATION = 0x21;
const Win32_DWORD ERROR_WRONG_DISK = 0x22;
const Win32_DWORD ERROR_SHARING_BUFFER_EXCEEDED = 0x24;
const Win32_DWORD ERROR_HANDLE_EOF = 0x26;
const Win32_DWORD ERROR_HANDLE_DISK_FULL = 0x27;
const Win32_DWORD ERROR_NOT_SUPPORTED = 0x32;
const Win32_DWORD ERROR_REM_NOT_LIST = 0x33;
const Win32_DWORD ERROR_DUP_NAME = 0x34;
const Win32_DWORD ERROR_BAD_NETPATH = 0x35;
const Win32_DWORD ERROR_NETWORK_BUSY = 0x36;
const Win32_DWORD ERROR_DEV_NOT_EXIST = 0x37;
const Win32_DWORD ERROR_TOO_MANY_CMDS = 0x38;
const Win32_DWORD ERROR_ADAP_HDW_ERR = 0x39;
const Win32_DWORD ERROR_BAD_NET_RESP = 0x3A;
const Win32_DWORD ERROR_UNEXP_NET_ERR = 0x3B;
const Win32_DWORD ERROR_BAD_REM_ADAP = 0x3C;
const Win32_DWORD ERROR_PRINTQ_FULL = 0x3D;
const Win32_DWORD ERROR_NO_SPOOL_SPACE = 0x3E;
const Win32_DWORD ERROR_PRINT_CANCELLED = 0x3F;
const Win32_DWORD ERROR_NETNAME_DELETED = 0x40;
const Win32_DWORD ERROR_NETWORK_ACCESS_DENIED = 0x41;
const Win32_DWORD ERROR_BAD_DEV_TYPE = 0x42;
const Win32_DWORD ERROR_BAD_NET_NAME = 0x43;
const Win32_DWORD ERROR_TOO_MANY_NAMES = 0x44;
const Win32_DWORD ERROR_TOO_MANY_SESS = 0x45;
const Win32_DWORD ERROR_SHARING_PAUSED = 0x46;
const Win32_DWORD ERROR_REQ_NOT_ACCEP = 0x47;
const Win32_DWORD ERROR_REDIR_PAUSED = 0x48;
const Win32_DWORD ERROR_FILE_EXISTS = 0x50;
const Win32_DWORD ERROR_CANNOT_MAKE = 0x52;
const Win32_DWORD ERROR_FAIL_I24 = 0x53;
const Win32_DWORD ERROR_OUT_OF_STRUCTURES = 0x54;
const Win32_DWORD ERROR_ALREADY_ASSIGNED = 0x55;
const Win32_DWORD ERROR_INVALID_PASSWORD = 0x56;
const Win32_DWORD ERROR_INVALID_PARAMETER = 0x57;
const Win32_DWORD ERROR_NET_WRITE_FAULT = 0x58;
const Win32_DWORD ERROR_NO_PROC_SLOTS = 0x59;
const Win32_DWORD ERROR_TOO_MANY_SEMAPHORES = 0x64;
const Win32_DWORD ERROR_EXCL_SEM_ALREADY_OWNED = 0x65;
const Win32_DWORD ERROR_SEM_IS_SET = 0x66;
const Win32_DWORD ERROR_TOO_MANY_SEM_REQUESTS = 0x67;
const Win32_DWORD ERROR_INVALID_AT_INTERRUPT_TIME = 0x68;
const Win32_DWORD ERROR_SEM_OWNER_DIED = 0x69;
const Win32_DWORD ERROR_SEM_USER_LIMIT = 0x6A;
const Win32_DWORD ERROR_DISK_CHANGE = 0x6B;
const Win32_DWORD ERROR_DRIVE_LOCKED = 0x6C;
const Win32_DWORD ERROR_BROKEN_PIPE = 0x6D;
const Win32_DWORD ERROR_OPEN_FAILED = 0x6E;
const Win32_DWORD ERROR_BUFFER_OVERFLOW = 0x6F;
const Win32_DWORD ERROR_DISK_FULL = 0x70;
const Win32_DWORD ERROR_NO_MORE_SEARCH_HANDLES = 0x71;
const Win32_DWORD ERROR_INVALID_TARGET_HANDLE = 0x72;
const Win32_DWORD ERROR_INVALID_CATEGORY = 0x75;
const Win32_DWORD ERROR_INVALID_VERIFY_SWITCH = 0x76;
const Win32_DWORD ERROR_BAD_DRIVER_LEVEL = 0x77;
const Win32_DWORD ERROR_CALL_NOT_IMPLEMENTED = 0x78;
const Win32_DWORD ERROR_SEM_TIMEOUT = 0x79;
const Win32_DWORD ERROR_INSUFFICIENT_BUFFER = 0x7A;
const Win32_DWORD ERROR_INVALID_NAME = 0x7B;
const Win32_DWORD ERROR_INVALID_LEVEL = 0x7C;
const Win32_DWORD ERROR_NO_VOLUME_LABEL = 0x7D;
const Win32_DWORD ERROR_MOD_NOT_FOUND = 0x7E;
const Win32_DWORD ERROR_PROC_NOT_FOUND = 0x7F;
const Win32_DWORD ERROR_WAIT_NO_CHILDREN = 0x80;
const Win32_DWORD ERROR_CHILD_NOT_COMPLETE = 0x81;
const Win32_DWORD ERROR_DIRECT_ACCESS_HANDLE = 0x82;
const Win32_DWORD ERROR_NEGATIVE_SEEK = 0x83;
const Win32_DWORD ERROR_SEEK_ON_DEVICE = 0x84;
const Win32_DWORD ERROR_IS_JOIN_TARGET = 0x85;
const Win32_DWORD ERROR_IS_JOINED = 0x86;
const Win32_DWORD ERROR_IS_SUBSTED = 0x87;
const Win32_DWORD ERROR_NOT_JOINED = 0x88;
const Win32_DWORD ERROR_NOT_SUBSTED = 0x89;
const Win32_DWORD ERROR_JOIN_TO_JOIN = 0x8A;
const Win32_DWORD ERROR_SUBST_TO_SUBST = 0x8B;
const Win32_DWORD ERROR_JOIN_TO_SUBST = 0x8C;
const Win32_DWORD ERROR_SUBST_TO_JOIN = 0x8D;
const Win32_DWORD ERROR_BUSY_DRIVE = 0x8E;
const Win32_DWORD ERROR_SAME_DRIVE = 0x8F;
const Win32_DWORD ERROR_DIR_NOT_ROOT = 0x90;
const Win32_DWORD ERROR_DIR_NOT_EMPTY = 0x91;
const Win32_DWORD ERROR_IS_SUBST_PATH = 0x92;
const Win32_DWORD ERROR_IS_JOIN_PATH = 0x93;
const Win32_DWORD ERROR_PATH_BUSY = 0x94;
const Win32_DWORD ERROR_IS_SUBST_TARGET = 0x95;
const Win32_DWORD ERROR_SYSTEM_TRACE = 0x96;
const Win32_DWORD ERROR_INVALID_EVENT_COUNT = 0x97;
const Win32_DWORD ERROR_TOO_MANY_MUXWAITERS = 0x98;
const Win32_DWORD ERROR_INVALID_LIST_FORMAT = 0x99;
const Win32_DWORD ERROR_LABEL_TOO_LONG = 0x9A;
const Win32_DWORD ERROR_TOO_MANY_TCBS = 0x9B;
const Win32_DWORD ERROR_SIGNAL_REFUSED = 0x9C;
const Win32_DWORD ERROR_DISCARDED = 0x9D;
const Win32_DWORD ERROR_NOT_LOCKED = 0x9E;
const Win32_DWORD ERROR_BAD_THREADID_ADDR = 0x9F;
const Win32_DWORD ERROR_BAD_ARGUMENTS = 0xA0;
const Win32_DWORD ERROR_BAD_PATHNAME = 0xA1;
const Win32_DWORD ERROR_SIGNAL_PENDING = 0xA2;
const Win32_DWORD ERROR_MAX_THRDS_REACHED = 0xA4;
const Win32_DWORD ERROR_LOCK_FAILED = 0xA7;
const Win32_DWORD ERROR_BUSY = 0xAA;
const Win32_DWORD ERROR_DEVICE_SUPPORT_IN_PROGRESS = 0xAB;
const Win32_DWORD ERROR_CANCEL_VIOLATION = 0xAD;
const Win32_DWORD ERROR_ATOMIC_LOCKS_NOT_SUPPORTED = 0xAE;
const Win32_DWORD ERROR_INVALID_SEGMENT_NUMBER = 0xB4;
const Win32_DWORD ERROR_INVALID_ORDINAL = 0xB6;
const Win32_DWORD ERROR_ALREADY_EXISTS = 0xB7;
const Win32_DWORD ERROR_INVALID_FLAG_NUMBER = 0xBA;
const Win32_DWORD ERROR_SEM_NOT_FOUND = 0xBB;
const Win32_DWORD ERROR_INVALID_STARTING_CODESEG = 0xBC;
const Win32_DWORD ERROR_INVALID_STACKSEG = 0xBD;
const Win32_DWORD ERROR_INVALID_MODULETYPE = 0xBE;
const Win32_DWORD ERROR_INVALID_EXE_SIGNATURE = 0xBF;

const Win32_DWORD ERROR_EXE_MARKED_INVALID = 0xC0;
const Win32_DWORD ERROR_BAD_EXE_FORMAT = 0xC1;
const Win32_DWORD ERROR_ITERATED_DATA_EXCEEDS_64K = 0xC2;
const Win32_DWORD ERROR_INVALID_MINALLOCSIZE = 0xC3;
const Win32_DWORD ERROR_DYNLINK_FROM_INVALID_RING = 0xC4;
const Win32_DWORD ERROR_IOPL_NOT_ENABLED = 0xC5;
const Win32_DWORD ERROR_INVALID_SEGDPL = 0xC6;
const Win32_DWORD ERROR_AUTODATASEG_EXCEEDS_64K = 0xC7;
const Win32_DWORD ERROR_RING2SEG_MUST_BE_MOVABLE = 0xC8;
const Win32_DWORD ERROR_RELOC_CHAIN_XEEDS_SEGLIM = 0xC9;
const Win32_DWORD ERROR_INFLOOP_IN_RELOC_CHAIN = 0xCA;
const Win32_DWORD ERROR_ENVVAR_NOT_FOUND = 0xCB;
const Win32_DWORD ERROR_NO_SIGNAL_SENT = 0xCD;
const Win32_DWORD ERROR_FILENAME_EXCED_RANGE = 0xCE;
const Win32_DWORD ERROR_RING2_STACK_IN_USE = 0xCF;
const Win32_DWORD ERROR_META_EXPANSION_TOO_LONG = 0xD0;
const Win32_DWORD ERROR_INVALID_SIGNAL_NUMBER = 0xD1;
const Win32_DWORD ERROR_THREAD_1_INACTIVE = 0xD2;
const Win32_DWORD ERROR_LOCKED = 0xD4;
const Win32_DWORD ERROR_TOO_MANY_MODULES = 0xD6;
const Win32_DWORD ERROR_NESTING_NOT_ALLOWED = 0xD7;
const Win32_DWORD ERROR_EXE_MACHINE_TYPE_MISMATCH = 0xD8;
const Win32_DWORD ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY = 0xD9;
const Win32_DWORD ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY = 0xDA;
const Win32_DWORD ERROR_FILE_CHECKED_OUT = 0xDC;
const Win32_DWORD ERROR_CHECKOUT_REQUIRED = 0xDD;
const Win32_DWORD ERROR_BAD_FILE_TYPE = 0xDE;
const Win32_DWORD ERROR_FILE_TOO_LARGE = 0xDF;
const Win32_DWORD ERROR_FORMS_AUTH_REQUIRED = 0xE0;
const Win32_DWORD ERROR_VIRUS_INFECTED = 0xE1;
const Win32_DWORD ERROR_VIRUS_DELETED = 0xE2;
const Win32_DWORD ERROR_PIPE_LOCAL = 0xE5;
const Win32_DWORD ERROR_BAD_PIPE = 0xE6;
const Win32_DWORD ERROR_PIPE_BUSY = 0xE7;
const Win32_DWORD ERROR_NO_DATA = 0xE8;
const Win32_DWORD ERROR_PIPE_NOT_CONNECTED = 0xE9;
const Win32_DWORD ERROR_MORE_DATA = 0xEA;
const Win32_DWORD ERROR_VC_DISCONNECTED = 0xF0;
const Win32_DWORD ERROR_INVALID_EA_NAME = 0xFE;
const Win32_DWORD ERROR_EA_LIST_INCONSISTENT = 0xFF;
const Win32_DWORD WAIT_TIMEOUT = 0x102;
const Win32_DWORD ERROR_NO_MORE_ITEMS = 0x103;
const Win32_DWORD ERROR_CANNOT_COPY = 0x10A;
const Win32_DWORD ERROR_DIRECTORY = 0x10B;

const Win32_DWORD ERROR_EAS_DIDNT_FIT = 0x113;
const Win32_DWORD ERROR_EA_FILE_CORRUPT = 0x114;
const Win32_DWORD ERROR_EA_TABLE_FULL = 0x115;
const Win32_DWORD ERROR_INVALID_EA_HANDLE = 0x116;
const Win32_DWORD ERROR_EAS_NOT_SUPPORTED = 0x11A;
const Win32_DWORD ERROR_NOT_OWNER = 0x120;
const Win32_DWORD ERROR_TOO_MANY_POSTS = 0x12A;
const Win32_DWORD ERROR_PARTIAL_COPY = 0x12A;
const Win32_DWORD ERROR_OPLOCK_NOT_GRANTED = 0x12C;
const Win32_DWORD ERROR_INVALID_OPLOCK_PROTOCOL = 0x12D;
const Win32_DWORD ERROR_DISK_TOO_FRAGMENTED = 0x12E;
const Win32_DWORD ERROR_DELETE_PENDING = 0x12F;
const Win32_DWORD ERROR_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING = 0x130;
const Win32_DWORD ERROR_SHORT_NAMES_NOT_ENABLED_ON_VOLUME = 0x131;
const Win32_DWORD ERROR_SECURITY_STREAM_IS_INCONSISTENT = 0x132;
const Win32_DWORD ERROR_INVALID_LOCK_RANGE = 0x133;
const Win32_DWORD ERROR_IMAGE_SUBSYSTEM_NOT_PRESENT = 0x134;
const Win32_DWORD ERROR_NOTIFICATION_GUID_ALREADY_DEFINED = 0x135;
const Win32_DWORD ERROR_INVALID_EXCEPTION_HANDLER = 0x136;
const Win32_DWORD ERROR_DUPLICATE_PRIVILEGES = 0x137;
const Win32_DWORD ERROR_NO_RANGES_PROCESSED = 0x138;
const Win32_DWORD ERROR_NOT_ALLOWED_ON_SYSTEM_FILE = 0x139;
const Win32_DWORD ERROR_DISK_RESOURCES_EXHAUSTED = 0x13A;
const Win32_DWORD ERROR_INVALID_TOKEN = 0x13B;
const Win32_DWORD ERROR_DEVICE_FEATURE_NOT_SUPPORTED = 0x13C;
const Win32_DWORD ERROR_MR_MID_NOT_FOUND = 0x13D;
const Win32_DWORD ERROR_SCOPE_NOT_FOUND = 0x13E;
const Win32_DWORD ERROR_UNDEFINED_SCOPE = 0x13F;
const Win32_DWORD ERROR_INVALID_ADDRESS = 0x1E7;
const Win32_DWORD ERROR_IO_INCOMPLETE = 0x3E4;
const Win32_DWORD ERROR_IO_PENDING = 0x3E5;
const Win32_DWORD ERROR_TIMEOUT = 0x5B4;
const Win32_DWORD ERROR_COMMITMENT_LIMIT = 0x5AF;