386
393
#endif /* IN_RING3 */
395
/** @defgroup RTERRINFO_FLAGS_XXX RTERRINFO::fFlags
397
/** Custom structure (the default). */
398
#define RTERRINFO_FLAGS_T_CUSTOM UINT32_C(0)
399
/** Static structure (RTERRINFOSTATIC). */
400
#define RTERRINFO_FLAGS_T_STATIC UINT32_C(1)
401
/** Allocated structure (RTErrInfoAlloc). */
402
#define RTERRINFO_FLAGS_T_ALLOC UINT32_C(2)
403
/** Reserved type. */
404
#define RTERRINFO_FLAGS_T_RESERVED UINT32_C(3)
406
#define RTERRINFO_FLAGS_T_MASK UINT32_C(3)
407
/** Error info is set. */
408
#define RTERRINFO_FLAGS_SET RT_BIT_32(2)
409
/** Fixed flags (magic). */
410
#define RTERRINFO_FLAGS_MAGIC UINT32_C(0xbabe0000)
411
/** The bit mask for the magic value. */
412
#define RTERRINFO_FLAGS_MAGIC_MASK UINT32_C(0xffff0000)
416
* Initializes an error info structure.
418
* @returns @a pErrInfo.
419
* @param pErrInfo The error info structure to init.
420
* @param pszMsg The message buffer. Must be at least one byte.
421
* @param cbMsg The size of the message buffer.
423
DECLINLINE(PRTERRINFO) RTErrInfoInit(PRTERRINFO pErrInfo, char *pszMsg, size_t cbMsg)
427
pErrInfo->fFlags = RTERRINFO_FLAGS_T_CUSTOM | RTERRINFO_FLAGS_MAGIC;
428
pErrInfo->rc = /*VINF_SUCCESS*/ 0;
429
pErrInfo->pszMsg = pszMsg;
430
pErrInfo->cbMsg = cbMsg;
431
pErrInfo->apvReserved[0] = NULL;
432
pErrInfo->apvReserved[1] = NULL;
438
* Initialize a static error info structure.
440
* @param pStaticErrInfo The static error info structure to init.
442
DECLINLINE(void) RTErrInfoInitStatic(PRTERRINFOSTATIC pStaticErrInfo)
444
RTErrInfoInit(&pStaticErrInfo->Core, pStaticErrInfo->szMsg, sizeof(pStaticErrInfo->szMsg));
445
pStaticErrInfo->Core.fFlags = RTERRINFO_FLAGS_T_STATIC | RTERRINFO_FLAGS_MAGIC;
449
* Allocates a error info structure with a buffer at least the given size.
451
* @returns Pointer to an error info structure on success, NULL on failure.
453
* @param cbMsg The minimum message buffer size. Use 0 to get
454
* the default buffer size.
456
RTDECL(PRTERRINFO) RTErrInfoAlloc(size_t cbMsg);
459
* Same as RTErrInfoAlloc, except that an IPRT status code is returned.
461
* @returns IPRT status code.
463
* @param cbMsg The minimum message buffer size. Use 0 to get
464
* the default buffer size.
465
* @param ppErrInfo Where to store the pointer to the allocated
466
* error info structure on success. This is
467
* always set to NULL.
469
RTDECL(int) RTErrInfoAllocEx(size_t cbMsg, PRTERRINFO *ppErrInfo);
472
* Frees an error info structure allocated by RTErrInfoAlloc or
475
* @param pErrInfo The error info structure.
477
RTDECL(void) RTErrInfoFree(PRTERRINFO pErrInfo);
480
* Fills in the error info details.
484
* @param pErrInfo The error info structure to fill in.
485
* @param rc The status code to return.
486
* @param pszMsg The error message string.
488
RTDECL(int) RTErrInfoSet(PRTERRINFO pErrInfo, int rc, const char *pszMsg);
491
* Fills in the error info details, with a sprintf style message.
495
* @param pErrInfo The error info structure to fill in.
496
* @param rc The status code to return.
497
* @param pszFormat The format string.
498
* @param ... The format arguments.
500
RTDECL(int) RTErrInfoSetF(PRTERRINFO pErrInfo, int rc, const char *pszFormat, ...);
503
* Fills in the error info details, with a vsprintf style message.
507
* @param pErrInfo The error info structure to fill in.
508
* @param rc The status code to return.
509
* @param pszFormat The format string.
510
* @param va The format arguments.
512
RTDECL(int) RTErrInfoSetV(PRTERRINFO pErrInfo, int rc, const char *pszFormat, va_list va);
515
* Checks if the error info is set.
517
* @returns true if set, false if not.
518
* @param pErrInfo The error info structure. NULL is OK.
520
DECLINLINE(bool) RTErrInfoIsSet(PCRTERRINFO pErrInfo)
524
return (pErrInfo->fFlags & (RTERRINFO_FLAGS_MAGIC_MASK | RTERRINFO_FLAGS_SET))
525
== (RTERRINFO_FLAGS_MAGIC | RTERRINFO_FLAGS_SET);
529
* Clears the error info structure.
531
* @param pErrInfo The error info structure. NULL is OK.
533
DECLINLINE(void) RTErrInfoClear(PRTERRINFO pErrInfo)
537
pErrInfo->fFlags &= ~RTERRINFO_FLAGS_SET;
538
pErrInfo->rc = /*VINF_SUCCESS*/0;
539
*pErrInfo->pszMsg = '\0';
547
/** @name Status Code Ranges
549
/** The first status code in the primary IPRT range. */
550
#define RTERR_RANGE1_FIRST 0
551
/** The last status code in the primary IPRT range. */
552
#define RTERR_RANGE1_LAST 999
554
/** The first status code in the secondary IPRT range. */
555
#define RTERR_RANGE2_FIRST 22000
556
/** The last status code in the secondary IPRT range. */
557
#define RTERR_RANGE2_LAST 32766
559
/** The first status code in the user range. */
560
#define RTERR_USER_FIRST 1000
561
/** The last status code in the user range. */
562
#define RTERR_USER_LAST 21999
616
797
* This status is used when two threads is caught sharing the same object
618
799
#define VERR_CALLER_NO_REFERENCE (-93)
619
/** Invalid login data given. */
620
#define VERR_LOGON_FAILURE (-94)
621
800
/** Generic no change error. */
622
801
#define VERR_NO_CHANGE (-95)
623
802
/** Generic no change info. */
624
803
#define VINF_NO_CHANGE 95
625
804
/** Out of memory condition when allocating executable memory. */
626
805
#define VERR_NO_EXEC_MEMORY (-96)
806
/** The alignment is not supported. */
807
#define VERR_UNSUPPORTED_ALIGNMENT (-97)
808
/** The alignment is not really supported, however we got lucky with this
810
#define VINF_UNSUPPORTED_ALIGNMENT 97
811
/** Duplicate something. */
812
#define VERR_DUPLICATE (-98)
813
/** Something is missing. */
814
#define VERR_MISSING (-99)
712
901
#define VERR_FILE_AIO_INSUFFICIENT_RESSOURCES (-137)
713
902
/** Device or resource is busy. */
714
903
#define VERR_RESOURCE_BUSY (-138)
904
/** A file operation was attempted on a non-file object. */
905
#define VERR_NOT_A_FILE (-139)
906
/** A non-file operation was attempted on a file object. */
907
#define VERR_IS_A_FILE (-140)
908
/** Unexpected filesystem object type. */
909
#define VERR_UNEXPECTED_FS_OBJ_TYPE (-141)
910
/** A path does not start with a root specification. */
911
#define VERR_PATH_DOES_NOT_START_WITH_ROOT (-142)
912
/** A path is relative, expected an absolute path. */
913
#define VERR_PATH_IS_RELATIVE (-143)
914
/** A path is not relative (start with root), expected an relative path. */
915
#define VERR_PATH_IS_NOT_RELATIVE (-144)
1256
1459
/** The checksum of a tar header record doesn't match. */
1257
1460
#define VERR_TAR_CHKSUM_MISMATCH (-925)
1461
/** The tar end of file record was read. */
1462
#define VERR_TAR_END_OF_FILE (-926)
1463
/** The tar file ended unexpectedly. */
1464
#define VERR_TAR_UNEXPECTED_EOS (-927)
1465
/** The tar termination records was encountered without reaching the end of
1466
* the input stream. */
1467
#define VERR_TAR_EOS_MORE_INPUT (-928)
1468
/** A number tar header field was malformed. */
1469
#define VERR_TAR_BAD_NUM_FIELD (-929)
1470
/** A numeric tar header field was not terminated correctly. */
1471
#define VERR_TAR_BAD_NUM_FIELD_TERM (-930)
1472
/** A number tar header field was encoded using base-256 which this
1473
* tar implementation currently does not support. */
1474
#define VERR_TAR_BASE_256_NOT_SUPPORTED (-931)
1475
/** A number tar header field yielded a value too large for the internal
1476
* variable of the tar interpreter. */
1477
#define VERR_TAR_NUM_VALUE_TOO_LARGE (-932)
1478
/** The combined minor and major device number type is too small to hold the
1479
* value stored in the tar header. */
1480
#define VERR_TAR_DEV_VALUE_TOO_LARGE (-933)
1481
/** The mode field in a tar header is bad. */
1482
#define VERR_TAR_BAD_MODE_FIELD (-934)
1483
/** The mode field should not include the type. */
1484
#define VERR_TAR_MODE_WITH_TYPE (-935)
1485
/** The size field should be zero for links and symlinks. */
1486
#define VERR_TAR_SIZE_NOT_ZERO (-936)
1487
/** Encountered an unknown type flag. */
1488
#define VERR_TAR_UNKNOWN_TYPE_FLAG (-937)
1489
/** The tar header is all zeros. */
1490
#define VERR_TAR_ZERO_HEADER (-938)
1491
/** Not a uniform standard tape v0.0 archive header. */
1492
#define VERR_TAR_NOT_USTAR_V00 (-939)
1493
/** The name is empty. */
1494
#define VERR_TAR_EMPTY_NAME (-940)
1495
/** A non-directory entry has a name ending with a slash. */
1496
#define VERR_TAR_NON_DIR_ENDS_WITH_SLASH (-941)
1497
/** Encountered an unsupported portable archive exchange (pax) header. */
1498
#define VERR_TAR_UNSUPPORTED_PAX_TYPE (-942)
1499
/** Encountered an unsupported Solaris Tar extension. */
1500
#define VERR_TAR_UNSUPPORTED_SOLARIS_HDR_TYPE (-943)
1501
/** Encountered an unsupported GNU Tar extension. */
1502
#define VERR_TAR_UNSUPPORTED_GNU_HDR_TYPE (-944)
1503
/** Malformed checksum field in the tar header. */
1504
#define VERR_TAR_BAD_CHKSUM_FIELD (-945)
1505
/** Malformed checksum field in the tar header. */
1506
#define VERR_TAR_MALFORMED_GNU_LONGXXXX (-946)
1507
/** Too long name or link string. */
1508
#define VERR_TAR_NAME_TOO_LONG (-947)
1260
1511
/** @name RTPoll status codes
1269
1520
#define VERR_POLL_SET_IS_FULL (-953)
1523
/** @name RTZip status codes
1525
/** Generic zip error. */
1526
#define VERR_ZIP_ERROR (-22000)
1527
/** The compressed data was corrupted. */
1528
#define VERR_ZIP_CORRUPTED (-22001)
1529
/** Ran out of memory while compressing or uncompressing. */
1530
#define VERR_ZIP_NO_MEMORY (-22002)
1531
/** The compression format version is unsupported. */
1532
#define VERR_ZIP_UNSUPPORTED_VERSION (-22003)
1533
/** The compression method is unsupported. */
1534
#define VERR_ZIP_UNSUPPORTED_METHOD (-22004)
1535
/** The compressed data started with a bad header. */
1536
#define VERR_ZIP_BAD_HEADER (-22005)
1539
/** @name RTVfs status codes
1541
/** The VFS chain specification does not have a valid prefix. */
1542
#define VERR_VFS_CHAIN_NO_PREFIX (-22100)
1543
/** The VFS chain specification is empty. */
1544
#define VERR_VFS_CHAIN_EMPTY (-22101)
1545
/** Expected an element. */
1546
#define VERR_VFS_CHAIN_EXPECTED_ELEMENT (-22102)
1547
/** The VFS object type is not known. */
1548
#define VERR_VFS_CHAIN_UNKNOWN_TYPE (-22103)
1549
/** Expected a left paranthese. */
1550
#define VERR_VFS_CHAIN_EXPECTED_LEFT_PARENTHESES (-22104)
1551
/** Expected a right paranthese. */
1552
#define VERR_VFS_CHAIN_EXPECTED_RIGHT_PARENTHESES (-22105)
1553
/** Expected a provider name. */
1554
#define VERR_VFS_CHAIN_EXPECTED_PROVIDER_NAME (-22106)
1555
/** Expected an action (> or |). */
1556
#define VERR_VFS_CHAIN_EXPECTED_ACTION (-22107)
1557
/** Only one action element is currently supported. */
1558
#define VERR_VFS_CHAIN_MULTIPLE_ACTIONS (-22108)
1559
/** Expected to find a driving action (>), but there is none. */
1560
#define VERR_VFS_CHAIN_NO_ACTION (-22109)
1561
/** Expected pipe action. */
1562
#define VERR_VFS_CHAIN_EXPECTED_PIPE (-22110)
1563
/** Unexpected action type. */
1564
#define VERR_VFS_CHAIN_UNEXPECTED_ACTION_TYPE (-22111)