Added constants and error message for dos error code 1326 (logon failure).
[sfrench/samba-autobuild/.git] / source / include / doserr.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    DOS error code constants
5    Copyright (C) Andrew Tridgell              1992-2000
6    Copyright (C) John H Terpstra              1996-2000
7    Copyright (C) Luke Kenneth Casson Leighton 1996-2000
8    Copyright (C) Paul Ashton                  1998-2000
9    
10    This program is free software; you can redistribute it and/or modify
11    it under the terms of the GNU General Public License as published by
12    the Free Software Foundation; either version 2 of the License, or
13    (at your option) any later version.
14    
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License for more details.
19    
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25 #ifndef _DOSERR_H
26 #define _DOSERR_H
27
28 /* Error classes */
29
30 #define ERRDOS 0x01 /*  Error is from the core DOS operating system set. */
31 #define ERRSRV 0x02  /* Error is generated by the server network file manager.*/
32 #define ERRHRD 0x03  /* Error is an hardware error. */
33 #define ERRCMD 0xFF  /* Command was not in the "SMB" format. */
34
35 /* SMB X/Open error codes for the ERRDOS error class */
36 #define ERRsuccess 0 /* No error */
37 #define ERRbadfunc 1 /* Invalid function (or system call) */
38 #define ERRbadfile 2 /* File not found (pathname error) */
39 #define ERRbadpath 3 /* Directory not found */
40 #define ERRnofids 4 /* Too many open files */
41 #define ERRnoaccess 5 /* Access denied */
42 #define ERRbadfid 6 /* Invalid fid */
43 #define ERRbadmcb 7 /* Memory control blocks destroyed. */
44 #define ERRnomem 8 /* Out of memory */
45 #define ERRbadmem 9 /* Invalid memory block address */
46 #define ERRbadenv 10 /* Invalid environment */
47 #define ERRbadaccess 12 /* Invalid open mode */
48 #define ERRbaddata 13 /* Invalid data (only from ioctl call) */
49 #define ERRres 14 /* reserved */
50 #define ERRbaddrive 15 /* Invalid drive */
51 #define ERRremcd 16 /* Attempt to delete current directory */
52 #define ERRdiffdevice 17 /* rename/move across different filesystems */
53 #define ERRnofiles 18 /* no more files found in file search */
54 #define ERRbadshare 32 /* Share mode on file conflict with open mode */
55 #define ERRlock 33 /* Lock request conflicts with existing lock */
56 #define ERRunsup 50 /* Request unsupported, returned by Win 95, RJS 20Jun98 */
57 #define ERRnosuchshare 67 /* You specified an invalid share name */
58 #define ERRfilexists 80 /* File in operation already exists */
59 #define ERRinvalidparam 87
60 #define ERRcannotopen 110 /* Cannot open the file specified */
61 #define ERRinsufficientbuffer 122
62 #define ERRinvalidname 123 /* Invalid name */
63 #define ERRunknownlevel 124
64 #define ERRnotlocked 158 /* This region is not locked by this locking context. */
65 #define ERRrename 183
66 #define ERRbadpipe 230 /* Named pipe invalid */
67 #define ERRpipebusy 231 /* All instances of pipe are busy */
68 #define ERRpipeclosing 232 /* named pipe close in progress */
69 #define ERRnotconnected 233 /* No process on other end of named pipe */
70 #define ERRmoredata 234 /* More data to be returned */
71 #define ERRnomoreitems 259
72 #define ERRbaddirectory 267 /* Invalid directory name in a path. */
73 #define ERReasnotsupported 282 /* Extended attributes */
74 #define ERRlogonfailure 1326 /* Unknown username or bad password */
75 #define ERRbuftoosmall 2123
76 #define ERRunknownipc 2142
77 #define ERRnosuchprintjob 2151
78
79 /* here's a special one from observing NT */
80 #define ERRnoipc 66 /* don't support ipc */
81
82 /* These errors seem to be only returned by the NT printer driver system */
83
84 #define ERRunknownprinterdriver 1797 /* ERROR_UNKNOWN_PRINTER_DRIVER */
85 #define ERRinvalidprintername 1801 /* ERROR_INVALID_PRINTER_NAME */
86 #define ERRinvaliddatatype 1804 /* ERROR_INVALID_DATATYPE */
87 #define ERRinvalidenvironment 1805 /* ERROR_INVALID_ENVIRONMENT */
88 #define ERRprinterdriverinuse 3001 /* ERROR_PRINTER_DRIVER_IN_USE */
89
90 /* Error codes for the ERRSRV class */
91
92 #define ERRerror 1 /* Non specific error code */
93 #define ERRbadpw 2 /* Bad password */
94 #define ERRbadtype 3 /* reserved */
95 #define ERRaccess 4 /* No permissions to do the requested operation */
96 #define ERRinvnid 5 /* tid invalid */
97 #define ERRinvnetname 6 /* Invalid servername */
98 #define ERRinvdevice 7 /* Invalid device */
99 #define ERRqfull 49 /* Print queue full */
100 #define ERRqtoobig 50 /* Queued item too big */
101 #define ERRinvpfid 52 /* Invalid print file in smb_fid */
102 #define ERRsmbcmd 64 /* Unrecognised command */
103 #define ERRsrverror 65 /* smb server internal error */
104 #define ERRfilespecs 67 /* fid and pathname invalid combination */
105 #define ERRbadlink 68 /* reserved */
106 #define ERRbadpermits 69 /* Access specified for a file is not valid */
107 #define ERRbadpid 70 /* reserved */
108 #define ERRsetattrmode 71 /* attribute mode invalid */
109 #define ERRpaused 81 /* Message server paused */
110 #define ERRmsgoff 82 /* Not receiving messages */
111 #define ERRnoroom 83 /* No room for message */
112 #define ERRrmuns 87 /* too many remote usernames */
113 #define ERRtimeout 88 /* operation timed out */
114 #define ERRnoresource  89 /* No resources currently available for request. */
115 #define ERRtoomanyuids 90 /* too many userids */
116 #define ERRbaduid 91 /* bad userid */
117 #define ERRuseMPX 250 /* temporarily unable to use raw mode, use MPX mode */
118 #define ERRuseSTD 251 /* temporarily unable to use raw mode, use standard mode */
119 #define ERRcontMPX 252 /* resume MPX mode */
120 #define ERRbadPW /* reserved */
121 #define ERRnosupport 0xFFFF
122 #define ERRunknownsmb 22 /* from NT 3.5 response */
123
124 /* Error codes for the ERRHRD class */
125
126 #define ERRnowrite 19 /* read only media */
127 #define ERRbadunit 20 /* Unknown device */
128 #define ERRnotready 21 /* Drive not ready */
129 #define ERRbadcmd 22 /* Unknown command */
130 #define ERRdata 23 /* Data (CRC) error */
131 #define ERRbadreq 24 /* Bad request structure length */
132 #define ERRseek 25
133 #define ERRbadmedia 26
134 #define ERRbadsector 27
135 #define ERRnopaper 28
136 #define ERRwrite 29 /* write fault */
137 #define ERRread 30 /* read fault */
138 #define ERRgeneral 31 /* General hardware failure */
139 #define ERRwrongdisk 34
140 #define ERRFCBunavail 35
141 #define ERRsharebufexc 36 /* share buffer exceeded */
142 #define ERRdiskfull 39
143
144
145 /* these are win32 error codes. There are only a few places where
146    these matter for Samba, primarily in the NT printing code */
147 #define WERR_OK W_ERROR(0)
148 #define WERR_BADFILE W_ERROR(2)
149 #define WERR_ACCESS_DENIED W_ERROR(5)
150 #define WERR_BADFID W_ERROR(6)
151 #define WERR_BADFUNC W_ERROR(1)
152 #define WERR_INSUFFICIENT_BUFFER W_ERROR(122)
153 #define WERR_NO_SUCH_SHARE W_ERROR(67)
154 #define WERR_INVALID_PARAM W_ERROR(87)
155 #define WERR_NOT_SUPPORTED W_ERROR(50)
156 #define WERR_BAD_PASSWORD W_ERROR(86)
157 #define WERR_NOMEM W_ERROR(8)
158 #define WERR_INVALID_NAME W_ERROR(123)
159 #define WERR_UNKNOWN_LEVEL W_ERROR(124)
160 #define WERR_NO_MORE_ITEMS W_ERROR(259)
161 #define WERR_MORE_DATA W_ERROR(234)
162 #define WERR_UNKNOWN_PRINTER_DRIVER W_ERROR(1797)
163 #define WERR_INVALID_PRINTER_NAME W_ERROR(1801)
164 #define WERR_INVALID_DATATYPE W_ERROR(1804)
165 #define WERR_INVALID_ENVIRONMENT W_ERROR(1805)
166 #define WERR_BUF_TOO_SMALL W_ERROR(2123)
167 #define WERR_JOB_NOT_FOUND W_ERROR(2151)
168 #define WERR_DEST_NOT_FOUND W_ERROR(2152)
169 #define WERR_PRINTER_DRIVER_IN_USE W_ERROR(3001)
170 #define WERR_STATUS_MORE_ENTRIES   W_ERROR(0x0105)
171
172 /* DFS errors */
173
174 #ifndef NERR_BASE
175 #define NERR_BASE (2100)
176 #endif
177
178 #define WERR_DFS_NO_SUCH_VOL            W_ERROR(NERR_BASE+562)
179 #define WERR_DFS_NO_SUCH_SHARE          W_ERROR(NERR_BASE+565)
180 #define WERR_DFS_NO_SUCH_SERVER         W_ERROR(NERR_BASE+573)
181 #define WERR_DFS_INTERNAL_ERROR         W_ERROR(NERR_BASE+590)
182 #define WERR_DFS_CANT_CREATE_JUNCT      W_ERROR(NERR_BASE+569)
183
184 #endif /* _DOSERR_H */