VirtualBox

source: vbox/trunk/include/iprt/err.h@ 217

Last change on this file since 217 was 217, checked in by vboxsync, 18 years ago

hacking darwin memory objects.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 29.1 KB
Line 
1/** @file
2 * InnoTek Portable Runtime - Status Codes.
3 */
4
5/*
6 * Copyright (C) 2006 InnoTek Systemberatung GmbH
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License as published by the Free Software Foundation,
12 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13 * distribution. VirtualBox OSE is distributed in the hope that it will
14 * be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * If you received this file as part of a commercial VirtualBox
17 * distribution, then only the terms of your commercial VirtualBox
18 * license agreement apply instead of the previous paragraph.
19 */
20
21
22#ifndef __iprt_err_h__
23#define __iprt_err_h__
24
25#include <iprt/cdefs.h>
26#include <iprt/types.h>
27
28__BEGIN_DECLS
29
30/** @defgroup grp_rt_err RTErr - Status Codes
31 * @ingroup grp_rt
32 * @{
33 */
34/* SED-START */
35
36/** @name Misc. Status Codes
37 * @{
38 */
39/** Success. */
40#define VINF_SUCCESS 0
41
42/** General failure - DON'T USE THIS!!!
43 * (aka SUPDRV_ERR_GENERAL_FAILURE) */
44#define VERR_GENERAL_FAILURE (-1)
45/** Invalid parameter.
46 * (aka SUPDRV_ERR_INVALID_PARAM) */
47#define VERR_INVALID_PARAMETER (-2)
48/** Invalid magic or cookie.
49 * (aka SUPDRV_ERR_INVALID_MAGIC) */
50#define VERR_INVALID_MAGIC (-3)
51/** Invalid loader handle.
52 * (aka SUPDRV_ERR_INVALID_HANDLE) */
53#define VERR_INVALID_HANDLE (-4)
54/** Failed to lock the address range.
55 * (aka SUPDRV_ERR_INVALID_HANDLE) */
56#define VERR_LOCK_FAILED (-5)
57/** Invalid memory pointer.
58 * (aka SUPDRV_ERR_INVALID_POINTER) */
59#define VERR_INVALID_POINTER (-6)
60/** Failed to patch the IDT.
61 * (aka SUPDRV_ERR_IDT_FAILED) */
62#define VERR_IDT_FAILED (-7)
63/** Memory allocation failed.
64 * (aka SUPDRV_ERR_NO_MEMORY) */
65#define VERR_NO_MEMORY (-8)
66/** Already loaded.
67 * (aka SUPDRV_ERR_ALREADY_LOADED) */
68#define VERR_ALREADY_LOADED (-9)
69/** Permission denied.
70 * (aka SUPDRV_ERR_PERMISSION_DENIED) */
71#define VERR_PERMISSION_DENIED (-10)
72/** Version mismatch.
73 * (aka SUPDRV_ERR_VERSION_MISMATCH) */
74#define VERR_VERSION_MISMATCH (-11)
75/** The request function is not implemented. */
76#define VERR_NOT_IMPLEMENTED (-12)
77
78/** Failed to allocate temporary memory. */
79#define VERR_NO_TMP_MEMORY (-20)
80/** Invalid file mode mask (RTFMODE). */
81#define VERR_INVALID_FMODE (-21)
82/** Incorrect call order. */
83#define VERR_WRONG_ORDER (-22)
84/** There is no TLS (thread local storage) available for storing the current thread. */
85#define VERR_NO_TLS_FOR_SELF (-23)
86/** Failed to set the TLS (thread local storage) entry which points to our thread structure. */
87#define VERR_FAILED_TO_SET_SELF_TLS (-24)
88/** Not able to allocate contiguous memory. */
89#define VERR_NO_CONT_MEMORY (-26)
90/** No memory available for page table or page directory. */
91#define VERR_NO_PAGE_MEMORY (-27)
92/** Already initialized. */
93#define VINF_ALREADY_INITIALIZED 28
94/** The specified thread is dead. */
95#define VERR_THREAD_IS_DEAD (-29)
96/** The specified thread is not waitable. */
97#define VERR_THREAD_NOT_WAITABLE (-30)
98/** Pagetable not present. */
99#define VERR_PAGE_TABLE_NOT_PRESENT (-31)
100/** Internal error - we're screwed if this happens. */
101#define VERR_INTERNAL_ERROR (-32)
102/** The per process timer is busy. */
103#define VERR_TIMER_BUSY (-33)
104/** Address conflict. */
105#define VERR_ADDRESS_CONFLICT (-34)
106/** Unresolved (unknown) host platform error. */
107#define VERR_UNRESOLVED_ERROR (-35)
108/** Invalid function. */
109#define VERR_INVALID_FUNCTION (-36)
110/** Not supported. */
111#define VERR_NOT_SUPPORTED (-37)
112/** Access denied. */
113#define VERR_ACCESS_DENIED (-38)
114/** Call interrupted. */
115#define VERR_INTERRUPTED (-39)
116/** Timeout. */
117#define VERR_TIMEOUT (-40)
118/** Buffer too small to save result. */
119#define VERR_BUFFER_OVERFLOW (-41)
120/** Buffer too small to save result. */
121#define VINF_BUFFER_OVERFLOW 41
122/** Data size overflow. */
123#define VERR_TOO_MUCH_DATA (-42)
124/** Max threads number reached. */
125#define VERR_MAX_THRDS_REACHED (-43)
126/** Max process number reached. */
127#define VERR_MAX_PROCS_REACHED (-44)
128/** The recipient process has refused the signal. */
129#define VERR_SIGNAL_REFUSED (-45)
130/** A signal is already pending. */
131#define VERR_SIGNAL_PENDING (-46)
132/** The signal being posted is not correct. */
133#define VERR_SIGNAL_INVALID (-47)
134/** The state changed.
135 * This is a generic error message and needs a context to make sense. */
136#define VERR_STATE_CHANGED (-48)
137/** Warning, the state changed.
138 * This is a generic error message and needs a context to make sense. */
139#define VWRN_STATE_CHANGED 48
140/** Error while parsing UUID string */
141#define VERR_INVALID_UUID_FORMAT (-49)
142/** The specified process was not found. */
143#define VERR_PROCESS_NOT_FOUND (-50)
144/** The process specified to a non-block wait had not exitted. */
145#define VERR_PROCESS_RUNNING (-51)
146/** Retry the operation. */
147#define VERR_TRY_AGAIN (-52)
148/** Generic parse error. */
149#define VERR_PARSE_ERROR (-53)
150/** Value out of range. */
151#define VERR_OUT_OF_RANGE (-54)
152/** A numeric convertion encountered a value which was too big for the target. */
153#define VERR_NUMBER_TOO_BIG (-55)
154/** A numeric convertion encountered a value which was too big for the target. */
155#define VWRN_NUMBER_TOO_BIG 55
156/** The number begin converted (string) contained no digits. */
157#define VERR_NO_DIGITS (-56)
158/** The number begin converted (string) contained no digits. */
159#define VWRN_NO_DIGITS 56
160/** Encountered a '-' during convertion to an unsigned value. */
161#define VERR_NEGATIVE_UNSIGNED (-57)
162/** Encountered a '-' during convertion to an unsigned value. */
163#define VWRN_NEGATIVE_UNSIGNED 57
164/** Error while characters translation (unicode and so). */
165#define VERR_NO_TRANSLATION (-58)
166/** Encountered unicode code point which is reserved for use as endian indicator (0xffff or 0xfffe). */
167#define VERR_CODE_POINT_ENDIAN_INDICATOR (-59)
168/** Encountered unicode code point in the surrogate range (0xd800 to 0xdfff). */
169#define VERR_CODE_POINT_SURROGATE (-60)
170/** A string claiming to be UTF-8 is incorrectly encoded. */
171#define VERR_INVALID_UTF8_ENCODING (-61)
172/** Ad string claiming to be in UTF-16 is incorrectly encoded. */
173#define VERR_INVALID_UTF16_ENCODING (-62)
174/** Encountered a unicode code point which cannot be represented as UTF-16. */
175#define VERR_CANT_RECODE_AS_UTF16 (-63)
176/** Got an out of memory condition trying to allocate a string. */
177#define VERR_NO_STR_MEMORY (-64)
178/** Got an out of memory condition trying to allocate a UTF-16 (/UCS-2) string. */
179#define VERR_NO_UTF16_MEMORY (-65)
180/** Get an out of memory condition trying to allocate a code point array. */
181#define VERR_NO_CODE_POINT_MEMORY (-66)
182/** Can't free the memory because it's used in mapping. */
183#define VERR_MEMORY_BUSY (-67)
184/** The timer can't be started because it's already active. */
185#define VERR_TIMER_ACTIVE (-68)
186/** The timer can't be stopped because i's already suspended. */
187#define VERR_TIMER_SUSPENDED (-69)
188/** The operation was cancelled by the user. */
189#define VERR_CANCELLED (-70)
190/** Failed to initialize a memory object.
191 * Exactly what this means is OS specific. */
192#define VERR_MEMOBJ_INIT_FAILED (-71)
193/** Out of memory condition when allocating memory with low physical backing. */
194#define VERR_NO_LOW_MEMORY (-72)
195/** Out of memory condition when allocating physical memory (without mapping). */
196#define VERR_NO_PHYS_MEMORY (-73)
197/** The address (virtual or physical) is too big. */
198#define VERR_ADDRESS_TOO_BIG (-74)
199/** Failed to map a memory object. */
200#define VERR_MAP_FAILED (-75)
201/** @} */
202
203
204/** @name Common File/Disk/Pipe/etc Status Codes
205 * @{
206 */
207/** Unresolved (unknown) file i/o error. */
208#define VERR_FILE_IO_ERROR (-100)
209/** File/Device open failed. */
210#define VERR_OPEN_FAILED (-101)
211/** File not found. */
212#define VERR_FILE_NOT_FOUND (-102)
213/** Path not found. */
214#define VERR_PATH_NOT_FOUND (-103)
215/** Invalid (malformed) file/path name. */
216#define VERR_INVALID_NAME (-104)
217/** File/Device already exists. */
218#define VERR_ALREADY_EXISTS (-105)
219/** Too many open files. */
220#define VERR_TOO_MANY_OPEN_FILES (-106)
221/** Seek error. */
222#define VERR_SEEK (-107)
223/** Seek below file start. */
224#define VERR_NEGATIVE_SEEK (-108)
225/** Trying to seek on device. */
226#define VERR_SEEK_ON_DEVICE (-109)
227/** Reached the end of the file. */
228#define VERR_EOF (-110)
229/** Reached the end of the file. */
230#define VINF_EOF 110
231/** Generic file read error. */
232#define VERR_READ_ERROR (-111)
233/** Generic file write error. */
234#define VERR_WRITE_ERROR (-112)
235/** Write protect error. */
236#define VERR_WRITE_PROTECT (-113)
237/** Sharing violetion, file is being used by another process. */
238#define VERR_SHARING_VIOLATION (-114)
239/** Unable to lock a region of a file. */
240#define VERR_FILE_LOCK_FAILED (-115)
241/** File access error, another process has locked a portion of the file. */
242#define VERR_FILE_LOCK_VIOLATION (-116)
243/** File or directory can't be created. */
244#define VERR_CANT_CREATE (-117)
245/** Directory can't be deleted. */
246#define VERR_CANT_DELETE_DIRECTORY (-118)
247/** Can't move file to another disk. */
248#define VERR_NOT_SAME_DEVICE (-119)
249/** The filename or extension is too long. */
250#define VERR_FILENAME_TOO_LONG (-120)
251/** Media not present in drive. */
252#define VERR_MEDIA_NOT_PRESENT (-121)
253/** The type of media was not recognized. Not formatted? */
254#define VERR_MEDIA_NOT_RECOGNIZED (-122)
255/** Can't unlock - region was not locked. */
256#define VERR_FILE_NOT_LOCKED (-123)
257/** Unrecoverable error: lock was lost. */
258#define VERR_FILE_LOCK_LOST (-124)
259/** Can't delete directory with files. */
260#define VERR_DIR_NOT_EMPTY (-125)
261/** A directory operation was attempted on a non-directory object. */
262#define VERR_NOT_A_DIRECTORY (-126)
263/** A non-directory operation was attempted on a directory object. */
264#define VERR_IS_A_DIRECTORY (-127)
265/** @} */
266
267
268/** @name Generic Filesystem I/O Status Codes
269 * @{
270 */
271/** Unresolved (unknown) disk i/o error. */
272#define VERR_DISK_IO_ERROR (-150)
273/** Invalid drive number. */
274#define VERR_INVALID_DRIVE (-151)
275/** Disk is full. */
276#define VERR_DISK_FULL (-152)
277/** Disk was changed. */
278#define VERR_DISK_CHANGE (-153)
279/** Drive is locked. */
280#define VERR_DRIVE_LOCKED (-154)
281/** The specified disk or diskette cannot be accessed. */
282#define VERR_DISK_INVALID_FORMAT (-155)
283/** Too many symbolic links. */
284#define VERR_TOO_MANY_SYMLINKS (-156)
285/** @} */
286
287
288/** @name Generic Directory Enumeration Status Codes
289 * @{
290 */
291/** Unresolved (unknown) search error. */
292#define VERR_SEARCH_ERROR (-200)
293/** No more files found. */
294#define VERR_NO_MORE_FILES (-201)
295/** No more search handles available. */
296#define VERR_NO_MORE_SEARCH_HANDLES (-202)
297/** RTDirReadEx() failed to retrieve the extra data which was requested. */
298#define VWRN_NO_DIRENT_INFO 203
299/** @} */
300
301
302/** @name Generic Device I/O Status Codes
303 * @{
304 */
305/** Unresolved (unknown) device i/o error. */
306#define VERR_DEV_IO_ERROR (-250)
307/** Device i/o: Bad unit. */
308#define VERR_IO_BAD_UNIT (-251)
309/** Device i/o: Not ready. */
310#define VERR_IO_NOT_READY (-252)
311/** Device i/o: Bad command. */
312#define VERR_IO_BAD_COMMAND (-253)
313/** Device i/o: CRC error. */
314#define VERR_IO_CRC (-254)
315/** Device i/o: Bad length. */
316#define VERR_IO_BAD_LENGTH (-255)
317/** Device i/o: Sector not found. */
318#define VERR_IO_SECTOR_NOT_FOUND (-256)
319/** Device i/o: General failure. */
320#define VERR_IO_GEN_FAILURE (-257)
321/** @} */
322
323
324/** @name Generic Pipe I/O Status Codes
325 * @{
326 */
327/** Unresolved (unknown) pipe i/o error. */
328#define VERR_PIPE_IO_ERROR (-300)
329/** Broken pipe. */
330#define VERR_BROKEN_PIPE (-301)
331/** Bad pipe. */
332#define VERR_BAD_PIPE (-302)
333/** Pipe is busy. */
334#define VERR_PIPE_BUSY (-303)
335/** No data in pipe. */
336#define VERR_NO_DATA (-304)
337/** Pipe is not connected. */
338#define VERR_PIPE_NOT_CONNECTED (-305)
339/** More data available in pipe. */
340#define VERR_MORE_DATA (-306)
341/** @} */
342
343
344/** @name Generic Semaphores Status Codes
345 * @{
346 */
347/** Unresolved (unknown) semaphore error. */
348#define VERR_SEM_ERROR (-350)
349/** Too many semaphores. */
350#define VERR_TOO_MANY_SEMAPHORES (-351)
351/** Exclusive semaphore is owned by another process. */
352#define VERR_EXCL_SEM_ALREADY_OWNED (-352)
353/** The semaphore is set and cannot be closed. */
354#define VERR_SEM_IS_SET (-353)
355/** The semaphore cannot be set again. */
356#define VERR_TOO_MANY_SEM_REQUESTS (-354)
357/** Attempt to release mutex not owned by caller. */
358#define VERR_NOT_OWNER (-355)
359/** The semaphore has been opened too many times. */
360#define VERR_TOO_MANY_OPENS (-356)
361/** The maximum posts for the event semaphore has been reached. */
362#define VERR_TOO_MANY_POSTS (-357)
363/** The event semaphore has already been posted. */
364#define VERR_ALREADY_POSTED (-358)
365/** The event semaphore has already been reset. */
366#define VERR_ALREADY_RESET (-359)
367/** The semaphore is in use. */
368#define VERR_SEM_BUSY (-360)
369/** The previous ownership of this semaphore has ended. */
370#define VERR_SEM_OWNER_DIED (-361)
371/** Failed to open semaphore by name - not found. */
372#define VERR_SEM_NOT_FOUND (-362)
373/** Semaphore destroyed while waiting. */
374#define VERR_SEM_DESTROYED (-363)
375/** Nested ownership requests are not permitted for this semaphore type. */
376#define VERR_SEM_NESTED (-364)
377/** Deadlock detected. */
378#define VERR_DEADLOCK (-365)
379/** Ping-Pong listen or speak out of turn error. */
380#define VERR_SEM_OUT_OF_TURN (-366)
381/** @} */
382
383
384/** @name Generic Network I/O Status Codes
385 * @{
386 */
387/** Unresolved (unknown) network error. */
388#define VERR_NET_IO_ERROR (-400)
389/** The network is busy or is out of resources. */
390#define VERR_NET_OUT_OF_RESOURCES (-401)
391/** Net host name not found. */
392#define VERR_NET_HOST_NOT_FOUND (-402)
393/** Network path not found. */
394#define VERR_NET_PATH_NOT_FOUND (-403)
395/** General network printing error. */
396#define VERR_NET_PRINT_ERROR (-404)
397/** The machine is not on the network. */
398#define VERR_NET_NO_NETWORK (-405)
399/** Name is not unique on the network. */
400#define VERR_NET_NOT_UNIQUE_NAME (-406)
401
402/* These are BSD networking error codes - numbers correspond, don't mess! */
403/** Operation in progress. */
404#define VERR_NET_IN_PROGRESS (-436)
405/** Operation already in progress. */
406#define VERR_NET_ALREADY_IN_PROGRESS (-437)
407/** Attempted socket operation with a non-socket handle.
408 * (This includes closed handles.) */
409#define VERR_NET_NOT_SOCKET (-438)
410/** Destination address required. */
411#define VERR_NET_DEST_ADDRESS_REQUIRED (-439)
412/** Message too long. */
413#define VERR_NET_MSG_SIZE (-440)
414/** Protocol wrong type for socket. */
415#define VERR_NET_PROTOCOL_TYPE (-441)
416/** Protocol not available. */
417#define VERR_NET_PROTOCOL_NOT_AVAILABLE (-442)
418/** Protocol not supported. */
419#define VERR_NET_PROTOCOL_NOT_SUPPORTED (-443)
420/** Socket type not supported. */
421#define VERR_NET_SOCKET_TYPE_NOT_SUPPORTED (-444)
422/** Operation not supported. */
423#define VERR_NET_OPERATION_NOT_SUPPORTED (-445)
424/** Protocol family not supported. */
425#define VERR_NET_PROTOCOL_FAMILY_NOT_SUPPORTED (-446)
426/** Address family not supported by protocol family. */
427#define VERR_NET_ADDRESS_FAMILY_NOT_SUPPORTED (-447)
428/** Address already in use. */
429#define VERR_NET_ADDRESS_IN_USE (-448)
430/** Can't assign requested address. */
431#define VERR_NET_ADDRESS_NOT_AVAILABLE (-449)
432/** Network is down. */
433#define VERR_NET_DOWN (-450)
434/** Network is unreachable. */
435#define VERR_NET_UNREACHABLE (-451)
436/** Network dropped connection on reset. */
437#define VERR_NET_CONNECTION_RESET (-452)
438/** Software caused connection abort. */
439#define VERR_NET_CONNECTION_ABORTED (-453)
440/** Connection reset by peer. */
441#define VERR_NET_CONNECTION_RESET_BY_PEER (-454)
442/** No buffer space available. */
443#define VERR_NET_NO_BUFFER_SPACE (-455)
444/** Socket is already connected. */
445#define VERR_NET_ALREADY_CONNECTED (-456)
446/** Socket is not connected. */
447#define VERR_NET_NOT_CONNECTED (-457)
448/** Can't send after socket shutdown. */
449#define VERR_NET_SHUTDOWN (-458)
450/** Too many references: can't splice. */
451#define VERR_NET_TOO_MANY_REFERENCES (-459)
452/* ETIMEDOUT is not net. */
453/** Connection refused. */
454#define VERR_NET_CONNECTION_REFUSED (-461)
455/* ELOOP is not net. */
456/* ENAMETOOLONG is not net. */
457/** Host is down. */
458#define VERR_NET_HOST_DOWN (-464)
459/** No route to host. */
460#define VERR_NET_HOST_UNREACHABLE (-465)
461/** @} */
462
463
464/** @name TCP Status Codes
465 * @{
466 */
467/** Stop the TCP server. */
468#define VERR_TCP_SERVER_STOP (-500)
469/** The server was stopped. */
470#define VINF_TCP_SERVER_STOP 500
471/** @} */
472
473
474/** @name L4 Specific Status Codes
475 * @{
476 */
477/** Invalid offset in an L4 dataspace */
478#define VERR_L4_INVALID_DS_OFFSET (-550)
479/** IPC error */
480#define VERR_IPC (-551)
481/** Item already used */
482#define VERR_RESOURCE_IN_USE (-552)
483/** Source/destination not found */
484#define VERR_IPC_PROCESS_NOT_FOUND (-553)
485/** Receive timeout */
486#define VERR_IPC_RECEIVE_TIMEOUT (-554)
487/** Send timeout */
488#define VERR_IPC_SEND_TIMEOUT (-555)
489/** Receive cancelled */
490#define VERR_IPC_RECEIVE_CANCELLED (-556)
491/** Send cancelled */
492#define VERR_IPC_SEND_CANCELLED (-557)
493/** Receive aborted */
494#define VERR_IPC_RECEIVE_ABORTED (-558)
495/** Send aborted */
496#define VERR_IPC_SEND_ABORTED (-559)
497/** Couldn't map pages during receive */
498#define VERR_IPC_RECEIVE_MAP_FAILED (-560)
499/** Couldn't map pages during send */
500#define VERR_IPC_SEND_MAP_FAILED (-561)
501/** Send pagefault timeout in receive */
502#define VERR_IPC_RECEIVE_SEND_PF_TIMEOUT (-562)
503/** Send pagefault timeout in send */
504#define VERR_IPC_SEND_SEND_PF_TIMEOUT (-563)
505/** (One) receive buffer was too small, or too few buffers */
506#define VINF_IPC_RECEIVE_MSG_CUT 564
507/** (One) send buffer was too small, or too few buffers */
508#define VINF_IPC_SEND_MSG_CUT 565
509/** Dataspace manager server not found */
510#define VERR_L4_DS_MANAGER_NOT_FOUND (-566)
511/** @} */
512
513
514/** @name Loader Status Codes.
515 * @{
516 */
517/** Invalid executable signature. */
518#define VERR_INVALID_EXE_SIGNATURE (-600)
519/** The iprt loader recognized a ELF image, but doesn't support loading it. */
520#define VERR_ELF_EXE_NOT_SUPPORTED (-601)
521/** The iprt loader recognized a PE image, but doesn't support loading it. */
522#define VERR_PE_EXE_NOT_SUPPORTED (-602)
523/** The iprt loader recognized a LX image, but doesn't support loading it. */
524#define VERR_LX_EXE_NOT_SUPPORTED (-603)
525/** The iprt loader recognized a LE image, but doesn't support loading it. */
526#define VERR_LE_EXE_NOT_SUPPORTED (-604)
527/** The iprt loader recognized a NE image, but doesn't support loading it. */
528#define VERR_NE_EXE_NOT_SUPPORTED (-605)
529/** The iprt loader recognized a MZ image, but doesn't support loading it. */
530#define VERR_MZ_EXE_NOT_SUPPORTED (-606)
531/** The iprt loader recognized an a.out image, but doesn't support loading it. */
532#define VERR_AOUT_EXE_NOT_SUPPORTED (-607)
533/** Bad executable. */
534#define VERR_BAD_EXE_FORMAT (-608)
535/** Symbol (export) not found. */
536#define VERR_SYMBOL_NOT_FOUND (-609)
537/** Module not found. */
538#define VERR_MODULE_NOT_FOUND (-610)
539/** The loader resolved an external symbol to an address to big for the image format. */
540#define VERR_SYMBOL_VALUE_TOO_BIG (-611)
541/** The image is too big. */
542#define VERR_IMAGE_TOO_BIG (-612)
543/** The image base address is to high for this image type. */
544#define VERR_IMAGE_BASE_TOO_HIGH (-614)
545/** The PE loader encountered delayed imports, a feature which hasn't been implemented yet. */
546#define VERR_LDRPE_DELAY_IMPORT (-620)
547/** The PE loader doesn't have a clue what the security data directory entry is all about. */
548#define VERR_LDRPE_SECURITY (-621)
549/** The PE loader doesn't know how to deal with the global pointer data directory entry yet. */
550#define VERR_LDRPE_GLOBALPTR (-622)
551/** The PE loader doesn't support the TLS data directory yet. */
552#define VERR_LDRPE_TLS (-623)
553/** The PE loader doesn't grok the COM descriptor data directory entry. */
554#define VERR_LDRPE_COM_DESCRIPTOR (-624)
555/** The PE loader encountered an unknown load config directory/header size. */
556#define VERR_LDRPE_LOAD_CONFIG_SIZE (-625)
557/** The PE loader encountered a lock prefix table, a feature which hasn't been implemented yet. */
558#define VERR_LDRPE_LOCK_PREFIX_TABLE (-626)
559/** The ELF loader doesn't handle foreign endianness. */
560#define VERR_LDRELF_ODD_ENDIAN (-630)
561/** The ELF image is 'dynamic', the ELF loader can only deal with 'relocatable' images at present. */
562#define VERR_LDRELF_DYN (-631)
563/** The ELF image is 'executable', the ELF loader can only deal with 'relocatable' images at present. */
564#define VERR_LDRELF_EXEC (-632)
565/** The ELF image was created for an unsupported target machine type. */
566#define VERR_LDRELF_MACHINE (-633)
567/** The ELF version is not supported. */
568#define VERR_LDRELF_VERSION (-634)
569/** The ELF loader cannot handle multiple SYMTAB sections. */
570#define VERR_LDRELF_MULTIPLE_SYMTABS (-635)
571/** The ELF loader encountered a relocation type which is not implemented. */
572#define VERR_LDRELF_RELOCATION_NOT_SUPPORTED (-636)
573/** The ELF loader encountered a bad symbol index. */
574#define VERR_LDRELF_INVALID_SYMBOL_INDEX (-637)
575/** The ELF loader encountered an invalid symbol name offset. */
576#define VERR_LDRELF_INVALID_SYMBOL_NAME_OFFSET (-638)
577/** The ELF loader encountered an invalid relocation offset. */
578#define VERR_ELFLDR_INVALID_RELOCATION_OFFSET (-639)
579/** @}*/
580
581/** @name Debug Info Reader Status Codes.
582 * @{
583 */
584/** The specified segment:offset address was invalid. Typically an attempt at
585 * addressing outside the segment boundrary. */
586#define VERR_DBGMOD_INVALID_ADDRESS (-650)
587/** @} */
588
589
590/* SED-END */
591
592
593/** @defgroup grp_rt_err_hlp Status Code Helpers
594 * @ingroup grp_rt_err
595 * @{
596 */
597
598/** @def RT_SUCCESS
599 * Check for success. We expect success in normal cases, that is the code path depending on
600 * this check is normally taken. To prevent any prediction use RT_SUCCESS_NP instead.
601 *
602 * @returns true if rc indicates success.
603 * @returns false if rc indicates failure.
604 *
605 * @param rc The iprt status code to test.
606 */
607#define RT_SUCCESS(rc) ( RT_LIKELY((int)(rc) >= VINF_SUCCESS) )
608
609/** @def RT_SUCCESS_NP
610 * Check for success. Don't predict the result.
611 *
612 * @returns true if rc indicates success.
613 * @returns false if rc indicates failure.
614 *
615 * @param rc The iprt status code to test.
616 */
617#define RT_SUCCESS_NP(rc) ( (int)(rc) >= VINF_SUCCESS )
618
619/** @def RT_FAILURE
620 * Check for failure. We don't expect in normal cases, that is the code path depending on
621 * this check is normally NOT taken. To prevent any prediction use RT_FAILURE_NP instead.
622 *
623 * @returns true if rc indicates failure.
624 * @returns false if rc indicates success.
625 *
626 * @param rc The iprt status code to test.
627 */
628#define RT_FAILURE(rc) ( RT_UNLIKELY(!RT_SUCCESS_NP(rc)) )
629
630/** @def RT_FAILURE_NP
631 * Check for failure. Don't predict the result.
632 *
633 * @returns true if rc indicates failure.
634 * @returns false if rc indicates success.
635 *
636 * @param rc The iprt status code to test.
637 */
638#define RT_FAILURE_NP(rc) ( !RT_SUCCESS_NP(rc) )
639
640/**
641 * Converts errno to iprt status code.
642 *
643 * @returns iprt status code.
644 * @param uNativeCode errno code.
645 */
646RTDECL(int) RTErrConvertFromErrno(unsigned uNativeCode);
647
648/**
649 * Converts Win32 error code to iprt status code.
650 *
651 * Needless to say, this is only available on Win32 targets.
652 *
653 * @returns iprt status code.
654 * @param uNativeCode Win32 error code.
655 */
656RTDECL(int) RTErrConvertFromWin32(unsigned uNativeCode);
657
658/**
659 * Converts NT status code to iprt status code.
660 *
661 * Needless to say, this is only available on NT and winXX targets.
662 *
663 * @returns iprt status code.
664 * @param lNativeCode NT status code.
665 */
666RTDECL(int) RTErrConvertFromNtStatus(long lNativeCode);
667
668/**
669 * Converts OS/2 error code to iprt status code.
670 *
671 * Needless to say, this is only available on OS/2 targets.
672 *
673 * @returns iprt status code.
674 * @param uNativeCode OS/2 error code.
675 */
676RTDECL(int) RTErrConvertFromOS2(unsigned uNativeCode);
677
678/**
679 * Converts a L4 errno to a iprt status code.
680 *
681 * @returns iprt status code.
682 * @param uNativeCode l4 errno.
683 */
684RTDECL(int) RTErrConvertFromL4Errno(unsigned uNativeCode);
685
686
687#ifdef IN_RING3
688
689/**
690 * iprt status code message.
691 */
692typedef struct RTSTATUSMSG
693{
694 /** Pointer to the short message string. */
695 const char *pszMsgShort;
696 /** Pointer to the full message string. */
697 const char *pszMsgFull;
698 /** Pointer to the define string. */
699 const char *pszDefine;
700 /** Status code number. */
701 int iCode;
702} RTSTATUSMSG;
703/** Pointer to iprt status code message. */
704typedef RTSTATUSMSG *PRTSTATUSMSG;
705/** Pointer to const iprt status code message. */
706typedef const RTSTATUSMSG *PCRTSTATUSMSG;
707
708/**
709 * Get the message structure corresponding to a given iprt status code.
710 *
711 * @returns Pointer to read-only message description.
712 * @param rc The status code.
713 */
714RTDECL(PCRTSTATUSMSG) RTErrGet(int rc);
715
716/**
717 * Get the define corresponding to a given iprt status code.
718 *
719 * @returns Pointer to read-only string with the \#define identifier.
720 * @param rc The status code.
721 */
722#define RTErrGetDefine(rc) (RTErrGet(rc)->pszDefine)
723
724/**
725 * Get the short description corresponding to a given iprt status code.
726 *
727 * @returns Pointer to read-only string with the description.
728 * @param rc The status code.
729 */
730#define RTErrGetShort(rc) (RTErrGet(rc)->pszMsgShort)
731
732/**
733 * Get the full description corresponding to a given iprt status code.
734 *
735 * @returns Pointer to read-only string with the description.
736 * @param rc The status code.
737 */
738#define RTErrGetFull(rc) (RTErrGet(rc)->pszMsgFull)
739
740#ifdef __WIN__
741/**
742 * Windows error code message.
743 */
744typedef struct RTWINERRMSG
745{
746 /** Pointer to the full message string. */
747 const char *pszMsgFull;
748 /** Pointer to the define string. */
749 const char *pszDefine;
750 /** Error code number. */
751 long iCode;
752} RTWINERRMSG;
753/** Pointer to Windows error code message. */
754typedef RTWINERRMSG *PRTWINERRMSG;
755/** Pointer to const Windows error code message. */
756typedef const RTWINERRMSG *PCRTWINERRMSG;
757
758/**
759 * Get the message structure corresponding to a given Windows error code.
760 *
761 * @returns Pointer to read-only message description.
762 * @param rc The status code.
763 */
764RTDECL(PCRTWINERRMSG) RTErrWinGet(long rc);
765#endif /* __WIN__ */
766
767#endif /* IN_RING3 */
768
769/** @} */
770
771/** @} */
772
773__END_DECLS
774
775#endif
776
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette