/*-
 * Copyright (c) 2000-2001 Boris Popov
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#ifndef __LWBASE_DOSERROR_H__
#define __LWBASE_DOSERROR_H__

/*
 * Error classes
 */
#define ERRSUCCESS      0x00
#define ERRDOS          0x01
#define ERRSRV          0x02
#define ERRHRD          0x03    /* Error is a hardware error. */
#define ERRCMD          0xFF    /* Command was not in the "SMB" format. */

/*
 * Error codes for the ERRDOS class
 */
#define ERRbadfunc      1       /* Invalid function */
#define ERRbadfile      2       /* File not found (last component) */
#define ERRbadpath      3       /* Directory invalid */
#define ERRnofids       4       /* Too many open files */
#define ERRnoaccess     5       /* Access denied */
#define ERRbadfid       6       /* Invalid file handle */
#define ERRbadmcb       7       /* Memory control blocks destroyed (huh ?) */
#define ERRnomem        8       /* Insufficient memory */
#define ERRbadmem       9       /* Invalid memory block address */
#define ERRbadenv       10      /* Invalid environment */
#define ERRbadformat    11      /* Invalid format */
#define ERRbadaccess    12      /* Invalid open mode */
#define ERRbaddata      13      /* Invalid data */
#define ERRbaddrive     15      /* Invalid drive specified */
#define ERRremcd        16      /* An attempt to delete current directory */
#define ERRdiffdevice   17      /* cross fs rename/move */
#define ERRnofiles      18      /* no more files found in file search */
#define ERRbadshare     32      /* Share mode can't be granted */
#define ERRlock         33      /* A lock request conflicts with existing lock */
#define ERReof          38      /* Attempt to read beyond the end of the file. */
#define ERRunsup        50      /* unsupported - Win 95 */
#define ERRnoipc        66      /* ipc unsupported */
#define ERRnosuchshare  67      /* invalid share name */
#define ERRfilexists    80      /* The file named in the request already exists */
#define ERRinvalidparam 87      /* Supplied parameter is invalid. */
#define ERRquota        112     /* W2K returns this if quota space exceeds */
#define ERRcannotopen   110     /* cannot open the file */
#define ERRinvalidname  123
#define ERRunknownlevel 124
#define ERRnotlocked    158     /* region was not locked by this context */
#define ERRrename       183
#define ERRbadpipe      230     /* named pipe invalid */
#define ERRpipebusy     231     /* all pipe instances are busy */
#define ERRpipeclosing  232     /* close in progress */
#define ERRnotconnected 233     /* nobody on other end of pipe */
#define ERRmoredata     234     /* more data to be returned */
#define ERRbaddirectory 267     /* invalid directory name */
#define ERReasunsupported   282 /* extended attributes not supported */
#define ERRunknownipc   2142
#define ERRbuftoosmall  2123
#define ERRnosuchprintjob   2151

/*
 * Error codes for the ERRSRV class
 */
#define ERRerror        1       /* Non-specific error code */
#define ERRbadpw        2       /* Bad password */
#define ERRbadtype      3       /* reserved */
#define ERRaccess       4       /* The client doesn't have enough access rights */
#define ERRinvtid       5       /* The Tid specified in a command is invalid */
#define ERRinvnetname   6       /* Invalid server name in the tree connect */
#define ERRinvdevice    7       /* Printer and not printer devices are mixed */
#define ERRqfull        49      /* Print queue full */
#define ERRqtoobig      50      /* Print queue full - no space */
#define ERRinvpfid      52      /* Invalid print file FID */
#define ERRsmbcmd       64      /* The server did not recognize the command */
#define ERRsrverror     65      /* The server encountered and internal error */
#define ERRfilespecs    67      /* The Fid and path name contains an invalid combination */
#define ERRbadpermits   69      /* Access mode invalid */
#define ERRsetattrmode  71      /* Attribute mode invalid */
#define ERRpaused       81      /* Server is paused */
#define ERRmsgoff       82      /* Not receiving messages */
#define ERRnoroom       83      /* No room to buffer message */
#define ERRrmuns        87      /* Too many remote user names */
#define ERRtimeout      88      /* Operation timed out */
#define ERRnoresource   89      /* No resources currently available for request */
#define ERRtoomanyuids  90      /* Too many UIDs active on this session */
#define ERRbaduid       91      /* The UID is not known in this session */
#define ERRusempx       250     /* Temporarily unable to support Raw, use MPX mode */
#define ERRusestd       251     /* Temporarily unable to support Raw, use standard r/w */
#define ERRcontmpx      252     /* Continue in MPX mode */
#define ERRbadPassword  254
#define ERRaccountExpired 2239
#define ERRbadClient    2240    /* Cannot access the server from this workstation */
#define ERRbadLogonTime 2241    /* Cannot access the server at this time **/
#define ERRpasswordExpired 2242
#define ERRnosupport    65535   /* Invalid function */

/*
 * Error codes for the ERRHRD class
 */
#define ERRnowrite      19      /* write protected media */
#define ERRbadunit      20      /* Unknown unit */
#define ERRnotready     21      /* Drive not ready */
#define ERRbadcmd       22      /* Unknown command */
#define ERRdata         23      /* Data error (CRC) */
#define ERRbadreq       24      /* Bad request structure length */
#define ERRseek         25      /* Seek error */
#define ERRbadmedia     26      /* Unknown media type */
#define ERRbadsector    27      /* Sector not found */
#define ERRnopaper      28      /* Printer out of paper */
#define ERRwrite        29      /* Write fault */
#define ERRread         30      /* Read fault */
#define ERRgeneral      31      /* General failure */
#define ERRbadshare     32      /* An open conflicts with an existing open */
#define ERRlock         33      /* lock/unlock conflict */
#define ERRwrongdisk    34      /* The wrong disk was found in a drive */
#define ERRFCBunavail   35      /* No FCBs available */
#define ERRsharebufexc  36      /* A sharing buffer has been exceeded */
#define ERRdiskfull     39

#endif /* __LWBASE_DOSERROR_H__*/
