r23792: convert Samba4 to GPLv3
[abartlet/samba.git/.git] / source4 / libcli / util / doserr.h
1 /* 
2    Unix SMB/CIFS implementation.
3    DOS error code constants
4    Copyright (C) Andrew Tridgell              1992-2000
5    Copyright (C) John H Terpstra              1996-2000
6    Copyright (C) Luke Kenneth Casson Leighton 1996-2000
7    Copyright (C) Paul Ashton                  1998-2000
8    
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 3 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program.  If not, see <http://www.gnu.org/licenses/>.
21 */
22
23 #ifndef _DOSERR_H
24 #define _DOSERR_H
25
26 /* Error classes */
27
28 #define ERRDOS 0x01 /*  Error is from the core DOS operating system set. */
29 #define ERRSRV 0x02  /* Error is generated by the server network file manager.*/
30 #define ERRHRD 0x03  /* Error is an hardware error. */
31 #define ERRCMD 0xFF  /* Command was not in the "SMB" format. */
32
33 /* SMB X/Open error codes for the ERRDOS error class */
34 #define ERRsuccess 0 /* No error */
35 #define ERRbadfunc 1 /* Invalid function (or system call) */
36 #define ERRbadfile 2 /* File not found (pathname error) */
37 #define ERRbadpath 3 /* Directory not found */
38 #define ERRnofids 4 /* Too many open files */
39 #define ERRnoaccess 5 /* Access denied */
40 #define ERRbadfid 6 /* Invalid fid */
41 #define ERRbadmcb 7 /* Memory control blocks destroyed. */
42 #define ERRnomem 8 /* Out of memory */
43 #define ERRbadmem 9 /* Invalid memory block address */
44 #define ERRbadenv 10 /* Invalid environment */
45 #define ERRbadaccess 12 /* Invalid open mode */
46 #define ERRbaddata 13 /* Invalid data (only from ioctl call) */
47 #define ERRres 14 /* reserved */
48 #define ERRbaddrive 15 /* Invalid drive */
49 #define ERRremcd 16 /* Attempt to delete current directory */
50 #define ERRdiffdevice 17 /* rename/move across different filesystems */
51 #define ERRnofiles 18 /* no more files found in file search */
52 #define ERRgeneral 31 /* General failure */
53 #define ERRbadshare 32 /* Share mode on file conflict with open mode */
54 #define ERRlock 33 /* Lock request conflicts with existing lock */
55 #define ERRunsup 50 /* Request unsupported, returned by Win 95, RJS 20Jun98 */
56 #define ERRnetnamedel 64 /* Network name deleted or not available */
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 ERRinvalidpath 161
66 #define ERRcancelviolation 173
67 #define ERRnoatomiclocks 174
68 #define ERRrename 183
69 #define ERRbadpipe 230 /* Named pipe invalid */
70 #define ERRpipebusy 231 /* All instances of pipe are busy */
71 #define ERRpipeclosing 232 /* named pipe close in progress */
72 #define ERRnotconnected 233 /* No process on other end of named pipe */
73 #define ERRmoredata 234 /* More data to be returned */
74 #define ERReainconsistent 255 /* from EMC */
75 #define ERRnomoreitems 259
76 #define ERRbaddirectory 267 /* Invalid directory name in a path. */
77 #define ERReasnotsupported 282 /* Extended attributes */
78 #define ERRlogonfailure 1326 /* Unknown username or bad password */
79 #define ERRbuftoosmall 2123
80 #define ERRunknownipc 2142
81 #define ERRnosuchprintjob 2151
82 #define ERRinvgroup 2455
83
84 /* here's a special one from observing NT */
85 #define ERRnoipc 66 /* don't support ipc */
86
87 /* These errors seem to be only returned by the NT printer driver system */
88 #define ERRdriveralreadyinstalled 1795 /* ERROR_PRINTER_DRIVER_ALREADY_INSTALLED */
89 #define ERRunknownprinterport 1796 /* ERROR_UNKNOWN_PORT */
90 #define ERRunknownprinterdriver 1797 /* ERROR_UNKNOWN_PRINTER_DRIVER */
91 #define ERRunknownprintprocessor 1798 /* ERROR_UNKNOWN_PRINTPROCESSOR */
92 #define ERRinvalidseparatorfile 1799 /* ERROR_INVALID_SEPARATOR_FILE */
93 #define ERRinvalidjobpriority 1800 /* ERROR_INVALID_PRIORITY */
94 #define ERRinvalidprintername 1801 /* ERROR_INVALID_PRINTER_NAME */
95 #define ERRprinteralreadyexists 1802 /* ERROR_PRINTER_ALREADY_EXISTS */
96 #define ERRinvalidprintercommand 1803 /* ERROR_INVALID_PRINTER_COMMAND */
97 #define ERRinvaliddatatype 1804 /* ERROR_INVALID_DATATYPE */
98 #define ERRinvalidenvironment 1805 /* ERROR_INVALID_ENVIRONMENT */
99
100 #define ERRunknownprintmonitor 3000 /* ERROR_UNKNOWN_PRINT_MONITOR */
101 #define ERRprinterdriverinuse 3001 /* ERROR_PRINTER_DRIVER_IN_USE */
102 #define ERRspoolfilenotfound 3002 /* ERROR_SPOOL_FILE_NOT_FOUND */
103 #define ERRnostartdoc 3003 /* ERROR_SPL_NO_STARTDOC */
104 #define ERRnoaddjob 3004 /* ERROR_SPL_NO_ADDJOB */
105 #define ERRprintprocessoralreadyinstalled 3005 /* ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED */
106 #define ERRprintmonitoralreadyinstalled 3006 /* ERROR_PRINT_MONITOR_ALREADY_INSTALLED */
107 #define ERRinvalidprintmonitor 3007 /* ERROR_INVALID_PRINT_MONITOR */
108 #define ERRprintmonitorinuse 3008 /* ERROR_PRINT_MONITOR_IN_USE */
109 #define ERRprinterhasjobsqueued 3009 /* ERROR_PRINTER_HAS_JOBS_QUEUED */
110
111 /* Error codes for the ERRSRV class */
112
113 #define ERRerror 1 /* Non specific error code */
114 #define ERRbadpw 2 /* Bad password */
115 #define ERRbadtype 3 /* reserved */
116 #define ERRaccess 4 /* No permissions to do the requested operation */
117 #define ERRinvnid 5 /* tid invalid */
118 #define ERRinvnetname 6 /* Invalid servername */
119 #define ERRinvdevice 7 /* Invalid device */
120 #define ERRqfull 49 /* Print queue full */
121 #define ERRqtoobig 50 /* Queued item too big */
122 #define ERRinvpfid 52 /* Invalid print file in smb_fid */
123 #define ERRsmbcmd 64 /* Unrecognised command */
124 #define ERRsrverror 65 /* smb server internal error */
125 #define ERRfilespecs 67 /* fid and pathname invalid combination */
126 #define ERRbadlink 68 /* reserved */
127 #define ERRbadpermits 69 /* Access specified for a file is not valid */
128 #define ERRbadpid 70 /* reserved */
129 #define ERRsetattrmode 71 /* attribute mode invalid */
130 #define ERRpaused 81 /* Message server paused */
131 #define ERRmsgoff 82 /* Not receiving messages */
132 #define ERRnoroom 83 /* No room for message */
133 #define ERRrmuns 87 /* too many remote usernames */
134 #define ERRtimeout 88 /* operation timed out */
135 #define ERRnoresource  89 /* No resources currently available for request. */
136 #define ERRtoomanyuids 90 /* too many userids */
137 #define ERRbaduid 91 /* bad userid */
138 #define ERRuseMPX 250 /* temporarily unable to use raw mode, use MPX mode */
139 #define ERRuseSTD 251 /* temporarily unable to use raw mode, use standard mode */
140 #define ERRcontMPX 252 /* resume MPX mode */
141 #define ERRnosupport 0xFFFF
142 #define ERRunknownsmb 22 /* from NT 3.5 response */
143
144 /* Error codes for the ERRHRD class */
145
146 #define ERRnowrite 19 /* read only media */
147 #define ERRbadunit 20 /* Unknown device */
148 #define ERRnotready 21 /* Drive not ready */
149 #define ERRbadcmd 22 /* Unknown command */
150 #define ERRdata 23 /* Data (CRC) error */
151 #define ERRbadreq 24 /* Bad request structure length */
152 #define ERRseek 25
153 #define ERRbadmedia 26
154 #define ERRbadsector 27
155 #define ERRnopaper 28
156 #define ERRwrite 29 /* write fault */
157 #define ERRread 30 /* read fault */
158 #define ERRgeneral 31 /* General hardware failure */
159 #define ERRwrongdisk 34
160 #define ERRFCBunavail 35
161 #define ERRsharebufexc 36 /* share buffer exceeded */
162 #define ERRdiskfull 39
163
164
165 /* these are win32 error codes. There are only a few places where
166    these matter for Samba, primarily in the NT printing code */
167 #define WERR_OK W_ERROR(0)
168 #define WERR_BADFUNC W_ERROR(1)
169 #define WERR_BADFILE W_ERROR(2)
170 #define WERR_ACCESS_DENIED W_ERROR(5)
171 #define WERR_BADFID W_ERROR(6)
172 #define WERR_NOMEM W_ERROR(8)
173 #define WERR_GENERAL_FAILURE W_ERROR(31)
174 #define WERR_NOT_SUPPORTED W_ERROR(50)
175 #define WERR_BAD_NETPATH W_ERROR(53)
176 #define WERR_BAD_NET_RESP W_ERROR(58)
177 #define WERR_UNEXP_NET_ERR W_ERROR(59)
178 #define WERR_PRINTQ_FULL W_ERROR(61)
179 #define WERR_NO_SPOOL_SPACE W_ERROR(62)
180 #define WERR_NO_SUCH_SHARE W_ERROR(67)
181 #define WERR_FILE_EXISTS W_ERROR(80)
182 #define WERR_BAD_PASSWORD W_ERROR(86)
183 #define WERR_INVALID_PARAM W_ERROR(87)
184 #define WERR_INSUFFICIENT_BUFFER W_ERROR(122)
185 #define WERR_INVALID_NAME W_ERROR(123)
186 #define WERR_UNKNOWN_LEVEL W_ERROR(124)
187 #define WERR_OBJECT_PATH_INVALID W_ERROR(161)
188 #define WERR_ALREADY_EXISTS W_ERROR(183)
189 #define WERR_NO_MORE_ITEMS W_ERROR(259)
190 #define WERR_MORE_DATA W_ERROR(234)
191 #define WERR_CAN_NOT_COMPLETE W_ERROR(1003)
192 #define WERR_NOT_FOUND W_ERROR(1168)
193 #define WERR_INVALID_COMPUTERNAME W_ERROR(1210)
194 #define WERR_INVALID_DOMAINNAME W_ERROR(1212)
195 #define WERR_UNKNOWN_REVISION W_ERROR(1305)
196 #define WERR_REVISION_MISMATCH W_ERROR(1306)
197 #define WERR_INVALID_OWNER W_ERROR(1307)
198 #define WERR_NO_LOGON_SERVERS W_ERROR(1311)
199 #define WERR_NO_SUCH_PRIVILEGE W_ERROR(1313)
200 #define WERR_PRIVILEGE_NOT_HELD W_ERROR(1314)
201 #define WERR_NO_SUCH_USER W_ERROR(1317)
202 #define WERR_LOGON_FAILURE W_ERROR(1326)
203 #define WERR_INVALID_SECURITY_DESCRIPTOR W_ERROR(1338)
204 #define WERR_NO_SUCH_DOMAIN W_ERROR(1355)
205 #define WERR_NO_SYSTEM_RESOURCES W_ERROR(1450)
206 #define WERR_SERVER_UNAVAILABLE W_ERROR(1722)
207 #define WERR_INVALID_FORM_NAME W_ERROR(1902)
208 #define WERR_INVALID_FORM_SIZE W_ERROR(1903)
209 #define WERR_ALREADY_SHARED W_ERROR(2118)
210 #define WERR_BUF_TOO_SMALL W_ERROR(2123)
211 #define WERR_JOB_NOT_FOUND W_ERROR(2151)
212 #define WERR_DEST_NOT_FOUND W_ERROR(2152)
213 #define WERR_SESSION_NOT_FOUND W_ERROR(2312)
214 #define WERR_FID_NOT_FOUND W_ERROR(2314)
215 #define WERR_NOT_LOCAL_DOMAIN W_ERROR(2320)
216 #define WERR_DOMAIN_CONTROLLER_NOT_FOUND W_ERROR(2453)
217 #define WERR_DEVICE_NOT_AVAILABLE W_ERROR(4319)
218 #define WERR_STATUS_MORE_ENTRIES   W_ERROR(0x0105)
219
220 #define WERR_PRINTER_DRIVER_ALREADY_INSTALLED W_ERROR(ERRdriveralreadyinstalled)
221 #define WERR_UNKNOWN_PORT W_ERROR(ERRunknownprinterport)
222 #define WERR_UNKNOWN_PRINTER_DRIVER W_ERROR(ERRunknownprinterdriver)
223 #define WERR_UNKNOWN_PRINTPROCESSOR W_ERROR(ERRunknownprintprocessor)
224 #define WERR_INVALID_SEPARATOR_FILE W_ERROR(ERRinvalidseparatorfile)
225 #define WERR_INVALID_PRIORITY W_ERROR(ERRinvalidjobpriority)
226 #define WERR_INVALID_PRINTER_NAME W_ERROR(ERRinvalidprintername)
227 #define WERR_PRINTER_ALREADY_EXISTS W_ERROR(ERRprinteralreadyexists)
228 #define WERR_INVALID_PRINTER_COMMAND W_ERROR(ERRinvalidprintercommand)
229 #define WERR_INVALID_DATATYPE W_ERROR(ERRinvaliddatatype)
230 #define WERR_INVALID_ENVIRONMENT W_ERROR(ERRinvalidenvironment)
231
232 #define WERR_UNKNOWN_PRINT_MONITOR W_ERROR(ERRunknownprintmonitor)
233 #define WERR_PRINTER_DRIVER_IN_USE W_ERROR(ERRprinterdriverinuse)
234 #define WERR_SPOOL_FILE_NOT_FOUND W_ERROR(ERRspoolfilenotfound)
235 #define WERR_SPL_NO_STARTDOC W_ERROR(ERRnostartdoc)
236 #define WERR_SPL_NO_ADDJOB W_ERROR(ERRnoaddjob)
237 #define WERR_PRINT_PROCESSOR_ALREADY_INSTALLED W_ERROR(ERRprintprocessoralreadyinstalled)
238 #define WERR_PRINT_MONITOR_ALREADY_INSTALLED W_ERROR(ERRprintmonitoralreadyinstalled)
239 #define WERR_INVALID_PRINT_MONITOR W_ERROR(ERRinvalidprintmonitor)
240 #define WERR_PRINT_MONITOR_IN_USE W_ERROR(ERRprintmonitorinuse)
241 #define WERR_PRINTER_HAS_JOBS_QUEUED W_ERROR(ERRprinterhasjobsqueued)
242
243 #define WERR_CLASS_NOT_REGISTERED W_ERROR(0x40154)
244 #define WERR_NO_SHUTDOWN_IN_PROGRESS W_ERROR(0x45c)
245 #define WERR_SHUTDOWN_ALREADY_IN_PROGRESS W_ERROR(0x45b)
246
247
248 #ifndef NERR_BASE
249 #define NERR_BASE (2100)
250 #endif
251
252 #define WERR_NET_NAME_NOT_FOUND         W_ERROR(NERR_BASE+210)
253 #define WERR_DEVICE_NOT_SHARED          W_ERROR(NERR_BASE+211)
254
255 /* DFS errors */
256 #define WERR_DFS_NO_SUCH_VOL            W_ERROR(NERR_BASE+562)
257 #define WERR_DFS_NO_SUCH_SHARE          W_ERROR(NERR_BASE+565)
258 #define WERR_DFS_NO_SUCH_SERVER         W_ERROR(NERR_BASE+573)
259 #define WERR_DFS_INTERNAL_ERROR         W_ERROR(NERR_BASE+590)
260 #define WERR_DFS_CANT_CREATE_JUNCT      W_ERROR(NERR_BASE+569)
261
262 /* DS errors */
263 #define WERR_DS_SERVICE_BUSY W_ERROR(0x0000200e)
264 #define WERR_DS_SERVICE_UNAVAILABLE W_ERROR(0x0000200f)
265 #define WERR_DS_NO_SUCH_OBJECT W_ERROR(0x00002030)
266 #define WERR_DS_OBJ_NOT_FOUND W_ERROR(0x0000208d)
267 #define WERR_DS_SCHEMA_NOT_LOADED W_ERROR(0x20de)
268 #define WERR_DS_SCHEMA_ALLOC_FAILED W_ERROR(0x20df)
269 #define WERR_DS_ATT_SCHEMA_REQ_SYNTAX W_ERROR(0x000020e0)
270 #define WERR_DS_DRA_SCHEMA_MISMATCH W_ERROR(0x000020e2)
271 #define WERR_DS_DRA_INVALID_PARAMETER W_ERROR(0x000020f5)
272 #define WERR_DS_DRA_BAD_DN W_ERROR(0x000020f7)
273 #define WERR_DS_DRA_BAD_NC W_ERROR(0x000020f8)
274 #define WERR_DS_DRA_INTERNAL_ERROR W_ERROR(0x000020fa)
275 #define WERR_DS_DRA_OUT_OF_MEM W_ERROR(0x000020fe)
276 #define WERR_DS_SINGLE_VALUE_CONSTRAINT W_ERROR(0x00002081)
277 #define WERR_DS_DRA_DB_ERROR W_ERROR(0x00002103)
278 #define WERR_DS_DRA_NO_REPLICA W_ERROR(0x00002104)
279 #define WERR_DS_DRA_ACCESS_DENIED W_ERROR(0x00002105)
280 #define WERR_DS_DNS_LOOKUP_FAILURE W_ERROR(0x0000214c)
281 #define WERR_DS_WRONG_LINKED_ATTRIBUTE_SYNTAX W_ERROR(0x00002150)
282 #define WERR_DS_NO_MSDS_INTID W_ERROR(0x00002194)
283 #define WERR_DS_DUP_MSDS_INTID W_ERROR(0x00002195)
284
285 /* SEC errors */
286 #define WERR_SEC_E_ENCRYPT_FAILURE      W_ERROR(0x80090329)
287 #define WERR_SEC_E_DECRYPT_FAILURE      W_ERROR(0x80090330)
288 #define WERR_SEC_E_ALGORITHM_MISMATCH   W_ERROR(0x80090331)
289
290 #define WERR_FOOBAR WERR_GENERAL_FAILURE
291
292 #endif /* _DOSERR_H */