// Error codes

#define E_Success                  0     // Success status
#define E_Failure                  1      // Failure status

#define E_AspiInit                -1    // ASPI manager initialization error
#define E_AspiAbort                -2    // ASPI request was aborted by host
#define E_AspiAbortFail            -3    // ASPI request was aborted by host
#define E_AspiInvalidRequest      -4    // Invalid ASPI request
#define E_AspiInvalidAdapter      -5    // Invalid host adapter number
#define E_AspiNoDevice            -6    // Device is not installed
#define E_AspiInvalidSRB          -7    // Invalid SRB
#define E_AspiBufferAlign          -8    // Bad buffer alignment
#define E_AspiIllegalMode          -9    // Illegal mode (Win32S)
#define E_AspiNoHelperDriver      -10    // No ASPI helper driver
#define E_AspiFailedInit          -11    // General initialization failure
#define E_AspiBusy                -12   // ASPI manager is busy
#define E_AspiBufferTooBig        -13    // Buffer is too big
#define E_AspiMismatchedComp      -14    // Mismatched components
#define E_AspiNoAdapters          -15    // No host adapters on system
#define E_AspiNoResources          -16    // Insufficient resources
#define E_AspiUnknown              -17    // Unknown ASPI error
#define E_AspiTimeout              -18    // ASPI request timed out
#define E_AspiRequestFailed        -19    // ASPI request failed to complete normally

#define E_AdapterTimeout          -20    // Transaction timeout
#define E_AdapterExpired          -21    // SRB expired
#define E_AdapterMessageReject    -22    // Message reject
#define E_AdapterBusReset          -23    // Bus reset was detected
#define E_AdapterParityError      -24    // Parity error was detected
#define E_AdapterSenseFailed      -25    // Auto request sense failed
#define E_AdapterSelectTimeout    -26    // Selection timeout
#define E_AdapterDataOverrun      -27    // Data overrun/underrun
#define E_AdapterBusFree          -28    // Unexpected bus free
#define E_AdapterBusFailure        -29    // Target bus phase sequence failure
#define E_AdapterUnknown          -30    // Unexpected adapter error

#define E_TargetBusy              -31   // Target is busy
#define E_TargetConflict          -32    // Target reservation conflict
#define E_TargetUnknown            -33    // Unexpected target error

#define E_Recovered                -34   // Recovered error
#define E_DeviceNotReady          -35   // Device is not ready
#define E_BadMedium                -36   // Bad Medium
#define E_Hardware                -37   // Non-recoverable hardware error
#define E_IllegalRequest          -38   // Illegal Request
#define E_UnitAttention            -39   // Unit Attention
#define E_BlankCheck              -40   // Encountered non-blank data
#define E_DeviceBusy              -41   // Device is busy
#define E_TargetAbort              -42   // Target aborted the command
#define E_VolumeOverflow          -43   // Volume overflow
#define E_EndOfMedium              -44   // End-of-Medium detected
#define E_SenseUnknown            -45    // Unexpected sense error

#define E_UserAbort                -100  // User aborted operation
#define E_Generic                  -101  // Generic error message text
#define E_BugCheck                -102  // Internal bugcheck error
#define E_NoMemory                -103  // Memory allocation error
#define E_NotImplemented          -104  // Feature is not implemented yet
#define E_CommandFailed            -105  // SCSI command failed
#define E_ReadAudio                -106  // Read audio error
#define E_ReadData                -107  // Read data error
#define E_OpenFile                -108  // File open error
#define E_CreateFile              -109  // File create error
#define E_ReadFile                -110  // File read error
#define E_WriteFile                -111  // File write error
#define E_EndOfFile                -112  // End-of-file error
#define E_FindLastSector          -113  // Unable to find last sector
#define E_ParseCueSheet            -114  // Cue Sheet parsing error
#define E_BadWaveFile              -115  // Illegal WAVE file format
#define E_BadAiffFile              -116  // Illegal AIFF file format
#define E_JitterFailure            -117  // Jitter correction failure
#define E_AnalyzeDisc              -118  // Analyze disc error
#define  E_NoMultisession          -119  // Disc contains more than one session
#define E_DataAfterAudio          -120  // Disc contains a DATA track after the AUDIO tracks
#define E_BothModes                -121  // Disc contains both MODE1 and MODE2 data tracks
#define E_BadTrackType            -122  // Illegal track type encountered
#define E_DiscTooLong              -123  // Disc is too long (warning)
#define E_DirTooDeep              -124  // Directory depth exceeds 8 levels
#define E_TooManyFiles            -125  // Too many files in directory
#define E_TooManyDirs              -126  // Too many directories to process
#define E_BadPathname              -127  // Invalid directory name specified
#define E_NoFilesInPath            -128  // Directory does not exist or no files match selection
#define E_MaxFileSort              -129  // Too many file/directories to sort
#define E_IsoTooLong              -130  // ISO9660 image is too large
#define E_BadFileLength            -131  // File length is not a multiple of the sector size
#define E_BadBootFile              -132  // Boot image file length is bad
#define E_NoSpaces                -133  // Spaces are not allowed in image directory/file name!
#define E_NoCacheMemory            -134  // Not enough memory available for cache
#define E_CreateFileCache          -135  // Unexpected failure creating file cache
#define E_CreateDiscCache          -136  // Unexpected failure creating disc cache
#define E_CreateTreeCache          -137  // Unexpected failure creating directory tree cache
#define E_ReadFileCache            -138  // Unexpected failure reading file cache
#define E_ReadDiscCache            -139  // Unexpected failure reading disc cache
#define E_ReadTreeCache            -140  // Unexpected failure reading directory tree cache
#define E_CacheTimeout            -141  // Read request timeout encountered (cache is empty)
#define E_CacheReadError          -142  // File/Disc read error encountered
#define E_CacheEndOfData          -143  // End-of-data encountered (not enough data in cache)
#define E_VerifyData              -144  // Data verification failure at sectors %lu to %lu
#define E_ProgramAbort            -145  // Program aborted - Internal bugcheck detected
#define E_BadBlockLength          -147  // Bugcheck - Invalid block length specified
#define E_BadDataType              -148  // Bugcheck - Invalid datatype specified

#define E_BadKeyMatch              -200  // Bad primary/secondary key match
#define E_BadUnlockInfo            -201  // Bad unlock strings and/or keys
#define E_BadAuthData              -202  // Bad authorization file data
#define E_ExpiredKey              -203  // Unlock keys have expired
#define E_InitControlFile          -204  // Unable to initialize control file
#define E_UpdateControlFile        -205  // Unable to update control file
#define E_SoftwareLocked          -206  // Software is locked and has no demo mode
#define E_NoDiscAtOnce            -207  // Recorder does not support DAO recording
#define E_NoTransporter            -208  // No disc transporter was found on the SCSI bus

#define E_DiscNotWritable          -300  // Disc is not writable
#define E_SetBlockLength          -301  // Unable to set block length
#define E_ReadDiscInfo            -302  // Unable to read disc information
#define E_ReadTrackInfo            -303  // Unable to read track information
#define E_NextWritableAddress      -304  // Unable to determine next writable address
#define E_SetWriteMode            -305  // Unable to set writing mode
#define E_SetTrackParameters      -306  // Unable to set track-at-once parameters
#define E_SetDiscParameters        -307  // Unable to set disc-at-once parameters
#define E_SetRecordSpeed          -308  // Unable to set recording speed
#define E_FlushCache              -309  // Unable to flush CD recorder cache to disc
#define E_SetCatalogNumber        -310  // Unable to set media catalog number
#define E_LaserCalibration        -311  // Unable to calibrate recording laser
#define E_CueSheetRejected        -312  // Cuesheet is invalid for the specified CD recorder
