win 0.1.13 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
data/lib/win/error.rb ADDED
@@ -0,0 +1,1066 @@
1
+ require 'win/library'
2
+
3
+ module Win
4
+
5
+ # Defines functions and constants related to error processing.
6
+ # Includes (some) error codes from error.h, msterr.h and winerror.h (up to 3000);
7
+ # other modules may contain additional error codes specific to their domain.
8
+ #
9
+ module Error
10
+ include Win::Library
11
+
12
+ #Error codes:
13
+
14
+ # :stopdoc:
15
+ S_OK = 0
16
+ NO_ERROR = 0
17
+ ERROR_SUCCESS = 0
18
+ ERROR_INVALID_FUNCTION = 1
19
+ ERROR_FILE_NOT_FOUND = 2
20
+ ERROR_PATH_NOT_FOUND = 3
21
+ ERROR_TOO_MANY_OPEN_FILES = 4
22
+ ERROR_ACCESS_DENIED = 5
23
+ ERROR_INVALID_HANDLE = 6
24
+ ERROR_ARENA_TRASHED = 7
25
+ ERROR_NOT_ENOUGH_MEMORY = 8
26
+ ERROR_INVALID_BLOCK = 9
27
+ ERROR_BAD_ENVIRONMENT = 10
28
+ ERROR_BAD_FORMAT = 11
29
+ ERROR_INVALID_ACCESS = 12
30
+ ERROR_INVALID_DATA = 13
31
+ ERROR_INVALID_DRIVE = 15
32
+ ERROR_CURRENT_DIRECTORY = 16
33
+ ERROR_NOT_SAME_DEVICE = 17
34
+ ERROR_NO_MORE_FILES = 18
35
+ ERROR_WRITE_PROTECT = 19
36
+ ERROR_BAD_UNIT = 20
37
+ ERROR_NOT_READY = 21
38
+ ERROR_BAD_COMMAND = 22
39
+ ERROR_CRC = 23
40
+ ERROR_BAD_LENGTH = 24
41
+ ERROR_SEEK = 25
42
+ ERROR_NOT_DOS_DISK = 26
43
+ ERROR_SECTOR_NOT_FOUND = 27
44
+ ERROR_OUT_OF_PAPER = 28
45
+ ERROR_WRITE_FAULT = 29
46
+ ERROR_READ_FAULT = 30
47
+ ERROR_GEN_FAILURE = 31
48
+ ERROR_SHARING_VIOLATION = 32
49
+ ERROR_LOCK_VIOLATION = 33
50
+ ERROR_WRONG_DISK = 34
51
+ ERROR_FCB_UNAVAILABLE = 35 # gets returned for some unsuccessful DeviceIoControl calls
52
+ ERROR_SHARING_BUFFER_EXCEEDED = 36
53
+ ERROR_HANDLE_EOF = 38
54
+ ERROR_HANDLE_DISK_FULL = 39
55
+
56
+ ERROR_NOT_SUPPORTED = 50
57
+ ERROR_REM_NOT_LIST = 51
58
+ ERROR_DUP_NAME = 52
59
+ ERROR_BAD_NETPATH = 53
60
+ ERROR_NETWORK_BUSY = 54
61
+ ERROR_DEV_NOT_EXIST = 55
62
+ ERROR_TOO_MANY_CMDS = 56
63
+ ERROR_ADAP_HDW_ERR = 57
64
+ ERROR_BAD_NET_RESP = 58
65
+ ERROR_UNEXP_NET_ERR = 59
66
+ ERROR_BAD_REM_ADAP = 60
67
+ ERROR_PRINTQ_FULL = 61
68
+ ERROR_NO_SPOOL_SPACE = 62
69
+ ERROR_PRINT_CANCELLED = 63
70
+ ERROR_NETNAME_DELETED = 64
71
+ ERROR_NETWORK_ACCESS_DENIED = 65
72
+ ERROR_BAD_DEV_TYPE = 66
73
+ ERROR_BAD_NET_NAME = 67
74
+ ERROR_TOO_MANY_NAMES = 68
75
+ ERROR_TOO_MANY_SESS = 69
76
+ ERROR_SHARING_PAUSED = 70
77
+ ERROR_REQ_NOT_ACCEP = 71
78
+ ERROR_REDIR_PAUSED = 72
79
+
80
+ ERROR_FILE_EXISTS = 80
81
+ ERROR_DUP_FCB = 81
82
+ ERROR_CANNOT_MAKE = 82
83
+ ERROR_FAIL_I24 = 83
84
+ ERROR_OUT_OF_STRUCTURES = 84
85
+ ERROR_ALREADY_ASSIGNED = 85
86
+ ERROR_INVALID_PASSWORD = 86
87
+ ERROR_INVALID_PARAMETER = 87
88
+ ERROR_NET_WRITE_FAULT = 88
89
+ ERROR_NO_PROC_SLOTS = 89 # no process slots available
90
+ ERROR_NOT_FROZEN = 90
91
+ ERR_TSTOVFL = 91 # timer service table overflow
92
+ ERR_TSTDUP = 92 # timer service table duplicate
93
+ ERROR_NO_ITEMS = 93 # There were no items to operate upon
94
+ ERROR_INTERRUPT = 95 # interrupted system call
95
+
96
+ ERROR_TOO_MANY_SEMAPHORES = 100
97
+ ERROR_EXCL_SEM_ALREADY_OWNED = 101
98
+ ERROR_SEM_IS_SET = 102
99
+ ERROR_TOO_MANY_SEM_REQUESTS = 103
100
+ ERROR_INVALID_AT_INTERRUPT_TIME = 104
101
+ ERROR_SEM_OWNER_DIED = 105 # waitsem found owner died
102
+ ERROR_SEM_USER_LIMIT = 106 # too many procs have this sem
103
+ ERROR_DISK_CHANGE = 107 # insert disk b into drive a
104
+ ERROR_DRIVE_LOCKED = 108 # drive locked by another process
105
+ ERROR_BROKEN_PIPE = 109 # write on pipe with no reader
106
+ ERROR_OPEN_FAILED = 110 # open/created failed
107
+ ERROR_DISK_FULL = 112 # not enough space
108
+ ERROR_NO_MORE_SEARCH_HANDLES = 113 # can't allocate
109
+ ERROR_INVALID_TARGET_HANDLE = 114 # handle in DOSDUPHANDLE is invalid
110
+ ERROR_PROTECTION_VIOLATION = 115 # bad user virtual address
111
+ ERROR_VIOKBD_REQUEST = 116
112
+ ERROR_INVALID_CATEGORY = 117 # category for DEVIOCTL not defined
113
+ ERROR_INVALID_VERIFY_SWITCH = 118 # invalid value
114
+ ERROR_BAD_DRIVER_LEVEL = 119 # DosDevIOCTL not level four
115
+ ERROR_CALL_NOT_IMPLEMENTED = 120
116
+ ERROR_SEM_TIMEOUT = 121 # timeout from semaphore function
117
+ ERROR_INSUFFICIENT_BUFFER = 122
118
+ ERROR_INVALID_NAME = 123 # illegal char or malformed file system name
119
+ ERROR_INVALID_LEVEL = 124 # unimplemented level for info retrieval
120
+ ERROR_NO_VOLUME_LABEL = 125 # no volume label found
121
+ ERROR_MOD_NOT_FOUND = 126 # w_getprocaddr, w_getmodhandle
122
+ ERROR_PROC_NOT_FOUND = 127 # w_getprocaddr
123
+ ERROR_WAIT_NO_CHILDREN = 128 # CWait finds to children
124
+ ERROR_CHILD_NOT_COMPLETE = 129 # CWait children not dead yet
125
+ ERROR_DIRECT_ACCESS_HANDLE = 130 # invalid for direct disk access
126
+ ERROR_NEGATIVE_SEEK = 131 # tried to seek negative offset
127
+ ERROR_SEEK_ON_DEVICE = 132 # tried to seek on device or pipe
128
+ ERROR_IS_JOIN_TARGET = 133
129
+ ERROR_IS_JOINED = 134
130
+ ERROR_IS_SUBSTED = 135
131
+ ERROR_NOT_JOINED = 136
132
+ ERROR_NOT_SUBSTED = 137
133
+ ERROR_JOIN_TO_JOIN = 138
134
+ ERROR_SUBST_TO_SUBST = 139
135
+ ERROR_JOIN_TO_SUBST = 140
136
+ ERROR_SUBST_TO_JOIN = 141
137
+ ERROR_BUSY_DRIVE = 142
138
+ ERROR_SAME_DRIVE = 143
139
+ ERROR_DIR_NOT_ROOT = 144
140
+ ERROR_DIR_NOT_EMPTY = 145
141
+ ERROR_IS_SUBST_PATH = 146
142
+ ERROR_IS_JOIN_PATH = 147
143
+ ERROR_PATH_BUSY = 148
144
+ ERROR_IS_SUBST_TARGET = 149
145
+ ERROR_SYSTEM_TRACE = 150 # system trace error
146
+ ERROR_INVALID_EVENT_COUNT = 151 # DosMuxSemWait errors
147
+ ERROR_TOO_MANY_MUXWAITERS = 152
148
+ ERROR_INVALID_LIST_FORMAT = 153
149
+ ERROR_LABEL_TOO_LONG = 154
150
+ ERROR_TOO_MANY_TCBS = 155
151
+ ERROR_SIGNAL_REFUSED = 156
152
+ ERROR_DISCARDED = 157
153
+ ERROR_NOT_LOCKED = 158
154
+ ERROR_BAD_THREADID_ADDR = 159
155
+ ERROR_BAD_ARGUMENTS = 160
156
+ ERROR_BAD_PATHNAME = 161
157
+ ERROR_SIGNAL_PENDING = 162
158
+ ERROR_UNCERTAIN_MEDIA = 163
159
+ ERROR_MAX_THRDS_REACHED = 164
160
+ ERROR_MONITORS_NOT_SUPPORTED = 165
161
+
162
+ ERROR_LOCK_FAILED = 167
163
+ ERROR_BUSY = 170
164
+ ERROR_CANCEL_VIOLATION = 173
165
+ ERROR_ATOMIC_LOCKS_NOT_SUPPORTED= 174
166
+
167
+ ERROR_INVALID_SEGMENT_NUMBER = 180
168
+ ERROR_INVALID_CALLGATE = 181
169
+ ERROR_INVALID_ORDINAL = 182
170
+ ERROR_ALREADY_EXISTS = 183
171
+ ERROR_NO_CHILD_PROCESS = 184
172
+ ERROR_CHILD_ALIVE_NOWAIT = 185
173
+ ERROR_INVALID_FLAG_NUMBER = 186
174
+ ERROR_SEM_NOT_FOUND = 187
175
+ ERROR_INVALID_STARTING_CODESEG = 188
176
+ ERROR_INVALID_STACKSEG = 189
177
+ ERROR_INVALID_MODULETYPE = 190
178
+ ERROR_INVALID_EXE_SIGNATURE = 191
179
+ ERROR_EXE_MARKED_INVALID = 192
180
+ ERROR_BAD_EXE_FORMAT = 193
181
+ ERROR_ITERATED_DATA_EXCEEDS_64k = 194
182
+ ERROR_INVALID_MINALLOCSIZE = 195
183
+ ERROR_DYNLINK_FROM_INVALID_RING = 196
184
+ ERROR_IOPL_NOT_ENABLED = 197
185
+ ERROR_INVALID_SEGDPL = 198
186
+ ERROR_AUTODATASEG_EXCEEDS_64k = 199
187
+ ERROR_RING2SEG_MUST_BE_MOVABLE = 200
188
+ ERROR_RELOC_CHAIN_XEEDS_SEGLIM = 201
189
+ ERROR_INFLOOP_IN_RELOC_CHAIN = 202
190
+ ERROR_ENVVAR_NOT_FOUND = 203
191
+ ERROR_NOT_CURRENT_CTRY = 204
192
+ ERROR_NO_SIGNAL_SENT = 205
193
+ ERROR_FILENAME_EXCED_RANGE = 206 # if filename > 8.3
194
+ ERROR_RING2_STACK_IN_USE = 207 # for FAPI
195
+ ERROR_META_EXPANSION_TOO_LONG = 208 # if "*a" > 8.3
196
+ ERROR_INVALID_SIGNAL_NUMBER = 209
197
+ ERROR_THREAD_1_INACTIVE = 210
198
+ ERROR_INFO_NOT_AVAIL = 211 #@@ PTM 5550
199
+ ERROR_LOCKED = 212
200
+ ERROR_BAD_DYNALINK = 213 #@@ PTM 5760
201
+ ERROR_TOO_MANY_MODULES = 214
202
+ ERROR_NESTING_NOT_ALLOWED = 215
203
+ ERROR_EXE_MACHINE_TYPE_MISMATCH = 216
204
+
205
+ ERROR_BAD_PIPE = 230
206
+ ERROR_PIPE_BUSY = 231
207
+ ERROR_NO_DATA = 232
208
+ ERROR_PIPE_NOT_CONNECTED = 233
209
+ ERROR_MORE_DATA = 234
210
+
211
+ ERROR_VC_DISCONNECTED = 240
212
+ ERROR_INVALID_EA_NAME = 254
213
+ ERROR_EA_LIST_INCONSISTENT = 255
214
+ ERROR_NO_MORE_ITEMS = 259
215
+ ERROR_CANNOT_COPY = 266
216
+ ERROR_DIRECTORY = 267
217
+ ERROR_EAS_DIDNT_FIT = 275
218
+ ERROR_EA_FILE_CORRUPT = 276
219
+ ERROR_EA_TABLE_FULL = 277
220
+ ERROR_INVALID_EA_HANDLE = 278
221
+ ERROR_EAS_NOT_SUPPORTED = 282
222
+ ERROR_NOT_OWNER = 288
223
+ ERROR_TOO_MANY_POSTS = 298
224
+ ERROR_PARTIAL_COPY = 299
225
+ ERROR_OPLOCK_NOT_GRANTED = 300
226
+ ERROR_INVALID_OPLOCK_PROTOCOL = 301
227
+ ERROR_DISK_TOO_FRAGMENTED = 302
228
+ ERROR_MR_MID_NOT_FOUND = 317
229
+ ERROR_SCOPE_NOT_FOUND = 318
230
+ ERROR_FAIL_NOACTION_REBOOT = 350
231
+ ERROR_FAIL_SHUTDOWN = 351
232
+ ERROR_FAIL_RESTART = 352
233
+ ERROR_MAX_SESSIONS_REACHED = 353
234
+ ERROR_INVALID_ADDRESS = 487
235
+ ERROR_USER_PROFILE_LOAD = 500
236
+ ERROR_ARITHMETIC_OVERFLOW = 534
237
+ ERROR_PIPE_CONNECTED = 535
238
+ ERROR_PIPE_LISTENING = 536
239
+
240
+ ERROR_EA_ACCESS_DENIED = 994
241
+ ERROR_OPERATION_ABORTED = 995
242
+ ERROR_IO_INCOMPLETE = 996
243
+ ERROR_IO_PENDING = 997
244
+ ERROR_NOACCESS = 998
245
+ ERROR_SWAPERROR = 999
246
+
247
+ ERROR_STACK_OVERFLOW = 1001
248
+ ERROR_INVALID_MESSAGE = 1002
249
+ ERROR_CAN_NOT_COMPLETE = 1003
250
+ ERROR_INVALID_FLAGS = 1004
251
+ ERROR_UNRECOGNIZED_VOLUME = 1005
252
+ ERROR_FILE_INVALID = 1006
253
+ ERROR_FULLSCREEN_MODE = 1007
254
+ ERROR_NO_TOKEN = 1008
255
+ ERROR_BADDB = 1009
256
+ ERROR_BADKEY = 1010
257
+ ERROR_CANTOPEN = 1011
258
+ ERROR_CANTREAD = 1012
259
+ ERROR_CANTWRITE = 1013
260
+ ERROR_REGISTRY_RECOVERED = 1014
261
+ ERROR_REGISTRY_CORRUPT = 1015
262
+ ERROR_REGISTRY_IO_FAILED = 1016
263
+ ERROR_NOT_REGISTRY_FILE = 1017
264
+ ERROR_KEY_DELETED = 1018
265
+ ERROR_NO_LOG_SPACE = 1019
266
+ ERROR_KEY_HAS_CHILDREN = 1020
267
+ ERROR_CHILD_MUST_BE_VOLATILE = 1021
268
+ ERROR_NOTIFY_ENUM_DIR = 1022
269
+ ERROR_DEPENDENT_SERVICES_RUNNING = 1051
270
+ ERROR_INVALID_SERVICE_CONTROL = 1052
271
+ ERROR_SERVICE_REQUEST_TIMEOUT = 1053
272
+ ERROR_SERVICE_NO_THREAD = 1054
273
+ ERROR_SERVICE_DATABASE_LOCKED = 1055
274
+ ERROR_SERVICE_ALREADY_RUNNING = 1056
275
+ ERROR_INVALID_SERVICE_ACCOUNT = 1057
276
+ ERROR_SERVICE_DISABLED = 1058
277
+ ERROR_CIRCULAR_DEPENDENCY = 1059
278
+ ERROR_SERVICE_DOES_NOT_EXIST = 1060
279
+ ERROR_SERVICE_CANNOT_ACCEPT_CTRL = 1061
280
+ ERROR_SERVICE_NOT_ACTIVE = 1062
281
+ ERROR_FAILED_SERVICE_CONTROLLER_CONNECT = 1063
282
+ ERROR_EXCEPTION_IN_SERVICE = 1064
283
+ ERROR_DATABASE_DOES_NOT_EXIST = 1065
284
+ ERROR_SERVICE_SPECIFIC_ERROR = 1066
285
+ ERROR_PROCESS_ABORTED = 1067
286
+ ERROR_SERVICE_DEPENDENCY_FAIL = 1068
287
+ ERROR_SERVICE_LOGON_FAILED = 1069
288
+ ERROR_SERVICE_START_HANG = 1070
289
+ ERROR_INVALID_SERVICE_LOCK = 1071
290
+ ERROR_SERVICE_MARKED_FOR_DELETE = 1072
291
+ ERROR_SERVICE_EXISTS = 1073
292
+ ERROR_ALREADY_RUNNING_LKG = 1074
293
+ ERROR_SERVICE_DEPENDENCY_DELETED = 1075
294
+ ERROR_BOOT_ALREADY_ACCEPTED = 1076
295
+ ERROR_SERVICE_NEVER_STARTED = 1077
296
+ ERROR_DUPLICATE_SERVICE_NAME = 1078
297
+ ERROR_DIFFERENT_SERVICE_ACCOUNT = 1079
298
+ ERROR_CANNOT_DETECT_DRIVER_FAILURE = 1080
299
+ ERROR_CANNOT_DETECT_PROCESS_ABORT = 1081
300
+ ERROR_NO_RECOVERY_PROGRAM = 1082
301
+ ERROR_SERVICE_NOT_IN_EXE = 1083
302
+ ERROR_END_OF_MEDIA = 1100
303
+ ERROR_FILEMARK_DETECTED = 1101
304
+ ERROR_BEGINNING_OF_MEDIA = 1102
305
+ ERROR_SETMARK_DETECTED = 1103
306
+ ERROR_NO_DATA_DETECTED = 1104
307
+ ERROR_PARTITION_FAILURE = 1105
308
+ ERROR_INVALID_BLOCK_LENGTH = 1106
309
+ ERROR_DEVICE_NOT_PARTITIONED = 1107
310
+ ERROR_UNABLE_TO_LOCK_MEDIA = 1108
311
+ ERROR_UNABLE_TO_UNLOAD_MEDIA = 1109
312
+ ERROR_MEDIA_CHANGED = 1110
313
+ ERROR_BUS_RESET = 1111
314
+ ERROR_NO_MEDIA_IN_DRIVE = 1112
315
+ ERROR_NO_UNICODE_TRANSLATION = 1113
316
+ ERROR_DLL_INIT_FAILED = 1114
317
+ ERROR_SHUTDOWN_IN_PROGRESS = 1115
318
+ ERROR_NO_SHUTDOWN_IN_PROGRESS = 1116
319
+ ERROR_IO_DEVICE = 1117
320
+ ERROR_SERIAL_NO_DEVICE = 1118
321
+ ERROR_IRQ_BUSY = 1119
322
+ ERROR_MORE_WRITES = 1120
323
+ ERROR_COUNTER_TIMEOUT = 1121
324
+ ERROR_FLOPPY_ID_MARK_NOT_FOUND = 1122
325
+ ERROR_FLOPPY_WRONG_CYLINDER = 1123
326
+ ERROR_FLOPPY_UNKNOWN_ERROR = 1124
327
+ ERROR_FLOPPY_BAD_REGISTERS = 1125
328
+ ERROR_DISK_RECALIBRATE_FAILED = 1126
329
+ ERROR_DISK_OPERATION_FAILED = 1127
330
+ ERROR_DISK_RESET_FAILED = 1128
331
+ ERROR_EOM_OVERFLOW = 1129
332
+ ERROR_NOT_ENOUGH_SERVER_MEMORY = 1130
333
+ ERROR_POSSIBLE_DEADLOCK = 1131
334
+ ERROR_MAPPED_ALIGNMENT = 1132
335
+ ERROR_SET_POWER_STATE_VETOED = 1140
336
+ ERROR_SET_POWER_STATE_FAILED = 1141
337
+ ERROR_TOO_MANY_LINKS = 1142
338
+ ERROR_OLD_WIN_VERSION = 1150
339
+ ERROR_APP_WRONG_OS = 1151
340
+ ERROR_SINGLE_INSTANCE_APP = 1152
341
+ ERROR_RMODE_APP = 1153
342
+ ERROR_INVALID_DLL = 1154
343
+ ERROR_NO_ASSOCIATION = 1155
344
+ ERROR_DDE_FAIL = 1156
345
+ ERROR_DLL_NOT_FOUND = 1157
346
+ ERROR_NO_MORE_USER_HANDLES = 1158
347
+ ERROR_MESSAGE_SYNC_ONLY = 1159
348
+ ERROR_SOURCE_ELEMENT_EMPTY = 1160
349
+ ERROR_DESTINATION_ELEMENT_FULL = 1161
350
+ ERROR_ILLEGAL_ELEMENT_ADDRESS = 1162
351
+ ERROR_MAGAZINE_NOT_PRESENT = 1163
352
+ ERROR_DEVICE_REINITIALIZATION_NEEDED = 1164
353
+ ERROR_DEVICE_REQUIRES_CLEANING = 1165
354
+ ERROR_DEVICE_DOOR_OPEN = 1166
355
+ ERROR_DEVICE_NOT_CONNECTED = 1167
356
+ ERROR_NOT_FOUND = 1168
357
+ ERROR_NO_MATCH = 1169
358
+ ERROR_SET_NOT_FOUND = 1170
359
+ ERROR_POINT_NOT_FOUND = 1171
360
+ ERROR_NO_TRACKING_SERVICE = 1172
361
+ ERROR_NO_VOLUME_ID = 1173
362
+ ERROR_UNABLE_TO_REMOVE_REPLACED = 1175
363
+ ERROR_UNABLE_TO_MOVE_REPLACEMENT = 1176
364
+ ERROR_UNABLE_TO_MOVE_REPLACEMENT_2 = 1177
365
+ ERROR_JOURNAL_DELETE_IN_PROGRESS = 1178
366
+ ERROR_JOURNAL_NOT_ACTIVE = 1179
367
+ ERROR_POTENTIAL_FILE_FOUND = 1180
368
+ ERROR_JOURNAL_ENTRY_DELETED = 1181
369
+ ERROR_BAD_DEVICE = 1200
370
+ ERROR_CONNECTION_UNAVAIL = 1201
371
+ ERROR_DEVICE_ALREADY_REMEMBERED = 1202
372
+ ERROR_NO_NET_OR_BAD_PATH = 1203
373
+ ERROR_BAD_PROVIDER = 1204
374
+ ERROR_CANNOT_OPEN_PROFILE = 1205
375
+ ERROR_BAD_PROFILE = 1206
376
+ ERROR_NOT_CONTAINER = 1207
377
+ ERROR_EXTENDED_ERROR = 1208
378
+ ERROR_INVALID_GROUPNAME = 1209
379
+ ERROR_INVALID_COMPUTERNAME = 1210
380
+ ERROR_INVALID_EVENTNAME = 1211
381
+ ERROR_INVALID_DOMAINNAME = 1212
382
+ ERROR_INVALID_SERVICENAME = 1213
383
+ ERROR_INVALID_NETNAME = 1214
384
+ ERROR_INVALID_SHARENAME = 1215
385
+ ERROR_INVALID_PASSWORDNAME = 1216
386
+ ERROR_INVALID_MESSAGENAME = 1217
387
+ ERROR_INVALID_MESSAGEDEST = 1218
388
+ ERROR_SESSION_CREDENTIAL_CONFLICT = 1219
389
+ ERROR_REMOTE_SESSION_LIMIT_EXCEEDED = 1220
390
+ ERROR_DUP_DOMAINNAME = 1221
391
+ ERROR_NO_NETWORK = 1222
392
+ ERROR_CANCELLED = 1223
393
+ ERROR_USER_MAPPED_FILE = 1224
394
+ ERROR_CONNECTION_REFUSED = 1225
395
+ ERROR_GRACEFUL_DISCONNECT = 1226
396
+ ERROR_ADDRESS_ALREADY_ASSOCIATED = 1227
397
+ ERROR_ADDRESS_NOT_ASSOCIATED = 1228
398
+ ERROR_CONNECTION_INVALID = 1229
399
+ ERROR_CONNECTION_ACTIVE = 1230
400
+ ERROR_NETWORK_UNREACHABLE = 1231
401
+ ERROR_HOST_UNREACHABLE = 1232
402
+ ERROR_PROTOCOL_UNREACHABLE = 1233
403
+ ERROR_PORT_UNREACHABLE = 1234
404
+ ERROR_REQUEST_ABORTED = 1235
405
+ ERROR_CONNECTION_ABORTED = 1236
406
+ ERROR_RETRY = 1237
407
+ ERROR_CONNECTION_COUNT_LIMIT = 1238
408
+ ERROR_LOGIN_TIME_RESTRICTION = 1239
409
+ ERROR_LOGIN_WKSTA_RESTRICTION = 1240
410
+ ERROR_INCORRECT_ADDRESS = 1241
411
+ ERROR_ALREADY_REGISTERED = 1242
412
+ ERROR_SERVICE_NOT_FOUND = 1243
413
+ ERROR_NOT_AUTHENTICATED = 1244
414
+ ERROR_NOT_LOGGED_ON = 1245
415
+ ERROR_CONTINUE = 1246
416
+ ERROR_ALREADY_INITIALIZED = 1247
417
+ ERROR_NO_MORE_DEVICES = 1248
418
+ ERROR_NO_SUCH_SITE = 1249
419
+ ERROR_DOMAIN_CONTROLLER_EXISTS = 1250
420
+ ERROR_ONLY_IF_CONNECTED = 1251
421
+ ERROR_OVERRIDE_NOCHANGES = 1252
422
+ ERROR_BAD_USER_PROFILE = 1253
423
+ ERROR_NOT_SUPPORTED_ON_SBS = 1254
424
+ ERROR_SERVER_SHUTDOWN_IN_PROGRESS = 1255
425
+ ERROR_HOST_DOWN = 1256
426
+ ERROR_ACCESS_DISABLED_BY_POLICY = 1260
427
+ ERROR_REG_NAT_CONSUMPTION = 1261
428
+ ERROR_PKINIT_FAILURE = 1263
429
+ ERROR_SMARTCARD_SUBSYSTEM_FAILURE = 1264
430
+ ERROR_DOWNGRADE_DETECTED = 1265
431
+ ERROR_MACHINE_LOCKED = 1271
432
+ ERROR_CALLBACK_SUPPLIED_INVALID_DATA = 1273
433
+ ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED= 1274
434
+ ERROR_DRIVER_BLOCKED = 1275
435
+ ERROR_INVALID_IMPORT_OF_NON_DLL = 1276
436
+ ERROR_NOT_ALL_ASSIGNED = 1300
437
+ ERROR_SOME_NOT_MAPPED = 1301
438
+ ERROR_NO_QUOTAS_FOR_ACCOUNT = 1302
439
+ ERROR_LOCAL_USER_SESSION_KEY = 1303
440
+ ERROR_NULL_LM_PASSWORD = 1304
441
+ ERROR_UNKNOWN_REVISION = 1305
442
+ ERROR_REVISION_MISMATCH = 1306
443
+ ERROR_INVALID_OWNER = 1307
444
+ ERROR_INVALID_PRIMARY_GROUP = 1308
445
+ ERROR_NO_IMPERSONATION_TOKEN = 1309
446
+ ERROR_CANT_DISABLE_MANDATORY = 1310
447
+ ERROR_NO_LOGON_SERVERS = 1311
448
+ ERROR_NO_SUCH_LOGON_SESSION = 1312
449
+ ERROR_NO_SUCH_PRIVILEGE = 1313
450
+ ERROR_PRIVILEGE_NOT_HELD = 1314
451
+ ERROR_INVALID_ACCOUNT_NAME = 1315
452
+ ERROR_USER_EXISTS = 1316
453
+ ERROR_NO_SUCH_USER = 1317
454
+ ERROR_GROUP_EXISTS = 1318
455
+ ERROR_NO_SUCH_GROUP = 1319
456
+ ERROR_MEMBER_IN_GROUP = 1320
457
+ ERROR_MEMBER_NOT_IN_GROUP = 1321
458
+ ERROR_LAST_ADMIN = 1322
459
+ ERROR_WRONG_PASSWORD = 1323
460
+ ERROR_ILL_FORMED_PASSWORD = 1324
461
+ ERROR_PASSWORD_RESTRICTION = 1325
462
+ ERROR_LOGON_FAILURE = 1326
463
+ ERROR_ACCOUNT_RESTRICTION = 1327
464
+ ERROR_INVALID_LOGON_HOURS = 1328
465
+ ERROR_INVALID_WORKSTATION = 1329
466
+ ERROR_PASSWORD_EXPIRED = 1330
467
+ ERROR_ACCOUNT_DISABLED = 1331
468
+ ERROR_NONE_MAPPED = 1332
469
+ ERROR_TOO_MANY_LUIDS_REQUESTED = 1333
470
+ ERROR_LUIDS_EXHAUSTED = 1334
471
+ ERROR_INVALID_SUB_AUTHORITY = 1335
472
+ ERROR_INVALID_ACL = 1336
473
+ ERROR_INVALID_SID = 1337
474
+ ERROR_INVALID_SECURITY_DESCR = 1338
475
+ ERROR_BAD_INHERITANCE_ACL = 1340
476
+ ERROR_SERVER_DISABLED = 1341
477
+ ERROR_SERVER_NOT_DISABLED = 1342
478
+ ERROR_INVALID_ID_AUTHORITY = 1343
479
+ ERROR_ALLOTTED_SPACE_EXCEEDED = 1344
480
+ ERROR_INVALID_GROUP_ATTRIBUTES = 1345
481
+ ERROR_BAD_IMPERSONATION_LEVEL = 1346
482
+ ERROR_CANT_OPEN_ANONYMOUS = 1347
483
+ ERROR_BAD_VALIDATION_CLASS = 1348
484
+ ERROR_BAD_TOKEN_TYPE = 1349
485
+ ERROR_NO_SECURITY_ON_OBJECT = 1350
486
+ ERROR_CANT_ACCESS_DOMAIN_INFO = 1351
487
+ ERROR_INVALID_SERVER_STATE = 1352
488
+ ERROR_INVALID_DOMAIN_STATE = 1353
489
+ ERROR_INVALID_DOMAIN_ROLE = 1354
490
+ ERROR_NO_SUCH_DOMAIN = 1355
491
+ ERROR_DOMAIN_EXISTS = 1356
492
+ ERROR_DOMAIN_LIMIT_EXCEEDED = 1357
493
+ ERROR_INTERNAL_DB_CORRUPTION = 1358
494
+ ERROR_INTERNAL_ERROR = 1359
495
+ ERROR_GENERIC_NOT_MAPPED = 1360
496
+ ERROR_BAD_DESCRIPTOR_FORMAT = 1361
497
+ ERROR_NOT_LOGON_PROCESS = 1362
498
+ ERROR_LOGON_SESSION_EXISTS = 1363
499
+ ERROR_NO_SUCH_PACKAGE = 1364
500
+ ERROR_BAD_LOGON_SESSION_STATE = 1365
501
+ ERROR_LOGON_SESSION_COLLISION = 1366
502
+ ERROR_INVALID_LOGON_TYPE = 1367
503
+ ERROR_CANNOT_IMPERSONATE = 1368
504
+ ERROR_RXACT_INVALID_STATE = 1369
505
+ ERROR_RXACT_COMMIT_FAILURE = 1370
506
+ ERROR_SPECIAL_ACCOUNT = 1371
507
+ ERROR_SPECIAL_GROUP = 1372
508
+ ERROR_SPECIAL_USER = 1373
509
+ ERROR_MEMBERS_PRIMARY_GROUP = 1374
510
+ ERROR_TOKEN_ALREADY_IN_USE = 1375
511
+ ERROR_NO_SUCH_ALIAS = 1376
512
+ ERROR_MEMBER_NOT_IN_ALIAS = 1377
513
+ ERROR_MEMBER_IN_ALIAS = 1378
514
+ ERROR_ALIAS_EXISTS = 1379
515
+ ERROR_LOGON_NOT_GRANTED = 1380
516
+ ERROR_TOO_MANY_SECRETS = 1381
517
+ ERROR_SECRET_TOO_LONG = 1382
518
+ ERROR_INTERNAL_DB_ERROR = 1383
519
+ ERROR_TOO_MANY_CONTEXT_IDS = 1384
520
+ ERROR_LOGON_TYPE_NOT_GRANTED = 1385
521
+ ERROR_NT_CROSS_ENCRYPTION_REQUIRED = 1386
522
+ ERROR_NO_SUCH_MEMBER = 1387
523
+ ERROR_INVALID_MEMBER = 1388
524
+ ERROR_TOO_MANY_SIDS = 1389
525
+ ERROR_LM_CROSS_ENCRYPTION_REQUIRED = 1390
526
+ ERROR_NO_INHERITANCE = 1391
527
+ ERROR_FILE_CORRUPT = 1392
528
+ ERROR_DISK_CORRUPT = 1393
529
+ ERROR_NO_USER_SESSION_KEY = 1394
530
+ ERROR_LICENSE_QUOTA_EXCEEDED = 1395
531
+ ERROR_WRONG_TARGET_NAME = 1396
532
+ ERROR_MUTUAL_AUTH_FAILED = 1397
533
+ ERROR_TIME_SKEW = 1398
534
+ ERROR_CURRENT_DOMAIN_NOT_ALLOWED = 1399
535
+ ERROR_INVALID_WINDOW_HANDLE = 1400
536
+ ERROR_INVALID_MENU_HANDLE = 1401
537
+ ERROR_INVALID_CURSOR_HANDLE = 1402
538
+ ERROR_INVALID_ACCEL_HANDLE = 1403
539
+ ERROR_INVALID_HOOK_HANDLE = 1404
540
+ ERROR_INVALID_DWP_HANDLE = 1405
541
+ ERROR_TLW_WITH_WSCHILD = 1406
542
+ ERROR_CANNOT_FIND_WND_CLASS = 1407
543
+ ERROR_WINDOW_OF_OTHER_THREAD = 1408
544
+ ERROR_HOTKEY_ALREADY_REGISTERED = 1409
545
+ ERROR_CLASS_ALREADY_EXISTS = 1410
546
+ ERROR_CLASS_DOES_NOT_EXIST = 1411
547
+ ERROR_CLASS_HAS_WINDOWS = 1412
548
+ ERROR_INVALID_INDEX = 1413
549
+ ERROR_INVALID_ICON_HANDLE = 1414
550
+ ERROR_PRIVATE_DIALOG_INDEX = 1415
551
+ ERROR_LISTBOX_ID_NOT_FOUND = 1416
552
+ ERROR_NO_WILDCARD_CHARACTERS = 1417
553
+ ERROR_CLIPBOARD_NOT_OPEN = 1418
554
+ ERROR_HOTKEY_NOT_REGISTERED = 1419
555
+ ERROR_WINDOW_NOT_DIALOG = 1420
556
+ ERROR_CONTROL_ID_NOT_FOUND = 1421
557
+ ERROR_INVALID_COMBOBOX_MESSAGE = 1422
558
+ ERROR_WINDOW_NOT_COMBOBOX = 1423
559
+ ERROR_INVALID_EDIT_HEIGHT = 1424
560
+ ERROR_DC_NOT_FOUND = 1425
561
+ ERROR_INVALID_HOOK_FILTER = 1426
562
+ ERROR_INVALID_FILTER_PROC = 1427
563
+ ERROR_HOOK_NEEDS_HMOD = 1428
564
+ ERROR_GLOBAL_ONLY_HOOK = 1429
565
+ ERROR_JOURNAL_HOOK_SET = 1430
566
+ ERROR_HOOK_NOT_INSTALLED = 1431
567
+ ERROR_INVALID_LB_MESSAGE = 1432
568
+ ERROR_SETCOUNT_ON_BAD_LB = 1433
569
+ ERROR_LB_WITHOUT_TABSTOPS = 1434
570
+ ERROR_DESTROY_OBJECT_OF_OTHER_THREAD = 1435
571
+ ERROR_CHILD_WINDOW_MENU = 1436
572
+ ERROR_NO_SYSTEM_MENU = 1437
573
+ ERROR_INVALID_MSGBOX_STYLE = 1438
574
+ ERROR_INVALID_SPI_VALUE = 1439
575
+ ERROR_SCREEN_ALREADY_LOCKED = 1440
576
+ ERROR_HWNDS_HAVE_DIFF_PARENT = 1441
577
+ ERROR_NOT_CHILD_WINDOW = 1442
578
+ ERROR_INVALID_GW_COMMAND = 1443
579
+ ERROR_INVALID_THREAD_ID = 1444
580
+ ERROR_NON_MDICHILD_WINDOW = 1445
581
+ ERROR_POPUP_ALREADY_ACTIVE = 1446
582
+ ERROR_NO_SCROLLBARS = 1447
583
+ ERROR_INVALID_SCROLLBAR_RANGE = 1448
584
+ ERROR_INVALID_SHOWWIN_COMMAND = 1449
585
+ ERROR_NO_SYSTEM_RESOURCES = 1450
586
+ ERROR_NONPAGED_SYSTEM_RESOURCES = 1451
587
+ ERROR_PAGED_SYSTEM_RESOURCES = 1452
588
+ ERROR_WORKING_SET_QUOTA = 1453
589
+ ERROR_PAGEFILE_QUOTA = 1454
590
+ ERROR_COMMITMENT_LIMIT = 1455
591
+ ERROR_MENU_ITEM_NOT_FOUND = 1456
592
+ ERROR_INVALID_KEYBOARD_HANDLE = 1457
593
+ ERROR_HOOK_TYPE_NOT_ALLOWED = 1458
594
+ ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION = 1459
595
+ ERROR_TIMEOUT = 1460
596
+ ERROR_INVALID_MONITOR_HANDLE = 1461
597
+ ERROR_EVENTLOG_FILE_CORRUPT = 1500
598
+ ERROR_EVENTLOG_CANT_START = 1501
599
+ ERROR_LOG_FILE_FULL = 1502
600
+ ERROR_EVENTLOG_FILE_CHANGED = 1503
601
+ ERROR_INVALID_TASK_NAME = 1550
602
+ ERROR_INVALID_TASK_INDEX = 1551
603
+ ERROR_THREAD_ALREADY_IN_TASK = 1552
604
+ ERROR_INSTALL_SERVICE_FAILURE = 1601
605
+ ERROR_INSTALL_USEREXIT = 1602
606
+ ERROR_INSTALL_FAILURE = 1603
607
+ ERROR_INSTALL_SUSPEND = 1604
608
+ ERROR_UNKNOWN_PRODUCT = 1605
609
+ ERROR_UNKNOWN_FEATURE = 1606
610
+ ERROR_UNKNOWN_COMPONENT = 1607
611
+ ERROR_UNKNOWN_PROPERTY = 1608
612
+ ERROR_INVALID_HANDLE_STATE = 1609
613
+ ERROR_BAD_CONFIGURATION = 1610
614
+ ERROR_INDEX_ABSENT = 1611
615
+ ERROR_INSTALL_SOURCE_ABSENT = 1612
616
+ ERROR_INSTALL_PACKAGE_VERSION = 1613
617
+ ERROR_PRODUCT_UNINSTALLED = 1614
618
+ ERROR_BAD_QUERY_SYNTAX = 1615
619
+ ERROR_INVALID_FIELD = 1616
620
+ ERROR_DEVICE_REMOVED = 1617
621
+ ERROR_INSTALL_ALREADY_RUNNING = 1618
622
+ ERROR_INSTALL_PACKAGE_OPEN_FAILED = 1619
623
+ ERROR_INSTALL_PACKAGE_INVALID = 1620
624
+ ERROR_INSTALL_UI_FAILURE = 1621
625
+ ERROR_INSTALL_LOG_FAILURE = 1622
626
+ ERROR_INSTALL_LANGUAGE_UNSUPPORTED = 1623
627
+ ERROR_INSTALL_TRANSFORM_FAILURE = 1624
628
+ ERROR_INSTALL_PACKAGE_REJECTED = 1625
629
+ ERROR_FUNCTION_NOT_CALLED = 1626
630
+ ERROR_FUNCTION_FAILED = 1627
631
+ ERROR_INVALID_TABLE = 1628
632
+ ERROR_DATATYPE_MISMATCH = 1629
633
+ ERROR_UNSUPPORTED_TYPE = 1630
634
+ ERROR_CREATE_FAILED = 1631
635
+ ERROR_INSTALL_TEMP_UNWRITABLE = 1632
636
+ ERROR_INSTALL_PLATFORM_UNSUPPORTED = 1633
637
+ ERROR_INSTALL_NOTUSED = 1634
638
+ ERROR_PATCH_PACKAGE_OPEN_FAILED = 1635
639
+ ERROR_PATCH_PACKAGE_INVALID = 1636
640
+ ERROR_PATCH_PACKAGE_UNSUPPORTED = 1637
641
+ ERROR_PRODUCT_VERSION = 1638
642
+ ERROR_INVALID_COMMAND_LINE = 1639
643
+ ERROR_INSTALL_REMOTE_DISALLOWED = 1640
644
+ ERROR_SUCCESS_REBOOT_INITIATED = 1641
645
+ ERROR_UNKNOWN_PATCH = 1647
646
+ RPC_S_INVALID_STRING_BINDING = 1700
647
+ RPC_S_WRONG_KIND_OF_BINDING = 1701
648
+ RPC_S_INVALID_BINDING = 1702
649
+ RPC_S_PROTSEQ_NOT_SUPPORTED = 1703
650
+ RPC_S_INVALID_RPC_PROTSEQ = 1704
651
+ RPC_S_INVALID_STRING_UUID = 1705
652
+ RPC_S_INVALID_ENDPOINT_FORMAT = 1706
653
+ RPC_S_INVALID_NET_ADDR = 1707
654
+ RPC_S_NO_ENDPOINT_FOUND = 1708
655
+ RPC_S_INVALID_TIMEOUT = 1709
656
+ RPC_S_OBJECT_NOT_FOUND = 1710
657
+ RPC_S_ALREADY_REGISTERED = 1711
658
+ RPC_S_TYPE_ALREADY_REGISTERED = 1712
659
+ RPC_S_ALREADY_LISTENING = 1713
660
+ RPC_S_NO_PROTSEQS_REGISTERED = 1714
661
+ RPC_S_NOT_LISTENING = 1715
662
+ RPC_S_UNKNOWN_MGR_TYPE = 1716
663
+ RPC_S_UNKNOWN_IF = 1717
664
+ RPC_S_NO_BINDINGS = 1718
665
+ RPC_S_NO_PROTSEQS = 1719
666
+ RPC_S_CANT_CREATE_ENDPOINT = 1720
667
+ RPC_S_OUT_OF_RESOURCES = 1721
668
+ RPC_S_SERVER_UNAVAILABLE = 1722
669
+ RPC_S_SERVER_TOO_BUSY = 1723
670
+ RPC_S_INVALID_NETWORK_OPTIONS = 1724
671
+ RPC_S_NO_CALL_ACTIVE = 1725
672
+ RPC_S_CALL_FAILED = 1726
673
+ RPC_S_CALL_FAILED_DNE = 1727
674
+ RPC_S_PROTOCOL_ERROR = 1728
675
+ RPC_S_UNSUPPORTED_TRANS_SYN = 1730
676
+ RPC_S_UNSUPPORTED_TYPE = 1732
677
+ RPC_S_INVALID_TAG = 1733
678
+ RPC_S_INVALID_BOUND = 1734
679
+ RPC_S_NO_ENTRY_NAME = 1735
680
+ RPC_S_INVALID_NAME_SYNTAX = 1736
681
+ RPC_S_UNSUPPORTED_NAME_SYNTAX = 1737
682
+ RPC_S_UUID_NO_ADDRESS = 1739
683
+ RPC_S_DUPLICATE_ENDPOINT = 1740
684
+ RPC_S_UNKNOWN_AUTHN_TYPE = 1741
685
+ RPC_S_MAX_CALLS_TOO_SMALL = 1742
686
+ RPC_S_STRING_TOO_LONG = 1743
687
+ RPC_S_PROTSEQ_NOT_FOUND = 1744
688
+ RPC_S_PROCNUM_OUT_OF_RANGE = 1745
689
+ RPC_S_BINDING_HAS_NO_AUTH = 1746
690
+ RPC_S_UNKNOWN_AUTHN_SERVICE = 1747
691
+ RPC_S_UNKNOWN_AUTHN_LEVEL = 1748
692
+ RPC_S_INVALID_AUTH_IDENTITY = 1749
693
+ RPC_S_UNKNOWN_AUTHZ_SERVICE = 1750
694
+ EPT_S_INVALID_ENTRY = 1751
695
+ EPT_S_CANT_PERFORM_OP = 1752
696
+ EPT_S_NOT_REGISTERED = 1753
697
+ RPC_S_NOTHING_TO_EXPORT = 1754
698
+ RPC_S_INCOMPLETE_NAME = 1755
699
+ RPC_S_INVALID_VERS_OPTION = 1756
700
+ RPC_S_NO_MORE_MEMBERS = 1757
701
+ RPC_S_NOT_ALL_OBJS_UNEXPORTED = 1758
702
+ RPC_S_INTERFACE_NOT_FOUND = 1759
703
+ RPC_S_ENTRY_ALREADY_EXISTS = 1760
704
+ RPC_S_ENTRY_NOT_FOUND = 1761
705
+ RPC_S_NAME_SERVICE_UNAVAILABLE = 1762
706
+ RPC_S_INVALID_NAF_ID = 1763
707
+ RPC_S_CANNOT_SUPPORT = 1764
708
+ RPC_S_NO_CONTEXT_AVAILABLE = 1765
709
+ RPC_S_INTERNAL_ERROR = 1766
710
+ RPC_S_ZERO_DIVIDE = 1767
711
+ RPC_S_ADDRESS_ERROR = 1768
712
+ RPC_S_FP_DIV_ZERO = 1769
713
+ RPC_S_FP_UNDERFLOW = 1770
714
+ RPC_S_FP_OVERFLOW = 1771
715
+ RPC_X_NO_MORE_ENTRIES = 1772
716
+ RPC_X_SS_CHAR_TRANS_OPEN_FAIL = 1773
717
+ RPC_X_SS_CHAR_TRANS_SHORT_FILE = 1774
718
+ RPC_X_SS_IN_NULL_CONTEXT = 1775
719
+ RPC_X_SS_CONTEXT_DAMAGED = 1777
720
+ RPC_X_SS_HANDLES_MISMATCH = 1778
721
+ RPC_X_SS_CANNOT_GET_CALL_HANDLE = 1779
722
+ RPC_X_NULL_REF_POINTER = 1780
723
+ RPC_X_ENUM_VALUE_OUT_OF_RANGE = 1781
724
+ RPC_X_BYTE_COUNT_TOO_SMALL = 1782
725
+ RPC_X_BAD_STUB_DATA = 1783
726
+ ERROR_INVALID_USER_BUFFER = 1784
727
+ ERROR_UNRECOGNIZED_MEDIA = 1785
728
+ ERROR_NO_TRUST_LSA_SECRET = 1786
729
+ ERROR_NO_TRUST_SAM_ACCOUNT = 1787
730
+ ERROR_TRUSTED_DOMAIN_FAILURE = 1788
731
+ ERROR_TRUSTED_RELATIONSHIP_FAILURE = 1789
732
+ ERROR_TRUST_FAILURE = 1790
733
+ RPC_S_CALL_IN_PROGRESS = 1791
734
+ ERROR_NETLOGON_NOT_STARTED = 1792
735
+ ERROR_ACCOUNT_EXPIRED = 1793
736
+ ERROR_REDIRECTOR_HAS_OPEN_HANDLES = 1794
737
+ ERROR_PRINTER_DRIVER_ALREADY_INSTALLED= 1795
738
+ ERROR_UNKNOWN_PORT = 1796
739
+ ERROR_UNKNOWN_PRINTER_DRIVER = 1797
740
+ ERROR_UNKNOWN_PRINTPROCESSOR = 1798
741
+ ERROR_INVALID_SEPARATOR_FILE = 1799
742
+ ERROR_INVALID_PRIORITY = 1800
743
+ ERROR_INVALID_PRINTER_NAME = 1801
744
+ ERROR_PRINTER_ALREADY_EXISTS = 1802
745
+ ERROR_INVALID_PRINTER_COMMAND = 1803
746
+ ERROR_INVALID_DATATYPE = 1804
747
+ ERROR_INVALID_ENVIRONMENT = 1805
748
+ RPC_S_NO_MORE_BINDINGS = 1806
749
+ ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT = 1807
750
+ ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT = 1808
751
+ ERROR_NOLOGON_SERVER_TRUST_ACCOUNT = 1809
752
+ ERROR_DOMAIN_TRUST_INCONSISTENT = 1810
753
+ ERROR_SERVER_HAS_OPEN_HANDLES = 1811
754
+ ERROR_RESOURCE_DATA_NOT_FOUND = 1812
755
+ ERROR_RESOURCE_TYPE_NOT_FOUND = 1813
756
+ ERROR_RESOURCE_NAME_NOT_FOUND = 1814
757
+ ERROR_RESOURCE_LANG_NOT_FOUND = 1815
758
+ ERROR_NOT_ENOUGH_QUOTA = 1816
759
+ RPC_S_NO_INTERFACES = 1817
760
+ RPC_S_CALL_CANCELLED = 1818
761
+ RPC_S_BINDING_INCOMPLETE = 1819
762
+ RPC_S_COMM_FAILURE = 1820
763
+ RPC_S_UNSUPPORTED_AUTHN_LEVEL = 1821
764
+ RPC_S_NO_PRINC_NAME = 1822
765
+ RPC_S_NOT_RPC_ERROR = 1823
766
+ RPC_S_UUID_LOCAL_ONLY = 1824
767
+ RPC_S_SEC_PKG_ERROR = 1825
768
+ RPC_S_NOT_CANCELLED = 1826
769
+ RPC_X_INVALID_ES_ACTION = 1827
770
+ RPC_X_WRONG_ES_VERSION = 1828
771
+ RPC_X_WRONG_STUB_VERSION = 1829
772
+ RPC_X_INVALID_PIPE_OBJECT = 1830
773
+ RPC_X_WRONG_PIPE_ORDER = 1831
774
+ RPC_X_WRONG_PIPE_VERSION = 1832
775
+ RPC_S_GROUP_MEMBER_NOT_FOUND = 1898
776
+ EPT_S_CANT_CREATE = 1899
777
+ RPC_S_INVALID_OBJECT = 1900
778
+ ERROR_INVALID_TIME = 1901
779
+ ERROR_INVALID_FORM_NAME = 1902
780
+ ERROR_INVALID_FORM_SIZE = 1903
781
+ ERROR_ALREADY_WAITING = 1904
782
+ ERROR_PRINTER_DELETED = 1905
783
+ ERROR_INVALID_PRINTER_STATE = 1906
784
+ ERROR_PASSWORD_MUST_CHANGE = 1907
785
+ ERROR_DOMAIN_CONTROLLER_NOT_FOUND = 1908
786
+ ERROR_ACCOUNT_LOCKED_OUT = 1909
787
+ OR_INVALID_OXID = 1910
788
+ OR_INVALID_OID = 1911
789
+ OR_INVALID_SET = 1912
790
+ RPC_S_SEND_INCOMPLETE = 1913
791
+ RPC_S_INVALID_ASYNC_HANDLE = 1914
792
+ RPC_S_INVALID_ASYNC_CALL = 1915
793
+ RPC_X_PIPE_CLOSED = 1916
794
+ RPC_X_PIPE_DISCIPLINE_ERROR = 1917
795
+ RPC_X_PIPE_EMPTY = 1918
796
+ ERROR_NO_SITENAME = 1919
797
+ ERROR_CANT_ACCESS_FILE = 1920
798
+ ERROR_CANT_RESOLVE_FILENAME = 1921
799
+ RPC_S_ENTRY_TYPE_MISMATCH = 1922
800
+ RPC_S_NOT_ALL_OBJS_EXPORTED = 1923
801
+ RPC_S_INTERFACE_NOT_EXPORTED = 1924
802
+ RPC_S_PROFILE_NOT_ADDED = 1925
803
+ RPC_S_PRF_ELT_NOT_ADDED = 1926
804
+ RPC_S_PRF_ELT_NOT_REMOVED = 1927
805
+ RPC_S_GRP_ELT_NOT_ADDED = 1928
806
+ RPC_S_GRP_ELT_NOT_REMOVED = 1929
807
+ ERROR_KM_DRIVER_BLOCKED = 1930
808
+ ERROR_CONTEXT_EXPIRED = 1931
809
+ ERROR_PER_USER_TRUST_QUOTA_EXCEEDED = 1932
810
+ ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED = 1933
811
+ ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED= 1934
812
+ ERROR_AUTHENTICATION_FIREWALL_FAILED = 1935
813
+ ERROR_REMOTE_PRINT_CONNECTIONS_BLOCKED= 1936
814
+ ERROR_INVALID_PIXEL_FORMAT = 2000
815
+ ERROR_BAD_DRIVER = 2001
816
+ ERROR_INVALID_WINDOW_STYLE = 2002
817
+ ERROR_METAFILE_NOT_SUPPORTED = 2003
818
+ ERROR_TRANSFORM_NOT_SUPPORTED = 2004
819
+ ERROR_CLIPPING_NOT_SUPPORTED = 2005
820
+ ERROR_INVALID_CMM = 2010
821
+ ERROR_INVALID_PROFILE = 2011
822
+ ERROR_TAG_NOT_FOUND = 2012
823
+ ERROR_TAG_NOT_PRESENT = 2013
824
+ ERROR_DUPLICATE_TAG = 2014
825
+ ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE = 2015
826
+ ERROR_PROFILE_NOT_FOUND = 2016
827
+ ERROR_INVALID_COLORSPACE = 2017
828
+ ERROR_ICM_NOT_ENABLED = 2018
829
+ ERROR_DELETING_ICM_XFORM = 2019
830
+ ERROR_INVALID_TRANSFORM = 2020
831
+ ERROR_COLORSPACE_MISMATCH = 2021
832
+ ERROR_INVALID_COLORINDEX = 2022
833
+ ERROR_CONNECTED_OTHER_PASSWORD = 2108
834
+ ERROR_BAD_USERNAME = 2202
835
+ ERROR_NOT_CONNECTED = 2250
836
+ ERROR_OPEN_FILES = 2401
837
+ ERROR_ACTIVE_CONNECTIONS = 2402
838
+ ERROR_DEVICE_IN_USE = 2404
839
+ ERROR_UNKNOWN_PRINT_MONITOR = 3000
840
+ # :startdoc:
841
+
842
+ ERROR_USER_DEFINED_BASE = 0xF000
843
+
844
+ # Flags for FormatMessage function:
845
+
846
+ FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100
847
+ FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200
848
+ FORMAT_MESSAGE_FROM_STRING = 0x00000400
849
+ FORMAT_MESSAGE_FROM_HMODULE = 0x00000800
850
+ FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000
851
+ FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000
852
+ FORMAT_MESSAGE_MAX_WIDTH_MASK = 0x000000FF
853
+
854
+ ##
855
+ # FormatMessage Function
856
+ # Formats a message string. The function requires a message definition as input. The message definition
857
+ # can come from a buffer passed into the function. It can come from a message table resource in an
858
+ # already-loaded module. Or the caller can ask the function to search the system's message table
859
+ # resource(s) for the message definition. The function finds the message definition in a message table
860
+ # resource based on a message identifier and a language identifier. The function copies the formatted
861
+ # message text to an output buffer, processing any embedded insert sequences if requested.
862
+ #
863
+ # [*Syntax*] DWORD WINAPI FormatMessage( DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD
864
+ # dwLanguageId, LPTSTR lpBuffer, DWORD nSize, va_list* Arguments );
865
+ #
866
+ # dwFlags:: [in] The formatting options, and how to interpret the lpSource parameter. The low-order byte of dwFlags
867
+ # specifies how the function handles line breaks in the output buffer. The low-order byte can also
868
+ # specify the maximum width of a formatted output line. Possible values:
869
+ # - FORMAT_MESSAGE_ALLOCATE_BUFFER - The lpBuffer parameter is a pointer to a PVOID pointer, and that
870
+ # the nSize parameter specifies the minimum number of TCHARs to allocate for an output message buffer.
871
+ # The function allocates a buffer large enough to hold the formatted message, and places a pointer to
872
+ # the allocated buffer at the address specified by lpBuffer. The caller should use the LocalFree
873
+ # function to free the buffer when it is no longer needed.
874
+ # - FORMAT_MESSAGE_ARGUMENT_ARRAY - The Arguments parameter is not a va_list structure, but is a pointer
875
+ # to an array of values that represent the arguments. This flag cannot be used with 64-bit integer
876
+ # values. If you are using a 64-bit integer, you must use the va_list structure.
877
+ # - FORMAT_MESSAGE_FROM_HMODULE - The lpSource parameter is a module handle containing the message-table
878
+ # resource(s) to search. If this lpSource handle is NULL, the current process's application image file
879
+ # will be searched. This flag cannot be used with FORMAT_MESSAGE_FROM_STRING. If the module has no
880
+ # message table resource, the function fails with ERROR_RESOURCE_TYPE_NOT_FOUND.
881
+ # - FORMAT_MESSAGE_FROM_STRING - The lpSource parameter is a pointer to a null-terminated string that
882
+ # contains a message definition. The message definition may contain insert sequences, just as the
883
+ # message text in a message table resource may. Cannot be used with FORMAT_MESSAGE_FROM_HMODULE or
884
+ # FORMAT_MESSAGE_FROM_SYSTEM.
885
+ # - FORMAT_MESSAGE_FROM_SYSTEM - The function should search the system message-table resource(s) for
886
+ # the requested message. If this flag is specified with FORMAT_MESSAGE_FROM_HMODULE, the function
887
+ # searches the system message table if the message is not found in the module specified by lpSource.
888
+ # This flag cannot be used with FORMAT_MESSAGE_FROM_STRING. If this flag is specified, an application
889
+ # can pass the result of the GetLastError function to retrieve the message text for a system error.
890
+ # - FORMAT_MESSAGE_IGNORE_INSERTS - Insert sequences in the message definition are to be ignored and
891
+ # passed through to the output buffer unchanged. This flag is useful for fetching a message for later
892
+ # formatting. If this flag is set, the Arguments parameter is ignored.
893
+ # <b>The low-order byte of dwFlags can specify the maximum width of a formatted output line. The
894
+ # following are possible values of the low-order byte:</b>
895
+ # - 0 - There are no output line width restrictions. The function stores line breaks that are in the
896
+ # message definition text into the output buffer.
897
+ # - FORMAT_MESSAGE_MAX_WIDTH_MASK - The function ignores regular line breaks in the message definition
898
+ # text. The function stores hard-coded line breaks in the message definition text into the output
899
+ # buffer. The function generates no new line breaks.
900
+ # If the low-order byte is a nonzero value other than FORMAT_MESSAGE_MAX_WIDTH_MASK, it specifies the
901
+ # maximum number of characters in an output line. The function ignores regular line breaks in the
902
+ # message definition text. The function never splits a string delimited by white space across a line
903
+ # break. The function stores hard-coded line breaks in the message definition text into the output
904
+ # buffer. Hard-coded line breaks are coded with the %n escape sequence.
905
+ # lpSource:: The location of the message definition. The type of this parameter depends upon the settings in the
906
+ # dwFlags parameter.
907
+ # - dwFlags FORMAT_MESSAGE_FROM_HMODULE: Handle to the module that contains the message table to search.
908
+ # - dwFlags FORMAT_MESSAGE_FROM_STRING: Pointer to a string that consists of unformatted message text.
909
+ # It will be scanned for inserts and formatted accordingly.
910
+ # - If neither of these flags is set in dwFlags, then lpSource is ignored.
911
+ # dwMessageId:: The message identifier for the requested message. This parameter is ignored if dwFlags includes
912
+ # FORMAT_MESSAGE_FROM_STRING.
913
+ # dwLanguageId:: The language identifier for the requested message. This parameter is ignored if dwFlags includes
914
+ # FORMAT_MESSAGE_FROM_STRING. If you pass a specific LANGID in this parameter, FormatMessage will
915
+ # return a message for that LANGID only. If the function cannot find a message for that LANGID, it
916
+ # returns ERROR_RESOURCE_LANG_NOT_FOUND. If you pass in zero, FormatMessage looks for a message for
917
+ # LANGIDs in the following order:
918
+ # 1. Language neutral
919
+ # 2. Thread LANGID, based on the thread's locale value
920
+ # 3. User default LANGID, based on the user's default locale value
921
+ # 4. System default LANGID, based on the system default locale value
922
+ # 5. US English
923
+ # If FormatMessage does not locate a message for any of the preceding LANGIDs, it returns any
924
+ # language message string that is present. If that fails, it returns ERROR_RESOURCE_LANG_NOT_FOUND.
925
+ # lpBuffer:: A pointer to a buffer that receives the null-terminated string that specifies the formatted message.
926
+ # If dwFlags includes FORMAT_MESSAGE_ALLOCATE_BUFFER, the function allocates a buffer using the
927
+ # LocalAlloc function, and places the pointer to the buffer at the address specified in lpBuffer.
928
+ # This buffer cannot be larger than 64K bytes.
929
+ # nSize:: If the FORMAT_MESSAGE_ALLOCATE_BUFFER flag is not set, this parameter specifies the size of the output
930
+ # buffer, in TCHARs. If FORMAT_MESSAGE_ALLOCATE_BUFFER is set, this parameter specifies the minimum
931
+ # number of TCHARs to allocate for an output buffer. The output buffer cannot be larger than 64K bytes.
932
+ # Arguments:: An array of values that are used as insert values in the formatted message. A %1 in the format string
933
+ # indicates the first value in the Arguments array; a %2 indicates the second argument; and so on.
934
+ # The interpretation of each value depends on the formatting information associated with the insert in
935
+ # the message definition. The default is to treat each value as a pointer to a null-terminated string.
936
+ # By default, the Arguments parameter is of type va_list*, which is a language- and
937
+ # implementation-specific data type for describing a variable number of arguments. The state of the
938
+ # va_list argument is undefined upon return from the function. To use the va_list again, destroy the
939
+ # variable argument list pointer using va_end and reinitialize it with va_start.
940
+ # If you do not have a pointer of type va_list*, then specify the FORMAT_MESSAGE_ARGUMENT_ARRAY flag and
941
+ # pass a pointer to an array of DWORD_PTR values; those values are input to the message formatted as the
942
+ # insert values. Each insert must have a corresponding element in the array.
943
+ #
944
+ # *Returns*:: If the function succeeds, the return value is the number of TCHARs stored in the output
945
+ # buffer, excluding the terminating null character. If the function fails, the return value is zero.
946
+ # To get extended error information, call GetLastError.
947
+ # ---
948
+ # *Remarks*:
949
+ # Within the message text, several escape sequences are supported for dynamically formatting the
950
+ # message. These escape sequences and their meanings are shown in the following tables. All escape
951
+ # sequences start with the percent character (%).
952
+ # %0:: Terminates a message text line without a trailing new line character. This escape sequence can be
953
+ # used to build up long lines or to terminate the message itself without a trailing new line character.
954
+ # It is useful for prompt messages.
955
+ # %n!format string!:: Identifies an insert. The value of n can be in the range from 1 through 99. The format string
956
+ # (which must be surrounded by exclamation marks) is optional and defaults to !s! if not
957
+ # specified. For more information, see Format Specification Fields. The format string can
958
+ # include a width and precision specifier for strings and a width specifier for integers.
959
+ # Use an asterisk (*) to specify the width and precision. For example, %1!*.*s! or %1!*u!.
960
+ # If you do not use the width and precision specifiers, the insert numbers correspond directly
961
+ # to the input arguments. For example, if the source string is "%1 %2 %1" and the input
962
+ # arguments are "Bill" and "Bob", the formatted output string is "Bill Bob Bill".
963
+ # However, if you use a width and precision specifier, the insert numbers do not correspond
964
+ # directly to # the input arguments. For example, the insert numbers for the previous
965
+ # example could change to "%1!*.*s! %4 %5!*s!".
966
+ # The insert numbers depend on whether you use arguments array (FORMAT_MESSAGE_ARGUMENT_ARRAY)
967
+ # or a va_list. For an arguments array, the next insert number is n+2 if the previous format
968
+ # string contained one asterisk and is n+3 if two asterisks were specified. For a va_list,
969
+ # the next insert number is n+1 if the previous format string contained one asterisk and is n+2
970
+ # if two asterisks were specified. If you want to repeat "Bill", as in the previous example,
971
+ # the arguments must include "Bill" twice. E.g., if source string is "%1!*.*s! %4 %5!*s!",
972
+ # the arguments could be, 4, 2, Bill, Bob, 6, Bill (if using the FORMAT_MESSAGE_ARGUMENT_ARRAY).
973
+ # The formatted string would then be " Bi Bob Bill".
974
+ # Repeating insert numbers when the source string contains width and precision specifiers may
975
+ # not yield the intended results. If you replaced %5 with %1, the function would try to print
976
+ # a string at address 6 (likely resulting in an access violation).
977
+ # Floating-point format specifiers—e, E, f, and g—are not supported. The workaround is to use
978
+ # the StringCchPrintf function to format the floating-point number into a temporary buffer,
979
+ # then use that buffer as the insert string.
980
+ # Inserts that use the I64 prefix are treated as two 32-bit arguments. They must be used before
981
+ # subsequent arguments are used. Note that it may be easier for you to use StringCchPrintf
982
+ # instead of this prefix.
983
+ #
984
+ # Any other nondigit character following a percent character is formatted in the output message without the
985
+ # percent character. Following are some examples.
986
+ # %%:: A single percent sign.
987
+ # %space:: A single space. This format string can be used to ensure the appropriate number of trailing
988
+ # spaces in a message text line.
989
+ # %.:: A single period. This format string can be used to include a single period at the beginning of a
990
+ # line without terminating the message text definition.
991
+ # %!:: A single exclamation point. This format string can be used to include an exclamation point
992
+ # immediately after an insert without its being mistaken for the beginning of a format string.
993
+ # %n:: A hard line break when the format string occurs at the end of a line. This format string is useful
994
+ # when FormatMessage is supplying regular line breaks so the message fits in a certain width.
995
+ # %r:: A hard carriage return without a trailing newline character.
996
+ # %t:: A single tab.
997
+ # ---
998
+ # *Security* *Remarks*:
999
+ # If this function is called without FORMAT_MESSAGE_IGNORE_INSERTS, the Arguments parameter must contain
1000
+ # enough parameters to satisfy all insertion sequences in the message string, and they must be of the
1001
+ # correct type. Therefore, do not use untrusted or unknown message strings with inserts enabled because
1002
+ # they can contain more insertion sequences than Arguments provides, or those they may be of the wrong
1003
+ # type. In particular, it is unsafe to take an arbitrary system error code returned from an API and use
1004
+ # FORMAT_MESSAGE_FROM_SYSTEM without FORMAT_MESSAGE_IGNORE_INSERTS.
1005
+ # ---
1006
+ # <b>Enhanced (snake_case) API: returns message instead of num_chars or *nil* if function fails</b>
1007
+ #
1008
+ # :call-seq:
1009
+ # message = format_message(dw_flags, lp_source, dw_message_id, dw_language_id, *args)
1010
+ #
1011
+ function :FormatMessage, [:DWORD, :LPCVOID, :DWORD, :DWORD, :LPTSTR, :DWORD, :varargs], :DWORD,
1012
+ &->(api, flags=FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY,
1013
+ source=nil, message_id=0, language_id=0, *args){
1014
+ buffer = FFI::MemoryPointer.new :char, 260
1015
+ args = [:int, 0] if args.empty?
1016
+ num_chars = api.call(flags, source, message_id, language_id, buffer, buffer.size, *args)
1017
+ num_chars == 0 ? nil : buffer.get_bytes(0, num_chars).strip }
1018
+
1019
+
1020
+ ##
1021
+ # GetLastError Function
1022
+ # Retrieves the calling thread's last-error code value. The last-error code is maintained on a
1023
+ # per-thread basis. Multiple threads do not overwrite each other's last-error code.
1024
+ # Visual Basic: Applications should call err.LastDllError instead of GetLastError.
1025
+ #
1026
+ # [*Syntax*] DWORD WINAPI GetLastError( void );
1027
+ #
1028
+ # This function has no parameters.
1029
+ #
1030
+ # *Returns*:: The return value is the calling thread's last-error code.
1031
+ # The Return Value section of the documentation for each function that sets the last-error code notes
1032
+ # the conditions under which the function sets the last-error code. Most functions that set the thread's
1033
+ # last-error code set it when they fail. However, some functions also set the last-error code when they
1034
+ # succeed. If the function is not documented to set the last-error code, the value returned by this
1035
+ # function is simply the most recent last-error code to have been set; some functions set the last-error
1036
+ # code to 0 on success and others do not.
1037
+ # ---
1038
+ # *Remarks*:
1039
+ # Functions executed by the calling thread set this value by calling the SetLastError function. You
1040
+ # should call the GetLastError function immediately when a function's return value indicates that such a
1041
+ # call will return useful data. That is because some functions call SetLastError with a zero when they
1042
+ # succeed, wiping out the error code set by the most recently failed function.
1043
+ # To obtain an error string for system error codes, use the FormatMessage function. For a complete list
1044
+ # of error codes provided by the operating system, see System Error Codes.
1045
+ # The error codes returned by a function are not part of the Windows API specification and can vary by
1046
+ # operating system or device driver. For this reason, we cannot provide the complete list of error codes
1047
+ # that can be returned by each function. There are also many functions whose documentation does not
1048
+ # include even a partial list of error codes that can be returned.
1049
+ # Error codes are 32-bit values (bit 31 is the most significant bit). Bit 29 is reserved for
1050
+ # application-defined error codes; no system error code has this bit set. If you are defining an error
1051
+ # code for your application, set this bit to one. That indicates that the error code has been defined by
1052
+ # an application, and ensures that your error code does not conflict with any error codes defined by the
1053
+ # system.
1054
+ # To convert a system error into an HRESULT value, use the HRESULT_FROM_WIN32 macro.
1055
+ # ---
1056
+ # <b>Enhanced (snake_case) API: returns error message instead of error code</b>
1057
+ #
1058
+ # :call-seq:
1059
+ # error_message = get_last_error()
1060
+ #
1061
+ function :GetLastError, [], :uint32,
1062
+ &->(api) { error_code = api.call
1063
+ flags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY
1064
+ format_message(flags, nil, error_code)}
1065
+ end
1066
+ end