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

