xref: /titanic_53/usr/src/uts/common/netsmb/smb.h (revision 4bff34e37def8a90f9194d81bc345c52ba20086a)
1*4bff34e3Sthurlow /*
2*4bff34e3Sthurlow  * Copyright (c) 2000-2001 Boris Popov
3*4bff34e3Sthurlow  * All rights reserved.
4*4bff34e3Sthurlow  *
5*4bff34e3Sthurlow  * Now many of these defines are from samba4 code, by Andrew Tridgell.
6*4bff34e3Sthurlow  * (Permission given to Conrad Minshall at CIFS plugfest Aug 13 2003.)
7*4bff34e3Sthurlow  * (Note the main decision was whether to use defines found in MS includes
8*4bff34e3Sthurlow  * and web pages, versus Samba, and the deciding factor is which developers
9*4bff34e3Sthurlow  * are more likely to be looking at this code base.)
10*4bff34e3Sthurlow  *
11*4bff34e3Sthurlow  * Redistribution and use in source and binary forms, with or without
12*4bff34e3Sthurlow  * modification, are permitted provided that the following conditions
13*4bff34e3Sthurlow  * are met:
14*4bff34e3Sthurlow  * 1. Redistributions of source code must retain the above copyright
15*4bff34e3Sthurlow  *    notice, this list of conditions and the following disclaimer.
16*4bff34e3Sthurlow  * 2. Redistributions in binary form must reproduce the above copyright
17*4bff34e3Sthurlow  *    notice, this list of conditions and the following disclaimer in the
18*4bff34e3Sthurlow  *    documentation and/or other materials provided with the distribution.
19*4bff34e3Sthurlow  * 3. All advertising materials mentioning features or use of this software
20*4bff34e3Sthurlow  *    must display the following acknowledgement:
21*4bff34e3Sthurlow  *    This product includes software developed by Boris Popov.
22*4bff34e3Sthurlow  * 4. Neither the name of the author nor the names of any co-contributors
23*4bff34e3Sthurlow  *    may be used to endorse or promote products derived from this software
24*4bff34e3Sthurlow  *    without specific prior written permission.
25*4bff34e3Sthurlow  *
26*4bff34e3Sthurlow  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
27*4bff34e3Sthurlow  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28*4bff34e3Sthurlow  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29*4bff34e3Sthurlow  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
30*4bff34e3Sthurlow  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31*4bff34e3Sthurlow  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32*4bff34e3Sthurlow  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33*4bff34e3Sthurlow  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34*4bff34e3Sthurlow  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35*4bff34e3Sthurlow  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36*4bff34e3Sthurlow  * SUCH DAMAGE.
37*4bff34e3Sthurlow  *
38*4bff34e3Sthurlow  * $Id: smb.h,v 1.36.90.1 2005/05/27 02:35:29 lindak Exp $
39*4bff34e3Sthurlow  */
40*4bff34e3Sthurlow 
41*4bff34e3Sthurlow /*
42*4bff34e3Sthurlow  * Common definintions and structures for SMB/CIFS protocol
43*4bff34e3Sthurlow  */
44*4bff34e3Sthurlow 
45*4bff34e3Sthurlow #ifndef _NETSMB_SMB_H_
46*4bff34e3Sthurlow #define	_NETSMB_SMB_H_
47*4bff34e3Sthurlow 
48*4bff34e3Sthurlow #pragma ident	"%Z%%M%	%I%	%E% SMI"
49*4bff34e3Sthurlow 
50*4bff34e3Sthurlow /*
51*4bff34e3Sthurlow  * This file should be purely SMB protocol definition stuff.
52*4bff34e3Sthurlow  * (Please don't make it a catch-all:)
53*4bff34e3Sthurlow  */
54*4bff34e3Sthurlow 
55*4bff34e3Sthurlow /*
56*4bff34e3Sthurlow  * SMB dialects that we have to deal with.
57*4bff34e3Sthurlow  */
58*4bff34e3Sthurlow enum smb_dialects {
59*4bff34e3Sthurlow 	SMB_DIALECT_NONE,
60*4bff34e3Sthurlow 	SMB_DIALECT_CORE,		/* PC NETWORK PROGRAM 1.0, PCLAN1.0 */
61*4bff34e3Sthurlow 	SMB_DIALECT_COREPLUS,		/* MICROSOFT NETWORKS 1.03 */
62*4bff34e3Sthurlow 	SMB_DIALECT_LANMAN1_0,		/* MICROSOFT NETWORKS 3.0, LANMAN1.0 */
63*4bff34e3Sthurlow 	SMB_DIALECT_LANMAN2_0,		/* LM1.2X002, DOS LM1.2X002, Samba */
64*4bff34e3Sthurlow 	SMB_DIALECT_LANMAN2_1,		/* DOS LANMAN2.1, LANMAN2.1 */
65*4bff34e3Sthurlow 	SMB_DIALECT_NTLM0_12		/* NT LM 0.12, Windows for Workgroups */
66*4bff34e3Sthurlow 					/* 3.1a, * NT LANMAN 1.0 */
67*4bff34e3Sthurlow };
68*4bff34e3Sthurlow 
69*4bff34e3Sthurlow /*
70*4bff34e3Sthurlow  * Formats of data/string buffers
71*4bff34e3Sthurlow  */
72*4bff34e3Sthurlow #define	SMB_DT_DATA		1
73*4bff34e3Sthurlow #define	SMB_DT_DIALECT		2
74*4bff34e3Sthurlow #define	SMB_DT_PATHNAME		3
75*4bff34e3Sthurlow #define	SMB_DT_ASCII		4
76*4bff34e3Sthurlow #define	SMB_DT_VARIABLE		5
77*4bff34e3Sthurlow 
78*4bff34e3Sthurlow /*
79*4bff34e3Sthurlow  * SMB header
80*4bff34e3Sthurlow  */
81*4bff34e3Sthurlow #define	SMB_SIGNATURE		"\xFFSMB"
82*4bff34e3Sthurlow #define	SMB_SIGLEN		4
83*4bff34e3Sthurlow #define	SMB_HDRCMD(p)		(*((uchar_t *)(p) + SMB_SIGLEN))
84*4bff34e3Sthurlow #define	SMB_HDRMID(p)		(letohs(*(ushort_t *)((uchar_t *)(p) + 30)))
85*4bff34e3Sthurlow #define	SMB_HDRLEN		32
86*4bff34e3Sthurlow /*
87*4bff34e3Sthurlow  * bits in the smb_flags field
88*4bff34e3Sthurlow  */
89*4bff34e3Sthurlow #define	SMB_FLAGS_SUPPORT_LOCKREAD	0x01
90*4bff34e3Sthurlow #define	SMB_FLAGS_CLIENT_BUF_AVAIL	0x02
91*4bff34e3Sthurlow #define	SMB_FLAGS_CASELESS		0x08
92*4bff34e3Sthurlow #define	SMB_FLAGS_CANONICAL_PATHNAMES	0x10
93*4bff34e3Sthurlow #define	SMB_FLAGS_REQUEST_OPLOCK	0x20
94*4bff34e3Sthurlow #define	SMB_FLAGS_REQUEST_BATCH_OPLOCK	0x40
95*4bff34e3Sthurlow #define	SMB_FLAGS_SERVER_RESP		0x80
96*4bff34e3Sthurlow 
97*4bff34e3Sthurlow /*
98*4bff34e3Sthurlow  * bits in the smb_flags2 field
99*4bff34e3Sthurlow  */
100*4bff34e3Sthurlow #define	SMB_FLAGS2_KNOWS_LONG_NAMES	0x0001
101*4bff34e3Sthurlow #define	SMB_FLAGS2_KNOWS_EAS		0x0002	/* client know about EAs */
102*4bff34e3Sthurlow #define	SMB_FLAGS2_SECURITY_SIGNATURE	0x0004	/* check SMB integrity */
103*4bff34e3Sthurlow #define	SMB_FLAGS2_IS_LONG_NAME		0x0040	/* any path name is long name */
104*4bff34e3Sthurlow #define	SMB_FLAGS2_EXT_SEC		0x0800	/* client aware of Extended */
105*4bff34e3Sthurlow 						/* Security negotiation */
106*4bff34e3Sthurlow #define	SMB_FLAGS2_DFS			0x1000	/* resolve paths in DFS */
107*4bff34e3Sthurlow #define	SMB_FLAGS2_PAGING_IO		0x2000	/* for exec */
108*4bff34e3Sthurlow #define	SMB_FLAGS2_ERR_STATUS		0x4000	/* 1 - status.status */
109*4bff34e3Sthurlow #define	SMB_FLAGS2_UNICODE		0x8000	/* use Unicode for strings */
110*4bff34e3Sthurlow 
111*4bff34e3Sthurlow #define	SMB_UID_UNKNOWN		0xffff
112*4bff34e3Sthurlow #define	SMB_TID_UNKNOWN		0xffff
113*4bff34e3Sthurlow #define	SMB_FID_UNUSED		0xffff
114*4bff34e3Sthurlow 
115*4bff34e3Sthurlow /*
116*4bff34e3Sthurlow  * Security mode bits
117*4bff34e3Sthurlow  */
118*4bff34e3Sthurlow #define	SMB_SM_USER		0x01	/* server in the user security mode */
119*4bff34e3Sthurlow #define	SMB_SM_ENCRYPT		0x02	/* use challenge/responce */
120*4bff34e3Sthurlow #define	SMB_SM_SIGS		0x04
121*4bff34e3Sthurlow #define	SMB_SM_SIGS_REQUIRE	0x08
122*4bff34e3Sthurlow 
123*4bff34e3Sthurlow /*
124*4bff34e3Sthurlow  * Action bits in session setup reply
125*4bff34e3Sthurlow  */
126*4bff34e3Sthurlow #define	SMB_ACT_GUEST		0x01
127*4bff34e3Sthurlow 
128*4bff34e3Sthurlow /*
129*4bff34e3Sthurlow  * NTLM capabilities
130*4bff34e3Sthurlow  */
131*4bff34e3Sthurlow #define	SMB_CAP_RAW_MODE		0x0001
132*4bff34e3Sthurlow #define	SMB_CAP_MPX_MODE		0x0002
133*4bff34e3Sthurlow #define	SMB_CAP_UNICODE			0x0004
134*4bff34e3Sthurlow #define	SMB_CAP_LARGE_FILES		0x0008	/* 64 bit offsets supported */
135*4bff34e3Sthurlow #define	SMB_CAP_NT_SMBS			0x0010
136*4bff34e3Sthurlow #define	SMB_CAP_RPC_REMOTE_APIS		0x0020
137*4bff34e3Sthurlow #define	SMB_CAP_STATUS32		0x0040
138*4bff34e3Sthurlow #define	SMB_CAP_LEVEL_II_OPLOCKS	0x0080
139*4bff34e3Sthurlow #define	SMB_CAP_LOCK_AND_READ		0x0100
140*4bff34e3Sthurlow #define	SMB_CAP_NT_FIND			0x0200
141*4bff34e3Sthurlow #define	SMB_CAP_DFS			0x1000
142*4bff34e3Sthurlow #define	SMB_CAP_INFOLEVEL_PASSTHRU	0x2000
143*4bff34e3Sthurlow #define	SMB_CAP_LARGE_READX		0x4000
144*4bff34e3Sthurlow #define	SMB_CAP_LARGE_WRITEX		0x8000
145*4bff34e3Sthurlow #define	SMB_CAP_UNIX			0x00800000
146*4bff34e3Sthurlow #define	SMB_CAP_BULK_TRANSFER		0x20000000
147*4bff34e3Sthurlow #define	SMB_CAP_COMPRESSED_DATA		0x40000000
148*4bff34e3Sthurlow #define	SMB_CAP_EXT_SECURITY		0x80000000
149*4bff34e3Sthurlow 
150*4bff34e3Sthurlow /*
151*4bff34e3Sthurlow  * File attributes
152*4bff34e3Sthurlow  */
153*4bff34e3Sthurlow #define	SMB_FA_RDONLY		0x01
154*4bff34e3Sthurlow #define	SMB_FA_HIDDEN		0x02
155*4bff34e3Sthurlow #define	SMB_FA_SYSTEM		0x04
156*4bff34e3Sthurlow #define	SMB_FA_VOLUME		0x08
157*4bff34e3Sthurlow #define	SMB_FA_DIR		0x10
158*4bff34e3Sthurlow #define	SMB_FA_ARCHIVE		0x20
159*4bff34e3Sthurlow 
160*4bff34e3Sthurlow /*
161*4bff34e3Sthurlow  * Extended file attributes
162*4bff34e3Sthurlow  */
163*4bff34e3Sthurlow #define	SMB_EFA_RDONLY			0x00000001
164*4bff34e3Sthurlow #define	SMB_EFA_HIDDEN			0x00000002
165*4bff34e3Sthurlow #define	SMB_EFA_SYSTEM			0x00000004
166*4bff34e3Sthurlow #define	SMB_EFA_VOLUME			0x00000008
167*4bff34e3Sthurlow #define	SMB_EFA_DIRECTORY		0x00000010
168*4bff34e3Sthurlow #define	SMB_EFA_ARCHIVE			0x00000020
169*4bff34e3Sthurlow #define	SMB_EFA_DEVICE			0x00000040
170*4bff34e3Sthurlow #define	SMB_EFA_NORMAL			0x00000080
171*4bff34e3Sthurlow #define	SMB_EFA_TEMPORARY		0x00000100
172*4bff34e3Sthurlow #define	SMB_EFA_SPARSE			0x00000200
173*4bff34e3Sthurlow #define	SMB_EFA_REPARSE_POINT		0x00000400
174*4bff34e3Sthurlow #define	SMB_EFA_COMPRESSED		0x00000800
175*4bff34e3Sthurlow #define	SMB_EFA_OFFLINE			0x00001000
176*4bff34e3Sthurlow #define	SMB_EFA_NONINDEXED		0x00002000
177*4bff34e3Sthurlow #define	SMB_EFA_ENCRYPTED		0x00004000
178*4bff34e3Sthurlow #define	SMB_EFA_POSIX_SEMANTICS		0x01000000
179*4bff34e3Sthurlow #define	SMB_EFA_BACKUP_SEMANTICS	0x02000000
180*4bff34e3Sthurlow #define	SMB_EFA_DELETE_ON_CLOSE		0x04000000
181*4bff34e3Sthurlow #define	SMB_EFA_SEQUENTIAL_SCAN		0x08000000
182*4bff34e3Sthurlow #define	SMB_EFA_RANDOM_ACCESS		0x10000000
183*4bff34e3Sthurlow #define	SMB_EFA_NO_BUFFERING		0x20000000
184*4bff34e3Sthurlow #define	SMB_EFA_WRITE_THROUGH		0x80000000
185*4bff34e3Sthurlow 
186*4bff34e3Sthurlow /*
187*4bff34e3Sthurlow  * Access Mode Encoding
188*4bff34e3Sthurlow  */
189*4bff34e3Sthurlow #define	SMB_AM_OPENREAD		0x0000
190*4bff34e3Sthurlow #define	SMB_AM_OPENWRITE	0x0001
191*4bff34e3Sthurlow #define	SMB_AM_OPENRW		0x0002
192*4bff34e3Sthurlow #define	SMB_AM_OPENEXEC		0x0003
193*4bff34e3Sthurlow #define	SMB_AM_OPENMODE		0x0003	/* mask for access mode bits */
194*4bff34e3Sthurlow #define	SMB_SM_COMPAT		0x0000
195*4bff34e3Sthurlow #define	SMB_SM_EXCLUSIVE	0x0010
196*4bff34e3Sthurlow #define	SMB_SM_DENYWRITE	0x0020
197*4bff34e3Sthurlow #define	SMB_SM_DENYREADEXEC	0x0030
198*4bff34e3Sthurlow #define	SMB_SM_DENYNONE		0x0040
199*4bff34e3Sthurlow 
200*4bff34e3Sthurlow /* NT_CREATE_ANDX flags */
201*4bff34e3Sthurlow #define	NTCREATEX_FLAGS_REQUEST_OPLOCK		0x02
202*4bff34e3Sthurlow #define	NTCREATEX_FLAGS_REQUEST_BATCH_OPLOCK	0x04
203*4bff34e3Sthurlow #define	NTCREATEX_FLAGS_OPEN_DIRECTORY		0x08
204*4bff34e3Sthurlow #define	NTCREATEX_FLAGS_EXTENDED		0x10
205*4bff34e3Sthurlow 
206*4bff34e3Sthurlow /* NT_CREATE_ANDX share_access (share mode) */
207*4bff34e3Sthurlow #define	NTCREATEX_SHARE_ACCESS_NONE		0
208*4bff34e3Sthurlow #define	NTCREATEX_SHARE_ACCESS_READ		1
209*4bff34e3Sthurlow #define	NTCREATEX_SHARE_ACCESS_WRITE		2
210*4bff34e3Sthurlow #define	NTCREATEX_SHARE_ACCESS_DELETE		4
211*4bff34e3Sthurlow #define	NTCREATEX_SHARE_ACCESS_ALL		7
212*4bff34e3Sthurlow 
213*4bff34e3Sthurlow /* NT_CREATE_ANDX open_disposition */
214*4bff34e3Sthurlow #define	NTCREATEX_DISP_SUPERSEDE	0 /* if file exists supersede it */
215*4bff34e3Sthurlow #define	NTCREATEX_DISP_OPEN		1 /* exists ? open it : fail */
216*4bff34e3Sthurlow #define	NTCREATEX_DISP_CREATE		2 /* exists ? fail : create it */
217*4bff34e3Sthurlow #define	NTCREATEX_DISP_OPEN_IF		3 /* exists ? open it : create it */
218*4bff34e3Sthurlow #define	NTCREATEX_DISP_OVERWRITE	4 /* exists ? overwrite : fail */
219*4bff34e3Sthurlow #define	NTCREATEX_DISP_OVERWRITE_IF	5 /* exists ? overwrite : create */
220*4bff34e3Sthurlow 
221*4bff34e3Sthurlow /* NT_CREATE_ANDX create_options */
222*4bff34e3Sthurlow #define	NTCREATEX_OPTIONS_DIRECTORY		0x0001
223*4bff34e3Sthurlow #define	NTCREATEX_OPTIONS_WRITE_THROUGH		0x0002
224*4bff34e3Sthurlow #define	NTCREATEX_OPTIONS_SEQUENTIAL_ONLY	0x0004
225*4bff34e3Sthurlow #define	NTCREATEX_OPTIONS_SYNC_ALERT		0x0010
226*4bff34e3Sthurlow #define	NTCREATEX_OPTIONS_ASYNC_ALERT		0x0020
227*4bff34e3Sthurlow #define	NTCREATEX_OPTIONS_NON_DIRECTORY_FILE	0x0040
228*4bff34e3Sthurlow #define	NTCREATEX_OPTIONS_NO_EA_KNOWLEDGE	0x0200
229*4bff34e3Sthurlow #define	NTCREATEX_OPTIONS_EIGHT_DOT_THREE_ONLY	0x0400
230*4bff34e3Sthurlow #define	NTCREATEX_OPTIONS_RANDOM_ACCESS		0x0800
231*4bff34e3Sthurlow #define	NTCREATEX_OPTIONS_DELETE_ON_CLOSE	0x1000
232*4bff34e3Sthurlow #define	NTCREATEX_OPTIONS_OPEN_BY_FILE_ID	0x2000
233*4bff34e3Sthurlow 
234*4bff34e3Sthurlow /* NT_CREATE_ANDX "impersonation" */
235*4bff34e3Sthurlow #define	NTCREATEX_IMPERSONATION_ANONYMOUS		0
236*4bff34e3Sthurlow #define	NTCREATEX_IMPERSONATION_IDENTIFICATION		1
237*4bff34e3Sthurlow #define	NTCREATEX_IMPERSONATION_IMPERSONATION		2
238*4bff34e3Sthurlow #define	NTCREATEX_IMPERSONATION_DELEGATION		3
239*4bff34e3Sthurlow 
240*4bff34e3Sthurlow /* NT_CREATE_ANDX security flags */
241*4bff34e3Sthurlow #define	NTCREATEX_SECURITY_DYNAMIC	1
242*4bff34e3Sthurlow #define	NTCREATEX_SECURITY_ALL		2
243*4bff34e3Sthurlow 
244*4bff34e3Sthurlow /* NT_CREATE_ANDX create_action in reply */
245*4bff34e3Sthurlow #define	NTCREATEX_ACTION_EXISTED	1
246*4bff34e3Sthurlow #define	NTCREATEX_ACTION_CREATED	2
247*4bff34e3Sthurlow #define	NTCREATEX_ACTION_TRUNCATED	3
248*4bff34e3Sthurlow 
249*4bff34e3Sthurlow /* SMB_TRANS2_FIND_FIRST2/SMB_TRANS2_FIND_NEXT2 flags */
250*4bff34e3Sthurlow #define	FIND2_CLOSE_AFTER_REQUEST	0x0001
251*4bff34e3Sthurlow #define	FIND2_CLOSE_ON_EOS		0x0002
252*4bff34e3Sthurlow #define	FIND2_RETURN_RESUME_KEYS	0x0004
253*4bff34e3Sthurlow #define	FIND2_CONTINUE_SEARCH		0x0008
254*4bff34e3Sthurlow #define	FIND2_BACKUP_INTENT		0x0010
255*4bff34e3Sthurlow 
256*4bff34e3Sthurlow /*
257*4bff34e3Sthurlow  * SMB commands
258*4bff34e3Sthurlow  */
259*4bff34e3Sthurlow #define	SMB_COM_CREATE_DIRECTORY	0x00
260*4bff34e3Sthurlow #define	SMB_COM_DELETE_DIRECTORY	0x01
261*4bff34e3Sthurlow #define	SMB_COM_OPEN			0x02
262*4bff34e3Sthurlow #define	SMB_COM_CREATE			0x03
263*4bff34e3Sthurlow #define	SMB_COM_CLOSE			0x04
264*4bff34e3Sthurlow #define	SMB_COM_FLUSH			0x05
265*4bff34e3Sthurlow #define	SMB_COM_DELETE			0x06
266*4bff34e3Sthurlow #define	SMB_COM_RENAME			0x07
267*4bff34e3Sthurlow #define	SMB_COM_QUERY_INFORMATION	0x08
268*4bff34e3Sthurlow #define	SMB_COM_SET_INFORMATION		0x09
269*4bff34e3Sthurlow #define	SMB_COM_READ			0x0A
270*4bff34e3Sthurlow #define	SMB_COM_WRITE			0x0B
271*4bff34e3Sthurlow #define	SMB_COM_LOCK_BYTE_RANGE		0x0C
272*4bff34e3Sthurlow #define	SMB_COM_UNLOCK_BYTE_RANGE	0x0D
273*4bff34e3Sthurlow #define	SMB_COM_CREATE_TEMPORARY	0x0E
274*4bff34e3Sthurlow #define	SMB_COM_CREATE_NEW		0x0F
275*4bff34e3Sthurlow #define	SMB_COM_CHECK_DIRECTORY		0x10
276*4bff34e3Sthurlow #define	SMB_COM_PROCESS_EXIT		0x11
277*4bff34e3Sthurlow #define	SMB_COM_SEEK			0x12
278*4bff34e3Sthurlow #define	SMB_COM_LOCK_AND_READ		0x13
279*4bff34e3Sthurlow #define	SMB_COM_WRITE_AND_UNLOCK	0x14
280*4bff34e3Sthurlow #define	SMB_COM_READ_RAW		0x1A
281*4bff34e3Sthurlow #define	SMB_COM_READ_MPX		0x1B
282*4bff34e3Sthurlow #define	SMB_COM_READ_MPX_SECONDARY	0x1C
283*4bff34e3Sthurlow #define	SMB_COM_WRITE_RAW		0x1D
284*4bff34e3Sthurlow #define	SMB_COM_WRITE_MPX		0x1E
285*4bff34e3Sthurlow #define	SMB_COM_WRITE_COMPLETE		0x20
286*4bff34e3Sthurlow #define	SMB_COM_SET_INFORMATION2	0x22
287*4bff34e3Sthurlow #define	SMB_COM_QUERY_INFORMATION2	0x23
288*4bff34e3Sthurlow #define	SMB_COM_LOCKING_ANDX		0x24
289*4bff34e3Sthurlow #define	SMB_COM_TRANSACTION		0x25
290*4bff34e3Sthurlow #define	SMB_COM_TRANSACTION_SECONDARY	0x26
291*4bff34e3Sthurlow #define	SMB_COM_IOCTL			0x27
292*4bff34e3Sthurlow #define	SMB_COM_IOCTL_SECONDARY		0x28
293*4bff34e3Sthurlow #define	SMB_COM_COPY			0x29
294*4bff34e3Sthurlow #define	SMB_COM_MOVE			0x2A
295*4bff34e3Sthurlow #define	SMB_COM_ECHO			0x2B
296*4bff34e3Sthurlow #define	SMB_COM_WRITE_AND_CLOSE		0x2C
297*4bff34e3Sthurlow #define	SMB_COM_OPEN_ANDX		0x2D
298*4bff34e3Sthurlow #define	SMB_COM_READ_ANDX		0x2E
299*4bff34e3Sthurlow #define	SMB_COM_WRITE_ANDX		0x2F
300*4bff34e3Sthurlow #define	SMB_COM_CLOSE_AND_TREE_DISC	0x31
301*4bff34e3Sthurlow #define	SMB_COM_TRANSACTION2		0x32
302*4bff34e3Sthurlow #define	SMB_COM_TRANSACTION2_SECONDARY	0x33
303*4bff34e3Sthurlow #define	SMB_COM_FIND_CLOSE2		0x34
304*4bff34e3Sthurlow #define	SMB_COM_FIND_NOTIFY_CLOSE	0x35
305*4bff34e3Sthurlow #define	SMB_COM_TREE_CONNECT		0x70
306*4bff34e3Sthurlow #define	SMB_COM_TREE_DISCONNECT		0x71
307*4bff34e3Sthurlow #define	SMB_COM_NEGOTIATE		0x72
308*4bff34e3Sthurlow #define	SMB_COM_SESSION_SETUP_ANDX	0x73
309*4bff34e3Sthurlow #define	SMB_COM_LOGOFF_ANDX		0x74
310*4bff34e3Sthurlow #define	SMB_COM_TREE_CONNECT_ANDX	0x75
311*4bff34e3Sthurlow #define	SMB_COM_QUERY_INFORMATION_DISK	0x80
312*4bff34e3Sthurlow #define	SMB_COM_SEARCH			0x81
313*4bff34e3Sthurlow #define	SMB_COM_FIND			0x82
314*4bff34e3Sthurlow #define	SMB_COM_FIND_UNIQUE		0x83
315*4bff34e3Sthurlow #define	SMB_COM_NT_TRANSACT		0xA0
316*4bff34e3Sthurlow #define	SMB_COM_NT_TRANSACT_SECONDARY	0xA1
317*4bff34e3Sthurlow #define	SMB_COM_NT_CREATE_ANDX		0xA2
318*4bff34e3Sthurlow #define	SMB_COM_NT_CANCEL		0xA4
319*4bff34e3Sthurlow #define	SMB_COM_OPEN_PRINT_FILE		0xC0
320*4bff34e3Sthurlow #define	SMB_COM_WRITE_PRINT_FILE	0xC1
321*4bff34e3Sthurlow #define	SMB_COM_CLOSE_PRINT_FILE	0xC2
322*4bff34e3Sthurlow #define	SMB_COM_GET_PRINT_QUEUE		0xC3
323*4bff34e3Sthurlow #define	SMB_COM_READ_BULK		0xD8
324*4bff34e3Sthurlow #define	SMB_COM_WRITE_BULK		0xD9
325*4bff34e3Sthurlow #define	SMB_COM_WRITE_BULK_DATA		0xDA
326*4bff34e3Sthurlow 
327*4bff34e3Sthurlow /*
328*4bff34e3Sthurlow  * SMB_COM_TRANSACTION2 subcommands
329*4bff34e3Sthurlow  */
330*4bff34e3Sthurlow #define	SMB_TRANS2_OPEN2			0x00
331*4bff34e3Sthurlow #define	SMB_TRANS2_FIND_FIRST2			0x01
332*4bff34e3Sthurlow #define	SMB_TRANS2_FIND_NEXT2			0x02
333*4bff34e3Sthurlow #define	SMB_TRANS2_QUERY_FS_INFORMATION		0x03
334*4bff34e3Sthurlow #define	SMB_TRANS2_SETFSINFO			0x04
335*4bff34e3Sthurlow #define	SMB_TRANS2_QUERY_PATH_INFORMATION	0x05
336*4bff34e3Sthurlow #define	SMB_TRANS2_SET_PATH_INFORMATION		0x06
337*4bff34e3Sthurlow #define	SMB_TRANS2_QUERY_FILE_INFORMATION	0x07
338*4bff34e3Sthurlow #define	SMB_TRANS2_SET_FILE_INFORMATION		0x08
339*4bff34e3Sthurlow #define	SMB_TRANS2_FSCTL			0x09
340*4bff34e3Sthurlow #define	SMB_TRANS2_IOCTL2			0x0A
341*4bff34e3Sthurlow #define	SMB_TRANS2_FIND_NOTIFY_FIRST		0x0B
342*4bff34e3Sthurlow #define	SMB_TRANS2_FIND_NOTIFY_NEXT		0x0C
343*4bff34e3Sthurlow #define	SMB_TRANS2_CREATE_DIRECTORY		0x0D
344*4bff34e3Sthurlow #define	SMB_TRANS2_SESSION_SETUP		0x0E
345*4bff34e3Sthurlow #define	SMB_TRANS2_GET_DFS_REFERRAL		0x10
346*4bff34e3Sthurlow #define	SMB_TRANS2_REPORT_DFS_INCONSISTENCY	0x11
347*4bff34e3Sthurlow 
348*4bff34e3Sthurlow /*
349*4bff34e3Sthurlow  * SMB_COM_NT_TRANSACT subcommands
350*4bff34e3Sthurlow  */
351*4bff34e3Sthurlow #define	NT_TRANSACT_CREATE		0x01
352*4bff34e3Sthurlow #define	NT_TRANSACT_IOCTL		0x02
353*4bff34e3Sthurlow #define	NT_TRANSACT_SET_SECURITY_DESC	0x03
354*4bff34e3Sthurlow #define	NT_TRANSACT_NOTIFY_CHANGE	0x04
355*4bff34e3Sthurlow #define	NT_TRANSACT_RENAME		0x05
356*4bff34e3Sthurlow #define	NT_TRANSACT_QUERY_SECURITY_DESC	0x06
357*4bff34e3Sthurlow #define	NT_TRANSACT_GET_USER_QUOTA	0x07
358*4bff34e3Sthurlow #define	NT_TRANSACT_SET_USER_QUOTA	0x08
359*4bff34e3Sthurlow 
360*4bff34e3Sthurlow /*
361*4bff34e3Sthurlow  * SMB_TRANS2_QUERY_FS_INFORMATION levels
362*4bff34e3Sthurlow  */
363*4bff34e3Sthurlow #define	SMB_QFS_ALLOCATION			1
364*4bff34e3Sthurlow #define	SMB_QFS_VOLUME				2
365*4bff34e3Sthurlow #define	SMB_QFS_LABEL_INFO			0x101
366*4bff34e3Sthurlow #define	SMB_QFS_VOLUME_INFO			0x102
367*4bff34e3Sthurlow #define	SMB_QFS_SIZE_INFO			0x103
368*4bff34e3Sthurlow #define	SMB_QFS_DEVICE_INFO			0x104
369*4bff34e3Sthurlow #define	SMB_QFS_ATTRIBUTE_INFO			0x105
370*4bff34e3Sthurlow #define	SMB_QFS_UNIX_INFO			0x200
371*4bff34e3Sthurlow #define	SMB_QFS_MAC_FS_INFO			0x301
372*4bff34e3Sthurlow #define	SMB_QFS_VOLUME_INFORMATION		1001
373*4bff34e3Sthurlow #define	SMB_QFS_SIZE_INFORMATION		1003
374*4bff34e3Sthurlow #define	SMB_QFS_DEVICE_INFORMATION		1004
375*4bff34e3Sthurlow #define	SMB_QFS_ATTRIBUTE_INFORMATION		1005
376*4bff34e3Sthurlow #define	SMB_QFS_QUOTA_INFORMATION		1006
377*4bff34e3Sthurlow #define	SMB_QFS_FULL_SIZE_INFORMATION		1007
378*4bff34e3Sthurlow #define	SMB_QFS_OBJECTID_INFORMATION		1008
379*4bff34e3Sthurlow 
380*4bff34e3Sthurlow 
381*4bff34e3Sthurlow /*
382*4bff34e3Sthurlow  * SMB_QFS_ATTRIBUTE_INFO bits.
383*4bff34e3Sthurlow  * The following info found in msdn
384*4bff34e3Sthurlow  * (http://msdn.microsoft.com/library/default.asp?
385*4bff34e3Sthurlow  * url=/library/en-us/wmisdk/wmi/win32_cdromdrive.asp)
386*4bff34e3Sthurlow  * Naming is mostly as in samba, to help Those Who Google.
387*4bff34e3Sthurlow  */
388*4bff34e3Sthurlow #define	FILE_CASE_SENSITIVE_SEARCH	0x00000001
389*4bff34e3Sthurlow #define	FILE_CASE_PRESERVED_NAMES	0x00000002
390*4bff34e3Sthurlow #define	FILE_UNICODE_ON_DISK		0x00000004
391*4bff34e3Sthurlow #define	FILE_PERSISTENT_ACLS		0x00000008
392*4bff34e3Sthurlow #define	FILE_FILE_COMPRESSION		0x00000010
393*4bff34e3Sthurlow #define	FILE_VOLUME_QUOTAS		0x00000020
394*4bff34e3Sthurlow #define	FILE_SUPPORTS_SPARSE_FILES	0x00000040
395*4bff34e3Sthurlow #define	FILE_SUPPORTS_REPARSE_POINTS	0x00000080
396*4bff34e3Sthurlow #define	FILE_SUPPORTS_REMOTE_STORAGE	0x00000100
397*4bff34e3Sthurlow #define	FILE_SUPPORTS_LONG_NAMES	0x00004000
398*4bff34e3Sthurlow #define	FILE_VOLUME_IS_COMPRESSED	0x00008000
399*4bff34e3Sthurlow #define	FILE_SUPPORTS_OBJECT_IDS	0x00010000
400*4bff34e3Sthurlow #define	FILE_SUPPORTS_ENCRYPTION	0x00020000
401*4bff34e3Sthurlow #define	FILE_NAMED_STREAMS		0x00040000
402*4bff34e3Sthurlow 
403*4bff34e3Sthurlow /*
404*4bff34e3Sthurlow  * SMB_TRANS2_QUERY_PATH levels
405*4bff34e3Sthurlow  */
406*4bff34e3Sthurlow #define	SMB_QFILEINFO_STANDARD			1
407*4bff34e3Sthurlow #define	SMB_QFILEINFO_EA_SIZE			2
408*4bff34e3Sthurlow #define	SMB_QFILEINFO_EAS_FROM_LIST		3
409*4bff34e3Sthurlow #define	SMB_QFILEINFO_ALL_EAS			4
410*4bff34e3Sthurlow #define	SMB_QFILEINFO_IS_NAME_VALID		6	/* QPATHINFO only? */
411*4bff34e3Sthurlow #define	SMB_QFILEINFO_BASIC_INFO		0x101
412*4bff34e3Sthurlow #define	SMB_QFILEINFO_STANDARD_INFO		0x102
413*4bff34e3Sthurlow #define	SMB_QFILEINFO_EA_INFO			0x103
414*4bff34e3Sthurlow #define	SMB_QFILEINFO_NAME_INFO			0x104
415*4bff34e3Sthurlow #define	SMB_QFILEINFO_ALLOCATION_INFO		0x105
416*4bff34e3Sthurlow #define	SMB_QFILEINFO_END_OF_FILE_INFO		0x106
417*4bff34e3Sthurlow #define	SMB_QFILEINFO_ALL_INFO			0x107
418*4bff34e3Sthurlow #define	SMB_QFILEINFO_ALT_NAME_INFO		0x108
419*4bff34e3Sthurlow #define	SMB_QFILEINFO_STREAM_INFO		0x109
420*4bff34e3Sthurlow #define	SMB_QFILEINFO_COMPRESSION_INFO		0x10b
421*4bff34e3Sthurlow #define	SMB_QFILEINFO_UNIX_BASIC		0x200
422*4bff34e3Sthurlow #define	SMB_QFILEINFO_UNIX_LINK			0x201
423*4bff34e3Sthurlow #define	SMB_QFILEINFO_MAC_DT_GET_APPL		0x306
424*4bff34e3Sthurlow #define	SMB_QFILEINFO_MAC_DT_GET_ICON		0x307
425*4bff34e3Sthurlow #define	SMB_QFILEINFO_MAC_DT_GET_ICON_INFO	0x308
426*4bff34e3Sthurlow #define	SMB_QFILEINFO_BASIC_INFORMATION		1004
427*4bff34e3Sthurlow #define	SMB_QFILEINFO_STANDARD_INFORMATION	1005
428*4bff34e3Sthurlow #define	SMB_QFILEINFO_INTERNAL_INFORMATION	1006
429*4bff34e3Sthurlow #define	SMB_QFILEINFO_EA_INFORMATION		1007
430*4bff34e3Sthurlow #define	SMB_QFILEINFO_ACCESS_INFORMATION	1008
431*4bff34e3Sthurlow #define	SMB_QFILEINFO_NAME_INFORMATION		1009
432*4bff34e3Sthurlow #define	SMB_QFILEINFO_POSITION_INFORMATION	1014
433*4bff34e3Sthurlow #define	SMB_QFILEINFO_MODE_INFORMATION		1016
434*4bff34e3Sthurlow #define	SMB_QFILEINFO_ALIGNMENT_INFORMATION	1017
435*4bff34e3Sthurlow #define	SMB_QFILEINFO_ALL_INFORMATION		1018
436*4bff34e3Sthurlow #define	SMB_QFILEINFO_ALT_NAME_INFORMATION	1021
437*4bff34e3Sthurlow #define	SMB_QFILEINFO_STREAM_INFORMATION	1022
438*4bff34e3Sthurlow #define	SMB_QFILEINFO_COMPRESSION_INFORMATION	1028
439*4bff34e3Sthurlow #define	SMB_QFILEINFO_NETWORK_OPEN_INFORMATION	1034
440*4bff34e3Sthurlow #define	SMB_QFILEINFO_ATTRIBUTE_TAG_INFORMATION 1035
441*4bff34e3Sthurlow 
442*4bff34e3Sthurlow /*
443*4bff34e3Sthurlow  * SMB_TRANS2_FIND_FIRST2 information levels
444*4bff34e3Sthurlow  */
445*4bff34e3Sthurlow #define	SMB_FIND_STANDARD		1
446*4bff34e3Sthurlow #define	SMB_FIND_EA_SIZE		2
447*4bff34e3Sthurlow #define	SMB_FIND_EAS_FROM_LIST		3
448*4bff34e3Sthurlow #define	SMB_FIND_DIRECTORY_INFO		0x101
449*4bff34e3Sthurlow #define	SMB_FIND_FULL_DIRECTORY_INFO	0x102
450*4bff34e3Sthurlow #define	SMB_FIND_NAME_INFO		0x103
451*4bff34e3Sthurlow #define	SMB_FIND_BOTH_DIRECTORY_INFO	0x104
452*4bff34e3Sthurlow #define	SMB_FIND_UNIX_INFO		0x200
453*4bff34e3Sthurlow 
454*4bff34e3Sthurlow /*
455*4bff34e3Sthurlow  * Selectors for NT_TRANSACT_QUERY_SECURITY_DESC and
456*4bff34e3Sthurlow  * NT_TRANSACT_SET_SECURITY_DESC.  Details found in the MSDN
457*4bff34e3Sthurlow  * library by searching on security_information.
458*4bff34e3Sthurlow  * Note the protected/unprotected bits did not exist in NT.
459*4bff34e3Sthurlow  */
460*4bff34e3Sthurlow 
461*4bff34e3Sthurlow #define	OWNER_SECURITY_INFORMATION		0x00000001
462*4bff34e3Sthurlow #define	GROUP_SECURITY_INFORMATION		0x00000002
463*4bff34e3Sthurlow #define	DACL_SECURITY_INFORMATION		0x00000004
464*4bff34e3Sthurlow #define	SACL_SECURITY_INFORMATION		0x00000008
465*4bff34e3Sthurlow #define	UNPROTECTED_SACL_SECURITY_INFORMATION	0x10000000
466*4bff34e3Sthurlow #define	UNPROTECTED_DACL_SECURITY_INFORMATION	0x20000000
467*4bff34e3Sthurlow #define	PROTECTED_SACL_SECURITY_INFORMATION	0x40000000
468*4bff34e3Sthurlow #define	PROTECTED_DACL_SECURITY_INFORMATION	0x80000000
469*4bff34e3Sthurlow 
470*4bff34e3Sthurlow /*
471*4bff34e3Sthurlow  * security descriptor header
472*4bff34e3Sthurlow  * it is followed by the optional SIDs and ACLs
473*4bff34e3Sthurlow  * note this is "raw", ie little-endian
474*4bff34e3Sthurlow  */
475*4bff34e3Sthurlow struct ntsecdesc {
476*4bff34e3Sthurlow 	uint8_t		sd_revision;	/* 0x01 observed between W2K */
477*4bff34e3Sthurlow 	uint8_t		sd_pad1;
478*4bff34e3Sthurlow 	uint16_t	sd_flags;
479*4bff34e3Sthurlow 	uint32_t	sd_owneroff;	/* offset to owner SID */
480*4bff34e3Sthurlow 	uint32_t	sd_groupoff;	/* offset to group SID */
481*4bff34e3Sthurlow 	uint32_t	sd_sacloff;	/* offset to system/audit ACL */
482*4bff34e3Sthurlow 	uint32_t	sd_dacloff;	/* offset to discretionary ACL */
483*4bff34e3Sthurlow }; /* XXX: __attribute__((__packed__)); */
484*4bff34e3Sthurlow typedef struct ntsecdesc ntsecdesc_t;
485*4bff34e3Sthurlow 
486*4bff34e3Sthurlow #define	wset_sdrevision(s) ((s)->sd_revision = 0x01)
487*4bff34e3Sthurlow #define	sdflags(s) (letohs((s)->sd_flags))
488*4bff34e3Sthurlow #define	wset_sdflags(s, f) ((s)->sd_flags = letohs(f))
489*4bff34e3Sthurlow #define	sdowner(s) \
490*4bff34e3Sthurlow 	((struct ntsid *)((s)->sd_owneroff ? \
491*4bff34e3Sthurlow 	(char *)(s) + letohl((s)->sd_owneroff) : \
492*4bff34e3Sthurlow 	NULL))
493*4bff34e3Sthurlow #define	wset_sdowneroff(s, o) ((s)->sd_owneroff = htolel(o))
494*4bff34e3Sthurlow #define	sdgroup(s) \
495*4bff34e3Sthurlow 	((struct ntsid *)((s)->sd_groupoff ? \
496*4bff34e3Sthurlow 	(char *)(s) + letohl((s)->sd_groupoff) : \
497*4bff34e3Sthurlow 	NULL))
498*4bff34e3Sthurlow #define	wset_sdgroupoff(s, o) ((s)->sd_groupoff = htolel(o))
499*4bff34e3Sthurlow #define	sdsacl(s) \
500*4bff34e3Sthurlow 	((struct ntacl *)((s)->sd_sacloff ? \
501*4bff34e3Sthurlow 	(char *)(s) + letohl((s)->sd_sacloff) : \
502*4bff34e3Sthurlow 	NULL))
503*4bff34e3Sthurlow #define	wset_sdsacloff(s, o) ((s)->sd_sacloff = htolel(o))
504*4bff34e3Sthurlow #define	sddacl(s) \
505*4bff34e3Sthurlow 	((struct ntacl *)((s)->sd_dacloff ? \
506*4bff34e3Sthurlow 	(char *)(s) + letohl((s)->sd_dacloff) : \
507*4bff34e3Sthurlow 	NULL))
508*4bff34e3Sthurlow #define	wset_sddacloff(s, o) ((s)->sd_dacloff = htolel(o))
509*4bff34e3Sthurlow 
510*4bff34e3Sthurlow /*
511*4bff34e3Sthurlow  * sd_flags bits
512*4bff34e3Sthurlow  */
513*4bff34e3Sthurlow #define	SD_OWNER_DEFAULTED		0x0001
514*4bff34e3Sthurlow #define	SD_GROUP_DEFAULTED		0x0002
515*4bff34e3Sthurlow #define	SD_DACL_PRESENT			0x0004
516*4bff34e3Sthurlow #define	SD_DACL_DEFAULTED		0x0008
517*4bff34e3Sthurlow #define	SD_SACL_PRESENT			0x0010
518*4bff34e3Sthurlow #define	SD_SACL_DEFAULTED		0x0020
519*4bff34e3Sthurlow #define	SD_DACL_TRUSTED			0x0040
520*4bff34e3Sthurlow #define	SD_SERVER_SECURITY		0x0080
521*4bff34e3Sthurlow #define	SD_DACL_AUTO_INHERIT_REQ	0x0100
522*4bff34e3Sthurlow #define	SD_SACL_AUTO_INHERIT_REQ	0x0200
523*4bff34e3Sthurlow #define	SD_DACL_AUTO_INHERITED		0x0400
524*4bff34e3Sthurlow #define	SD_SACL_AUTO_INHERITED		0x0800
525*4bff34e3Sthurlow #define	SD_DACL_PROTECTED		0x1000
526*4bff34e3Sthurlow #define	SD_SACL_PROTECTED		0x2000
527*4bff34e3Sthurlow #define	SD_RM_CONTROL_VALID		0x4000
528*4bff34e3Sthurlow #define	SD_SELF_RELATIVE		0x8000
529*4bff34e3Sthurlow 
530*4bff34e3Sthurlow /*
531*4bff34e3Sthurlow  * access control list header
532*4bff34e3Sthurlow  * it is followed by the ACEs
533*4bff34e3Sthurlow  * note this is "raw", ie little-endian
534*4bff34e3Sthurlow  */
535*4bff34e3Sthurlow struct ntacl {
536*4bff34e3Sthurlow 	uint8_t	acl_revision;	/* 0x02 observed with W2K */
537*4bff34e3Sthurlow 	uint8_t	acl_pad1;
538*4bff34e3Sthurlow 	uint16_t	acl_len; /* bytes; includes this header */
539*4bff34e3Sthurlow 	uint16_t	acl_acecount;
540*4bff34e3Sthurlow 	uint16_t	acl_pad2;
541*4bff34e3Sthurlow }; /* XXX: __attribute__((__packed__)); */
542*4bff34e3Sthurlow typedef struct ntacl ntacl_t;
543*4bff34e3Sthurlow 
544*4bff34e3Sthurlow #define	wset_aclrevision(a) ((a)->acl_revision = 0x02)
545*4bff34e3Sthurlow #define	acllen(a) (letohs((a)->acl_len))
546*4bff34e3Sthurlow #define	wset_acllen(a, l) ((a)->acl_len = htoles(l))
547*4bff34e3Sthurlow #define	aclacecount(a) (letohs((a)->acl_acecount))
548*4bff34e3Sthurlow #define	wset_aclacecount(a, c) ((a)->acl_acecount = htoles(c))
549*4bff34e3Sthurlow #define	aclace(a) ((struct ntace *)((char *)(a) + sizeof (struct ntacl)))
550*4bff34e3Sthurlow 
551*4bff34e3Sthurlow /*
552*4bff34e3Sthurlow  * access control entry header
553*4bff34e3Sthurlow  * it is followed by type-specific ace data,
554*4bff34e3Sthurlow  * which for the simple types is just a SID
555*4bff34e3Sthurlow  * note this is "raw", ie little-endian
556*4bff34e3Sthurlow  */
557*4bff34e3Sthurlow struct ntace {
558*4bff34e3Sthurlow 	uint8_t	ace_type;
559*4bff34e3Sthurlow 	uint8_t	ace_flags;
560*4bff34e3Sthurlow 	uint16_t	ace_len; /* bytes; includes this header */
561*4bff34e3Sthurlow 	uint32_t	ace_rights; /* generic, standard, specific, etc */
562*4bff34e3Sthurlow }; /* XXX: __attribute__((__packed__)); */
563*4bff34e3Sthurlow 
564*4bff34e3Sthurlow #define	acetype(a) ((a)->ace_type)
565*4bff34e3Sthurlow #define	wset_acetype(a, t) ((a)->ace_type = (t))
566*4bff34e3Sthurlow #define	aceflags(a) ((a)->ace_flags)
567*4bff34e3Sthurlow #define	wset_aceflags(a, f) ((a)->ace_flags = (f))
568*4bff34e3Sthurlow #define	acelen(a) (letohs((a)->ace_len))
569*4bff34e3Sthurlow #define	wset_acelen(a, l) ((a)->ace_len = htoles(l))
570*4bff34e3Sthurlow #define	acerights(a) (letohl((a)->ace_rights))
571*4bff34e3Sthurlow #define	wset_acerights(a, r) ((a)->ace_rights = htolel(r))
572*4bff34e3Sthurlow #define	aceace(a) ((struct ntace *)((char *)(a) + acelen(a)))
573*4bff34e3Sthurlow #define	acesid(a) ((struct ntsid *)((char *)(a) + sizeof (struct ntace)))
574*4bff34e3Sthurlow 
575*4bff34e3Sthurlow /*
576*4bff34e3Sthurlow  * ace_rights
577*4bff34e3Sthurlow  * (Samba bit names are used here, with permission, as the shorter Windows
578*4bff34e3Sthurlow  * names are more likely to cause namespace collisions)
579*4bff34e3Sthurlow  */
580*4bff34e3Sthurlow #define	SA_RIGHT_FILE_READ_DATA		0x00000001
581*4bff34e3Sthurlow #define	SA_RIGHT_FILE_WRITE_DATA	0x00000002
582*4bff34e3Sthurlow #define	SA_RIGHT_FILE_APPEND_DATA	0x00000004
583*4bff34e3Sthurlow #define	SA_RIGHT_FILE_READ_EA		0x00000008
584*4bff34e3Sthurlow #define	SA_RIGHT_FILE_WRITE_EA		0x00000010
585*4bff34e3Sthurlow #define	SA_RIGHT_FILE_EXECUTE		0x00000020
586*4bff34e3Sthurlow #define	SA_RIGHT_FILE_DELETE_CHILD	0x00000040
587*4bff34e3Sthurlow #define	SA_RIGHT_FILE_READ_ATTRIBUTES	0x00000080
588*4bff34e3Sthurlow #define	SA_RIGHT_FILE_WRITE_ATTRIBUTES	0x00000100
589*4bff34e3Sthurlow #define	SA_RIGHT_FILE_ALL_ACCESS	0x000001FF
590*4bff34e3Sthurlow 
591*4bff34e3Sthurlow #define	STD_RIGHT_DELETE_ACCESS		0x00010000
592*4bff34e3Sthurlow #define	STD_RIGHT_READ_CONTROL_ACCESS	0x00020000
593*4bff34e3Sthurlow #define	STD_RIGHT_WRITE_DAC_ACCESS	0x00040000
594*4bff34e3Sthurlow #define	STD_RIGHT_WRITE_OWNER_ACCESS	0x00080000
595*4bff34e3Sthurlow #define	STD_RIGHT_SYNCHRONIZE_ACCESS	0x00100000
596*4bff34e3Sthurlow #define	STD_RIGHT_ALL_ACCESS		0x001F0000
597*4bff34e3Sthurlow 
598*4bff34e3Sthurlow #define	SEC_RIGHT_SYSTEM_SECURITY	0x01000000
599*4bff34e3Sthurlow /*
600*4bff34e3Sthurlow  * Don't use MAXIMUM_ALLOWED as Samba (2.2.3 at least) will
601*4bff34e3Sthurlow  * return NT_STATUS_INVALID_LOCK_SEQUENCE
602*4bff34e3Sthurlow  */
603*4bff34e3Sthurlow #define	SEC_RIGHT_MAXIMUM_ALLOWED	0x02000000
604*4bff34e3Sthurlow 
605*4bff34e3Sthurlow #define	GENERIC_RIGHT_ALL_ACCESS	0x10000000
606*4bff34e3Sthurlow #define	GENERIC_RIGHT_EXECUTE_ACCESS	0x20000000
607*4bff34e3Sthurlow #define	GENERIC_RIGHT_WRITE_ACCESS	0x40000000
608*4bff34e3Sthurlow #define	GENERIC_RIGHT_READ_ACCESS	0x80000000
609*4bff34e3Sthurlow 
610*4bff34e3Sthurlow /*
611*4bff34e3Sthurlow  * these mappings are from Windows sample code but are likely incomplete
612*4bff34e3Sthurlow  *
613*4bff34e3Sthurlow  * GENERIC_RIGHT_READ_ACCESS :
614*4bff34e3Sthurlow  *	STD_RIGHT_SYNCHRONIZE_ACCESS |
615*4bff34e3Sthurlow  *	STD_RIGHT_READ_CONTROL_ACCESS |
616*4bff34e3Sthurlow  *	SA_RIGHT_FILE_READ_ATTRIBUTES |
617*4bff34e3Sthurlow  *	SA_RIGHT_FILE_READ_EA |
618*4bff34e3Sthurlow  *	SA_RIGHT_FILE_READ_DATA
619*4bff34e3Sthurlow  * GENERIC_RIGHT_WRITE_ACCESS :
620*4bff34e3Sthurlow  *	STD_RIGHT_SYNCHRONIZE_ACCESS |
621*4bff34e3Sthurlow  *	STD_RIGHT_READ_CONTROL_ACCESS |
622*4bff34e3Sthurlow  *	SA_RIGHT_FILE_WRITE_ATTRIBUTES |
623*4bff34e3Sthurlow  *	SA_RIGHT_FILE_WRITE_EA |
624*4bff34e3Sthurlow  *	SA_RIGHT_FILE_APPEND_DATA |
625*4bff34e3Sthurlow  *	SA_RIGHT_FILE_WRITE_DATA
626*4bff34e3Sthurlow  * GENERIC_RIGHT_EXECUTE_ACCESS :
627*4bff34e3Sthurlow  *	STD_RIGHT_SYNCHRONIZE_ACCESS |
628*4bff34e3Sthurlow  *	STD_RIGHT_READ_CONTROL_ACCESS |
629*4bff34e3Sthurlow  *	SA_RIGHT_FILE_READ_ATTRIBUTES |
630*4bff34e3Sthurlow  *	SA_RIGHT_FILE_EXECUTE
631*4bff34e3Sthurlow  * GENERIC_RIGHT_ALL_ACCESS :
632*4bff34e3Sthurlow  *	STD_RIGHT_SYNCHRONIZE_ACCESS |
633*4bff34e3Sthurlow  *	STD_RIGHT_WRITE_OWNER_ACCESS |
634*4bff34e3Sthurlow  *	STD_RIGHT_WRITE_DAC_ACCESS |
635*4bff34e3Sthurlow  *	STD_RIGHT_READ_CONTROL_ACCESS |
636*4bff34e3Sthurlow  *	STD_RIGHT_DELETE_ACCESS |
637*4bff34e3Sthurlow  *	SA_RIGHT_FILE_ALL_ACCESS
638*4bff34e3Sthurlow  */
639*4bff34e3Sthurlow 
640*4bff34e3Sthurlow /*
641*4bff34e3Sthurlow  * security identifier header
642*4bff34e3Sthurlow  * it is followed by sid_numauth sub-authorities,
643*4bff34e3Sthurlow  * which are 32 bits each.
644*4bff34e3Sthurlow  * note the subauths are little-endian on the wire, but
645*4bff34e3Sthurlow  * need to be big-endian for memberd/DS
646*4bff34e3Sthurlow  */
647*4bff34e3Sthurlow #define	SIDAUTHSIZE 6
648*4bff34e3Sthurlow struct ntsid {
649*4bff34e3Sthurlow 	uint8_t	sid_revision;
650*4bff34e3Sthurlow 	uint8_t	sid_subauthcount;
651*4bff34e3Sthurlow 	uint8_t	sid_authority[SIDAUTHSIZE]; /* ie not little endian */
652*4bff34e3Sthurlow }; /* XXX: __attribute__((__packed__)); */
653*4bff34e3Sthurlow typedef struct ntsid ntsid_t;
654*4bff34e3Sthurlow 
655*4bff34e3Sthurlow #define	sidsubauthcount(s) (s->sid_subauthcount)
656*4bff34e3Sthurlow #define	sidlen(s) (sizeof (struct ntsid) + 4 * (s)->sid_subauthcount)
657*4bff34e3Sthurlow #define	MAXSIDLEN (sizeof (struct ntsid) + 4 * KAUTH_NTSID_MAX_AUTHORITIES)
658*4bff34e3Sthurlow #define	sidsub(s) ((uint32_t *)((char *)(s) + sizeof (struct ntsid)))
659*4bff34e3Sthurlow 
660*4bff34e3Sthurlow /*
661*4bff34e3Sthurlow  * MS' defined values for ace_type
662*4bff34e3Sthurlow  */
663*4bff34e3Sthurlow #define	ACCESS_ALLOWED_ACE_TYPE			0x0
664*4bff34e3Sthurlow #define	ACCESS_DENIED_ACE_TYPE			0x1
665*4bff34e3Sthurlow #define	SYSTEM_AUDIT_ACE_TYPE			0x2
666*4bff34e3Sthurlow #define	SYSTEM_ALARM_ACE_TYPE			0x3
667*4bff34e3Sthurlow #define	ACCESS_ALLOWED_COMPOUND_ACE_TYPE	0x4
668*4bff34e3Sthurlow #define	ACCESS_ALLOWED_OBJECT_ACE_TYPE		0x5
669*4bff34e3Sthurlow #define	ACCESS_DENIED_OBJECT_ACE_TYPE		0x6
670*4bff34e3Sthurlow #define	SYSTEM_AUDIT_OBJECT_ACE_TYPE		0x7
671*4bff34e3Sthurlow #define	SYSTEM_ALARM_OBJECT_ACE_TYPE		0x8
672*4bff34e3Sthurlow #define	ACCESS_ALLOWED_CALLBACK_ACE_TYPE	0x9
673*4bff34e3Sthurlow #define	ACCESS_DENIED_CALLBACK_ACE_TYPE		0xA
674*4bff34e3Sthurlow #define	ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE	0xB
675*4bff34e3Sthurlow #define	ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE	0xC
676*4bff34e3Sthurlow #define	SYSTEM_AUDIT_CALLBACK_ACE_TYPE		0xD
677*4bff34e3Sthurlow #define	SYSTEM_ALARM_CALLBACK_ACE_TYPE		0xE
678*4bff34e3Sthurlow #define	SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE	0xF
679*4bff34e3Sthurlow #define	SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE	0x10
680*4bff34e3Sthurlow 
681*4bff34e3Sthurlow /*
682*4bff34e3Sthurlow  * MS' defined values for ace_flags
683*4bff34e3Sthurlow  */
684*4bff34e3Sthurlow #define	OBJECT_INHERIT_ACE_FLAG			0x01
685*4bff34e3Sthurlow #define	CONTAINER_INHERIT_ACE_FLAG		0x02
686*4bff34e3Sthurlow #define	NO_PROPAGATE_INHERIT_ACE_FLAG		0x04
687*4bff34e3Sthurlow #define	INHERIT_ONLY_ACE_FLAG			0x08
688*4bff34e3Sthurlow #define	INHERITED_ACE_FLAG			0x10
689*4bff34e3Sthurlow #define	UNDEF_ACE_FLAG				0x20 /* MS doesn't define it */
690*4bff34e3Sthurlow #define	VALID_INHERIT_ACE_FLAGS			0x1F
691*4bff34e3Sthurlow #define	SUCCESSFUL_ACCESS_ACE_FLAG		0x40
692*4bff34e3Sthurlow #define	FAILED_ACCESS_ACE_FLAG			0x80
693*4bff34e3Sthurlow 
694*4bff34e3Sthurlow /*
695*4bff34e3Sthurlow  * Set PATH/FILE information levels
696*4bff34e3Sthurlow  */
697*4bff34e3Sthurlow #define	SMB_SFILEINFO_STANDARD			1
698*4bff34e3Sthurlow #define	SMB_SFILEINFO_EA_SET			2
699*4bff34e3Sthurlow #define	SMB_SFILEINFO_BASIC_INFO		0x101
700*4bff34e3Sthurlow #define	SMB_SFILEINFO_DISPOSITION_INFO		0x102
701*4bff34e3Sthurlow #define	SMB_SFILEINFO_ALLOCATION_INFO		0x103
702*4bff34e3Sthurlow #define	SMB_SFILEINFO_END_OF_FILE_INFO		0x104
703*4bff34e3Sthurlow #define	SMB_SFILEINFO_UNIX_BASIC		0x200
704*4bff34e3Sthurlow #define	SMB_SFILEINFO_UNIX_LINK			0x201
705*4bff34e3Sthurlow #define	SMB_SFILEINFO_UNIX_HLINK		0x203
706*4bff34e3Sthurlow #define	SMB_SFILEINFO_DIRECTORY_INFORMATION	1001
707*4bff34e3Sthurlow #define	SMB_SFILEINFO_FULL_DIRECTORY_INFORMATION	1002
708*4bff34e3Sthurlow #define	SMB_SFILEINFO_BOTH_DIRECTORY_INFORMATION	1003
709*4bff34e3Sthurlow #define	SMB_SFILEINFO_BASIC_INFORMATION		1004
710*4bff34e3Sthurlow #define	SMB_SFILEINFO_STANDARD_INFORMATION	1005
711*4bff34e3Sthurlow #define	SMB_SFILEINFO_INTERNAL_INFORMATION	1006
712*4bff34e3Sthurlow #define	SMB_SFILEINFO_EA_INFORMATION		1007
713*4bff34e3Sthurlow #define	SMB_SFILEINFO_ACCESS_INFORMATION	1008
714*4bff34e3Sthurlow #define	SMB_SFILEINFO_NAME_INFORMATION		1009
715*4bff34e3Sthurlow #define	SMB_SFILEINFO_RENAME_INFORMATION	1010
716*4bff34e3Sthurlow #define	SMB_SFILEINFO_LINK_INFORMATION		1011
717*4bff34e3Sthurlow #define	SMB_SFILEINFO_NAMES_INFORMATION		1012
718*4bff34e3Sthurlow #define	SMB_SFILEINFO_DISPOSITION_INFORMATION	1013
719*4bff34e3Sthurlow #define	SMB_SFILEINFO_POSITION_INFORMATION	1014
720*4bff34e3Sthurlow #define	SMB_SFILEINFO_1015			1015 /* ? */
721*4bff34e3Sthurlow #define	SMB_SFILEINFO_MODE_INFORMATION		1016
722*4bff34e3Sthurlow #define	SMB_SFILEINFO_ALIGNMENT_INFORMATION	1017
723*4bff34e3Sthurlow #define	SMB_SFILEINFO_ALL_INFORMATION		1018
724*4bff34e3Sthurlow #define	SMB_SFILEINFO_ALLOCATION_INFORMATION	1019
725*4bff34e3Sthurlow #define	SMB_SFILEINFO_END_OF_FILE_INFORMATION	1020
726*4bff34e3Sthurlow #define	SMB_SFILEINFO_ALT_NAME_INFORMATION	1021
727*4bff34e3Sthurlow #define	SMB_SFILEINFO_STREAM_INFORMATION	1022
728*4bff34e3Sthurlow #define	SMB_SFILEINFO_PIPE_INFORMATION		1023
729*4bff34e3Sthurlow #define	SMB_SFILEINFO_PIPE_LOCAL_INFORMATION	1024
730*4bff34e3Sthurlow #define	SMB_SFILEINFO_PIPE_REMOTE_INFORMATION	1025
731*4bff34e3Sthurlow #define	SMB_SFILEINFO_MAILSLOT_QUERY_INFORMATION	1026
732*4bff34e3Sthurlow #define	SMB_SFILEINFO_MAILSLOT_SET_INFORMATION		1027
733*4bff34e3Sthurlow #define	SMB_SFILEINFO_COMPRESSION_INFORMATION		1028
734*4bff34e3Sthurlow #define	SMB_SFILEINFO_OBJECT_ID_INFORMATION		1029
735*4bff34e3Sthurlow #define	SMB_SFILEINFO_COMPLETION_INFORMATION		1030
736*4bff34e3Sthurlow #define	SMB_SFILEINFO_MOVE_CLUSTER_INFORMATION		1031
737*4bff34e3Sthurlow #define	SMB_SFILEINFO_QUOTA_INFORMATION		1032
738*4bff34e3Sthurlow #define	SMB_SFILEINFO_REPARSE_POINT_INFORMATION	1033
739*4bff34e3Sthurlow #define	SMB_SFILEINFO_NETWORK_OPEN_INFORMATION	1034
740*4bff34e3Sthurlow #define	SMB_SFILEINFO_ATTRIBUTE_TAG_INFORMATION 1035
741*4bff34e3Sthurlow #define	SMB_SFILEINFO_TRACKING_INFORMATION	1036
742*4bff34e3Sthurlow #define	SMB_SFILEINFO_MAXIMUM_INFORMATION	1037
743*4bff34e3Sthurlow 
744*4bff34e3Sthurlow /*
745*4bff34e3Sthurlow  * LOCKING_ANDX LockType flags
746*4bff34e3Sthurlow  */
747*4bff34e3Sthurlow #define	SMB_LOCKING_ANDX_SHARED_LOCK	0x01
748*4bff34e3Sthurlow #define	SMB_LOCKING_ANDX_OPLOCK_RELEASE	0x02
749*4bff34e3Sthurlow #define	SMB_LOCKING_ANDX_CHANGE_LOCKTYPE 0x04
750*4bff34e3Sthurlow #define	SMB_LOCKING_ANDX_CANCEL_LOCK	0x08
751*4bff34e3Sthurlow #define	SMB_LOCKING_ANDX_LARGE_FILES	0x10
752*4bff34e3Sthurlow 
753*4bff34e3Sthurlow /*
754*4bff34e3Sthurlow  * Some names length limitations. Some of them aren't declared by specs,
755*4bff34e3Sthurlow  * but we need reasonable limits.
756*4bff34e3Sthurlow  */
757*4bff34e3Sthurlow #define	SMB_MAXSRVNAMELEN	15	/* NetBIOS limit */
758*4bff34e3Sthurlow #define	SMB_MAXUSERNAMELEN	128
759*4bff34e3Sthurlow #define	SMB_MAXPASSWORDLEN	128
760*4bff34e3Sthurlow #define	SMB_MAXSHARENAMELEN	128
761*4bff34e3Sthurlow #define	SMB_MAXPKTLEN		0x1FFFF
762*4bff34e3Sthurlow #define	SMB_MAXCHALLENGELEN	8
763*4bff34e3Sthurlow #define	SMB_MAXFNAMELEN		255	/* Keep in sync with MAXNAMLEN */
764*4bff34e3Sthurlow 
765*4bff34e3Sthurlow #define	SMB_RCNDELAY		2	/* seconds between reconnect attempts */
766*4bff34e3Sthurlow /*
767*4bff34e3Sthurlow  * leave this zero - we can't ssecond guess server side effects of
768*4bff34e3Sthurlow  * duplicate ops, this isn't nfs!
769*4bff34e3Sthurlow  */
770*4bff34e3Sthurlow #define	SMBMAXRESTARTS		0
771*4bff34e3Sthurlow #define	SMB_MAXSETUPWORDS	3	/* max # of setup words in trans/t2 */
772*4bff34e3Sthurlow 
773*4bff34e3Sthurlow /*
774*4bff34e3Sthurlow  * Error classes
775*4bff34e3Sthurlow  */
776*4bff34e3Sthurlow #define	SMBSUCCESS	0x00
777*4bff34e3Sthurlow #define	ERRDOS		0x01
778*4bff34e3Sthurlow #define	ERRSRV		0x02
779*4bff34e3Sthurlow #define	ERRHRD		0x03	/* Error is an hardware error. */
780*4bff34e3Sthurlow #define	ERRCMD		0xFF	/* Command was not in the "SMB" format. */
781*4bff34e3Sthurlow 
782*4bff34e3Sthurlow /*
783*4bff34e3Sthurlow  * Error codes for the ERRDOS class
784*4bff34e3Sthurlow  */
785*4bff34e3Sthurlow #define	ERRbadfunc	1	/* Invalid function */
786*4bff34e3Sthurlow #define	ERRbadfile	2	/* File not found (last component) */
787*4bff34e3Sthurlow #define	ERRbadpath	3	/* Directory invalid */
788*4bff34e3Sthurlow #define	ERRnofids	4	/* Too many open files */
789*4bff34e3Sthurlow #define	ERRnoaccess	5	/* Access denied */
790*4bff34e3Sthurlow #define	ERRbadfid	6	/* Invalid file handle */
791*4bff34e3Sthurlow #define	ERRbadmcb	7	/* Memory control blocks destroyed (huh ?) */
792*4bff34e3Sthurlow #define	ERRnomem	8	/* Insufficient memory */
793*4bff34e3Sthurlow #define	ERRbadmem	9	/* Invalid memory block address */
794*4bff34e3Sthurlow #define	ERRbadenv	10	/* Invalid environment */
795*4bff34e3Sthurlow #define	ERRbadformat	11	/* Invalid format */
796*4bff34e3Sthurlow #define	ERRbadaccess	12	/* Invalid open mode */
797*4bff34e3Sthurlow #define	ERRbaddata	13	/* Invalid data */
798*4bff34e3Sthurlow #define	ERRoutofmem	14	/* out of memory */
799*4bff34e3Sthurlow #define	ERRbaddrive	15	/* Invalid drive specified */
800*4bff34e3Sthurlow #define	ERRremcd	16	/* An attempt to delete current directory */
801*4bff34e3Sthurlow #define	ERRdiffdevice	17	/* cross fs rename/move */
802*4bff34e3Sthurlow #define	ERRnofiles	18	/* no more files found in file search */
803*4bff34e3Sthurlow #define	ERRwriteprotect	19
804*4bff34e3Sthurlow #define	ERRnotready	21
805*4bff34e3Sthurlow #define	ERRbadcmd	22
806*4bff34e3Sthurlow #define	ERRcrc		23
807*4bff34e3Sthurlow #define	ERRbadlength	24
808*4bff34e3Sthurlow #define	ERRsectornotfound	27
809*4bff34e3Sthurlow #define	ERRbadshare	32	/* Share mode can't be granted */
810*4bff34e3Sthurlow #define	ERRlock		33	/* Lock conflicts with existing lock */
811*4bff34e3Sthurlow #define	ERRwrongdisk	34
812*4bff34e3Sthurlow #define	ERRhandleeof	38
813*4bff34e3Sthurlow #define	ERRunsup	50	/* unsupported - Win 95 */
814*4bff34e3Sthurlow #define	ERRnetnamedel	64
815*4bff34e3Sthurlow #define	ERRnoipc	66	/* ipc unsupported */
816*4bff34e3Sthurlow #define	ERRnosuchshare	67	/* invalid share name */
817*4bff34e3Sthurlow #define	ERRtoomanynames	68
818*4bff34e3Sthurlow #define	ERRfilexists	80	/* requested file name already exists */
819*4bff34e3Sthurlow #define	ERRinvalidparam 87
820*4bff34e3Sthurlow #define	ERRcannotopen	110	/* cannot open the file */
821*4bff34e3Sthurlow #define	ERRinsufficientbuffer 122
822*4bff34e3Sthurlow #define	ERRinvalidname	123
823*4bff34e3Sthurlow #define	ERRunknownlevel 124
824*4bff34e3Sthurlow #define	ERRdirnotempty	145
825*4bff34e3Sthurlow #define	ERRnotlocked	158	/* region was not locked by this context */
826*4bff34e3Sthurlow #define	ERRrename	183
827*4bff34e3Sthurlow #define	ERRbadpipe	230	/* named pipe invalid */
828*4bff34e3Sthurlow #define	ERRpipebusy	231	/* all pipe instances are busy */
829*4bff34e3Sthurlow #define	ERRpipeclosing	232	/* close in progress */
830*4bff34e3Sthurlow #define	ERRnotconnected	233	/* nobody on other end of pipe */
831*4bff34e3Sthurlow #define	ERRmoredata	234	/* more data to be returned */
832*4bff34e3Sthurlow #define	ERRnomoreitems 259
833*4bff34e3Sthurlow #define	ERRbaddirectory	267	/* invalid directory name */
834*4bff34e3Sthurlow #define	ERReasunsupported	282	/* extended attributes not supported */
835*4bff34e3Sthurlow #define	ERRlogonfailure 1326
836*4bff34e3Sthurlow #define	ERRbuftoosmall	2123
837*4bff34e3Sthurlow #define	ERRunknownipc	2142
838*4bff34e3Sthurlow #define	ERRnosuchprintjob	2151
839*4bff34e3Sthurlow #define	ERRinvgroup 2455
840*4bff34e3Sthurlow 
841*4bff34e3Sthurlow /*
842*4bff34e3Sthurlow  * Error codes for the ERRSRV class
843*4bff34e3Sthurlow  */
844*4bff34e3Sthurlow #define	ERRerror	1	/* Non-specific error code */
845*4bff34e3Sthurlow #define	ERRbadpw	2	/* Bad password */
846*4bff34e3Sthurlow #define	ERRbadtype	3	/* reserved */
847*4bff34e3Sthurlow #define	ERRaccess	4	/* client doesn't have enough access rights */
848*4bff34e3Sthurlow #define	ERRinvnid	5	/* The Tid specified in a command is invalid */
849*4bff34e3Sthurlow #define	ERRinvnetname	6	/* Invalid server name in the tree connect */
850*4bff34e3Sthurlow #define	ERRinvdevice	7	/* Printer and not printer devices are mixed */
851*4bff34e3Sthurlow #define	ERRqfull	49	/* Print queue full */
852*4bff34e3Sthurlow #define	ERRqtoobig	50	/* Print queue full - no space */
853*4bff34e3Sthurlow #define	ERRinvpfid	52	/* Invalid print file FID */
854*4bff34e3Sthurlow #define	ERRsmbcmd	64	/* The server did not recognise the command */
855*4bff34e3Sthurlow #define	ERRsrverror	65	/* The server encountered and internal error */
856*4bff34e3Sthurlow #define	ERRfilespecs	67	/* The Fid and path name contains an */
857*4bff34e3Sthurlow 				/* invalid combination */
858*4bff34e3Sthurlow #define	ERRbadpermits	69	/* Access mode invalid */
859*4bff34e3Sthurlow #define	ERRsetattrmode	71	/* Attribute mode invalid */
860*4bff34e3Sthurlow #define	ERRpaused	81	/* Server is paused */
861*4bff34e3Sthurlow #define	ERRmsgoff	82	/* Not receiving messages */
862*4bff34e3Sthurlow #define	ERRnoroom	83	/* No room to buffer message */
863*4bff34e3Sthurlow #define	ERRrmuns	87	/* Too many remote user names */
864*4bff34e3Sthurlow #define	ERRtimeout	88	/* Operation timed out */
865*4bff34e3Sthurlow #define	ERRnoresource	89	/* No resources currently available for req */
866*4bff34e3Sthurlow #define	ERRtoomanyuids	90	/* Too many UIDs active on this session */
867*4bff34e3Sthurlow #define	ERRbaduid	91	/* The UID is not known in this session */
868*4bff34e3Sthurlow #define	ERRusempx	250	/* Temporarily unable to support Raw, */
869*4bff34e3Sthurlow 				/* use MPX mode */
870*4bff34e3Sthurlow #define	ERRusestd	251	/* Temporarily unable to support Raw, */
871*4bff34e3Sthurlow 				/* use stdandard r/w */
872*4bff34e3Sthurlow #define	ERRcontmpx	252	/* Continue in MPX mode */
873*4bff34e3Sthurlow #define	ERRacctexpired	2239
874*4bff34e3Sthurlow #define	ERRnosupport	65535	/* Invalid function */
875*4bff34e3Sthurlow 
876*4bff34e3Sthurlow /*
877*4bff34e3Sthurlow  * Error codes for the ERRHRD class
878*4bff34e3Sthurlow  */
879*4bff34e3Sthurlow #define	ERRnowrite	19	/* write protected media */
880*4bff34e3Sthurlow #define	ERRbadunit	20	/* Unknown unit */
881*4bff34e3Sthurlow #define	ERRnotready	21	/* Drive not ready */
882*4bff34e3Sthurlow #define	ERRbadcmd	22	/* Unknown command */
883*4bff34e3Sthurlow #define	ERRdata		23	/* Data error (CRC) */
884*4bff34e3Sthurlow #define	ERRbadreq	24	/* Bad request structure length */
885*4bff34e3Sthurlow #define	ERRseek		25	/* Seek error */
886*4bff34e3Sthurlow #define	ERRbadmedia	26	/* Unknown media type */
887*4bff34e3Sthurlow #define	ERRbadsector	27	/* Sector not found */
888*4bff34e3Sthurlow #define	ERRnopaper	28	/* Printer out of paper */
889*4bff34e3Sthurlow #define	ERRwrite	29	/* Write fault */
890*4bff34e3Sthurlow #define	ERRread		30	/* Read fault */
891*4bff34e3Sthurlow #define	ERRgeneral	31	/* General failure */
892*4bff34e3Sthurlow #define	ERRbadshare	32	/* A open conflicts with an existing open */
893*4bff34e3Sthurlow #define	ERRlock		33	/* lock/unlock conflict */
894*4bff34e3Sthurlow #define	ERRwrongdisk	34	/* The wrong disk was found in a drive */
895*4bff34e3Sthurlow #define	ERRFCBunavail	35	/* No FCBs available */
896*4bff34e3Sthurlow #define	ERRsharebufexc	36	/* A sharing buffer has been exceeded */
897*4bff34e3Sthurlow #define	ERRdiskfull	39
898*4bff34e3Sthurlow 
899*4bff34e3Sthurlow /*
900*4bff34e3Sthurlow  * RAP error codes (it seems that they returned not only by RAP)
901*4bff34e3Sthurlow  */
902*4bff34e3Sthurlow #define	SMB_ERROR_ACCESS_DENIED		5
903*4bff34e3Sthurlow #define	SMB_ERROR_NETWORK_ACCESS_DENIED	65
904*4bff34e3Sthurlow #define	SMB_ERROR_MORE_DATA		ERRmoredata
905*4bff34e3Sthurlow 
906*4bff34e3Sthurlow /*
907*4bff34e3Sthurlow  * An INCOMPLETE list of 32 bit error codes
908*4bff34e3Sthurlow  * For more detail see MSDN and ntstatus.h in the MS DDK
909*4bff34e3Sthurlow  *
910*4bff34e3Sthurlow  * XXX - these should have the severity and "customer defined" fields
911*4bff34e3Sthurlow  * added back in, and smb_maperr32() shouldn't mask those fields out;
912*4bff34e3Sthurlow  * 0x80000005 is STATUS_BUFFER_OVERFLOW, with 0xC0000000 is
913*4bff34e3Sthurlow  * STATUS_ACCESS_VIOLATION, and we need to distinguish between them.
914*4bff34e3Sthurlow  * We use STATUS_BUFFER_OVERFLOW, and need to know its exact value,
915*4bff34e3Sthurlow  * so we #define	it correctly here; don't strip off the leading
916*4bff34e3Sthurlow  * 0x80000000 from it!
917*4bff34e3Sthurlow  */
918*4bff34e3Sthurlow #define	NT_STATUS_BUFFER_OVERFLOW	0x80000005
919*4bff34e3Sthurlow #define	NT_STATUS_UNSUCCESSFUL		0x0001
920*4bff34e3Sthurlow #define	NT_STATUS_NOT_IMPLEMENTED	0x0002
921*4bff34e3Sthurlow #define	NT_STATUS_INVALID_INFO_CLASS	0x0003
922*4bff34e3Sthurlow #define	NT_STATUS_INFO_LENGTH_MISMATCH	0x0004
923*4bff34e3Sthurlow #define	NT_STATUS_ACCESS_VIOLATION	0x0005
924*4bff34e3Sthurlow #define	NT_STATUS_IN_PAGE_ERROR		0x0006
925*4bff34e3Sthurlow #define	NT_STATUS_PAGEFILE_QUOTA	0x0007
926*4bff34e3Sthurlow #define	NT_STATUS_INVALID_HANDLE	0x0008
927*4bff34e3Sthurlow #define	NT_STATUS_BAD_INITIAL_STACK	0x0009
928*4bff34e3Sthurlow #define	NT_STATUS_BAD_INITIAL_PC	0x000a
929*4bff34e3Sthurlow #define	NT_STATUS_INVALID_CID		0x000b
930*4bff34e3Sthurlow #define	NT_STATUS_TIMER_NOT_CANCELED	0x000c
931*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER	0x000d
932*4bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_DEVICE	0x000e
933*4bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_FILE		0x000f
934*4bff34e3Sthurlow #define	NT_STATUS_INVALID_DEVICE_REQUEST	0x0010
935*4bff34e3Sthurlow #define	NT_STATUS_END_OF_FILE		0x0011
936*4bff34e3Sthurlow #define	NT_STATUS_WRONG_VOLUME		0x0012
937*4bff34e3Sthurlow #define	NT_STATUS_NO_MEDIA_IN_DEVICE	0x0013
938*4bff34e3Sthurlow #define	NT_STATUS_UNRECOGNIZED_MEDIA	0x0014
939*4bff34e3Sthurlow #define	NT_STATUS_NONEXISTENT_SECTOR	0x0015
940*4bff34e3Sthurlow #define	NT_STATUS_MORE_PROCESSING_REQUIRED	0x0016
941*4bff34e3Sthurlow #define	NT_STATUS_NO_MEMORY		0x0017
942*4bff34e3Sthurlow #define	NT_STATUS_CONFLICTING_ADDRESSES	0x0018
943*4bff34e3Sthurlow #define	NT_STATUS_NOT_MAPPED_VIEW	0x0019
944*4bff34e3Sthurlow #define	NT_STATUS_UNABLE_TO_FREE_VM	0x001a
945*4bff34e3Sthurlow #define	NT_STATUS_UNABLE_TO_DELETE_SECTION	0x001b
946*4bff34e3Sthurlow #define	NT_STATUS_INVALID_SYSTEM_SERVICE	0x001c
947*4bff34e3Sthurlow #define	NT_STATUS_ILLEGAL_INSTRUCTION	0x001d
948*4bff34e3Sthurlow #define	NT_STATUS_INVALID_LOCK_SEQUENCE	0x001e
949*4bff34e3Sthurlow #define	NT_STATUS_INVALID_VIEW_SIZE	0x001f
950*4bff34e3Sthurlow #define	NT_STATUS_INVALID_FILE_FOR_SECTION	0x0020
951*4bff34e3Sthurlow #define	NT_STATUS_ALREADY_COMMITTED	0x0021
952*4bff34e3Sthurlow #define	NT_STATUS_ACCESS_DENIED		0x0022
953*4bff34e3Sthurlow #define	NT_STATUS_BUFFER_TOO_SMALL	0x0023
954*4bff34e3Sthurlow #define	NT_STATUS_OBJECT_TYPE_MISMATCH	0x0024
955*4bff34e3Sthurlow #define	NT_STATUS_NONCONTINUABLE_EXCEPTION	0x0025
956*4bff34e3Sthurlow #define	NT_STATUS_INVALID_DISPOSITION	0x0026
957*4bff34e3Sthurlow #define	NT_STATUS_UNWIND		0x0027
958*4bff34e3Sthurlow #define	NT_STATUS_BAD_STACK		0x0028
959*4bff34e3Sthurlow #define	NT_STATUS_INVALID_UNWIND_TARGET	0x0029
960*4bff34e3Sthurlow #define	NT_STATUS_NOT_LOCKED		0x002a
961*4bff34e3Sthurlow #define	NT_STATUS_PARITY_ERROR		0x002b
962*4bff34e3Sthurlow #define	NT_STATUS_UNABLE_TO_DECOMMIT_VM	0x002c
963*4bff34e3Sthurlow #define	NT_STATUS_NOT_COMMITTED		0x002d
964*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PORT_ATTRIBUTES	0x002e
965*4bff34e3Sthurlow #define	NT_STATUS_PORT_MESSAGE_TOO_LONG	0x002f
966*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_MIX	0x0030
967*4bff34e3Sthurlow #define	NT_STATUS_INVALID_QUOTA_LOWER	0x0031
968*4bff34e3Sthurlow #define	NT_STATUS_DISK_CORRUPT_ERROR	0x0032
969*4bff34e3Sthurlow #define	NT_STATUS_OBJECT_NAME_INVALID	0x0033
970*4bff34e3Sthurlow #define	NT_STATUS_OBJECT_NAME_NOT_FOUND	0x0034
971*4bff34e3Sthurlow #define	NT_STATUS_OBJECT_NAME_COLLISION	0x0035
972*4bff34e3Sthurlow #define	NT_STATUS_HANDLE_NOT_WAITABLE	0x0036
973*4bff34e3Sthurlow #define	NT_STATUS_PORT_DISCONNECTED	0x0037
974*4bff34e3Sthurlow #define	NT_STATUS_DEVICE_ALREADY_ATTACHED	0x0038
975*4bff34e3Sthurlow #define	NT_STATUS_OBJECT_PATH_INVALID	0x0039
976*4bff34e3Sthurlow #define	NT_STATUS_OBJECT_PATH_NOT_FOUND	0x003a
977*4bff34e3Sthurlow #define	NT_STATUS_OBJECT_PATH_SYNTAX_BAD	0x003b
978*4bff34e3Sthurlow #define	NT_STATUS_DATA_OVERRUN		0x003c
979*4bff34e3Sthurlow #define	NT_STATUS_DATA_LATE_ERROR	0x003d
980*4bff34e3Sthurlow #define	NT_STATUS_DATA_ERROR		0x003e
981*4bff34e3Sthurlow #define	NT_STATUS_CRC_ERROR		0x003f
982*4bff34e3Sthurlow #define	NT_STATUS_SECTION_TOO_BIG	0x0040
983*4bff34e3Sthurlow #define	NT_STATUS_PORT_CONNECTION_REFUSED	0x0041
984*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PORT_HANDLE	0x0042
985*4bff34e3Sthurlow #define	NT_STATUS_SHARING_VIOLATION	0x0043
986*4bff34e3Sthurlow #define	NT_STATUS_QUOTA_EXCEEDED	0x0044
987*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PAGE_PROTECTION	0x0045
988*4bff34e3Sthurlow #define	NT_STATUS_MUTANT_NOT_OWNED	0x0046
989*4bff34e3Sthurlow #define	NT_STATUS_SEMAPHORE_LIMIT_EXCEEDED	0x0047
990*4bff34e3Sthurlow #define	NT_STATUS_PORT_ALREADY_SET	0x0048
991*4bff34e3Sthurlow #define	NT_STATUS_SECTION_NOT_IMAGE	0x0049
992*4bff34e3Sthurlow #define	NT_STATUS_SUSPEND_COUNT_EXCEEDED	0x004a
993*4bff34e3Sthurlow #define	NT_STATUS_THREAD_IS_TERMINATING	0x004b
994*4bff34e3Sthurlow #define	NT_STATUS_BAD_WORKING_SET_LIMIT	0x004c
995*4bff34e3Sthurlow #define	NT_STATUS_INCOMPATIBLE_FILE_MAP	0x004d
996*4bff34e3Sthurlow #define	NT_STATUS_SECTION_PROTECTION	0x004e
997*4bff34e3Sthurlow #define	NT_STATUS_EAS_NOT_SUPPORTED	0x004f
998*4bff34e3Sthurlow #define	NT_STATUS_EA_TOO_LARGE		0x0050
999*4bff34e3Sthurlow #define	NT_STATUS_NONEXISTENT_EA_ENTRY	0x0051
1000*4bff34e3Sthurlow #define	NT_STATUS_NO_EAS_ON_FILE	0x0052
1001*4bff34e3Sthurlow #define	NT_STATUS_EA_CORRUPT_ERROR	0x0053
1002*4bff34e3Sthurlow #define	NT_STATUS_FILE_LOCK_CONFLICT	0x0054
1003*4bff34e3Sthurlow #define	NT_STATUS_LOCK_NOT_GRANTED	0x0055
1004*4bff34e3Sthurlow #define	NT_STATUS_DELETE_PENDING	0x0056
1005*4bff34e3Sthurlow #define	NT_STATUS_CTL_FILE_NOT_SUPPORTED	0x0057
1006*4bff34e3Sthurlow #define	NT_STATUS_UNKNOWN_REVISION	0x0058
1007*4bff34e3Sthurlow #define	NT_STATUS_REVISION_MISMATCH	0x0059
1008*4bff34e3Sthurlow #define	NT_STATUS_INVALID_OWNER		0x005a
1009*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PRIMARY_GROUP	0x005b
1010*4bff34e3Sthurlow #define	NT_STATUS_NO_IMPERSONATION_TOKEN	0x005c
1011*4bff34e3Sthurlow #define	NT_STATUS_CANT_DISABLE_MANDATORY	0x005d
1012*4bff34e3Sthurlow #define	NT_STATUS_NO_LOGON_SERVERS	0x005e
1013*4bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_LOGON_SESSION	0x005f
1014*4bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_PRIVILEGE	0x0060
1015*4bff34e3Sthurlow #define	NT_STATUS_PRIVILEGE_NOT_HELD	0x0061
1016*4bff34e3Sthurlow #define	NT_STATUS_INVALID_ACCOUNT_NAME	0x0062
1017*4bff34e3Sthurlow #define	NT_STATUS_USER_EXISTS		0x0063
1018*4bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_USER		0x0064
1019*4bff34e3Sthurlow #define	NT_STATUS_GROUP_EXISTS		0x0065
1020*4bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_GROUP		0x0066
1021*4bff34e3Sthurlow #define	NT_STATUS_MEMBER_IN_GROUP	0x0067
1022*4bff34e3Sthurlow #define	NT_STATUS_MEMBER_NOT_IN_GROUP	0x0068
1023*4bff34e3Sthurlow #define	NT_STATUS_LAST_ADMIN		0x0069
1024*4bff34e3Sthurlow #define	NT_STATUS_WRONG_PASSWORD	0x006a
1025*4bff34e3Sthurlow #define	NT_STATUS_ILL_FORMED_PASSWORD	0x006b
1026*4bff34e3Sthurlow #define	NT_STATUS_PASSWORD_RESTRICTION	0x006c
1027*4bff34e3Sthurlow #define	NT_STATUS_LOGON_FAILURE		0x006d
1028*4bff34e3Sthurlow #define	NT_STATUS_ACCOUNT_RESTRICTION	0x006e
1029*4bff34e3Sthurlow #define	NT_STATUS_INVALID_LOGON_HOURS	0x006f
1030*4bff34e3Sthurlow #define	NT_STATUS_INVALID_WORKSTATION	0x0070
1031*4bff34e3Sthurlow #define	NT_STATUS_PASSWORD_EXPIRED	0x0071
1032*4bff34e3Sthurlow #define	NT_STATUS_ACCOUNT_DISABLED	0x0072
1033*4bff34e3Sthurlow #define	NT_STATUS_NONE_MAPPED		0x0073
1034*4bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_LUIDS_REQUESTED	0x0074
1035*4bff34e3Sthurlow #define	NT_STATUS_LUIDS_EXHAUSTED	0x0075
1036*4bff34e3Sthurlow #define	NT_STATUS_INVALID_SUB_AUTHORITY	0x0076
1037*4bff34e3Sthurlow #define	NT_STATUS_INVALID_ACL		0x0077
1038*4bff34e3Sthurlow #define	NT_STATUS_INVALID_SID		0x0078
1039*4bff34e3Sthurlow #define	NT_STATUS_INVALID_SECURITY_DESCR	0x0079
1040*4bff34e3Sthurlow #define	NT_STATUS_PROCEDURE_NOT_FOUND	0x007a
1041*4bff34e3Sthurlow #define	NT_STATUS_INVALID_IMAGE_FORMAT	0x007b
1042*4bff34e3Sthurlow #define	NT_STATUS_NO_TOKEN		0x007c
1043*4bff34e3Sthurlow #define	NT_STATUS_BAD_INHERITANCE_ACL	0x007d
1044*4bff34e3Sthurlow #define	NT_STATUS_RANGE_NOT_LOCKED	0x007e
1045*4bff34e3Sthurlow #define	NT_STATUS_DISK_FULL		0x007f
1046*4bff34e3Sthurlow #define	NT_STATUS_SERVER_DISABLED	0x0080
1047*4bff34e3Sthurlow #define	NT_STATUS_SERVER_NOT_DISABLED	0x0081
1048*4bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_GUIDS_REQUESTED	0x0082
1049*4bff34e3Sthurlow #define	NT_STATUS_GUIDS_EXHAUSTED	0x0083
1050*4bff34e3Sthurlow #define	NT_STATUS_INVALID_ID_AUTHORITY	0x0084
1051*4bff34e3Sthurlow #define	NT_STATUS_AGENTS_EXHAUSTED	0x0085
1052*4bff34e3Sthurlow #define	NT_STATUS_INVALID_VOLUME_LABEL	0x0086
1053*4bff34e3Sthurlow #define	NT_STATUS_SECTION_NOT_EXTENDED	0x0087
1054*4bff34e3Sthurlow #define	NT_STATUS_NOT_MAPPED_DATA	0x0088
1055*4bff34e3Sthurlow #define	NT_STATUS_RESOURCE_DATA_NOT_FOUND	0x0089
1056*4bff34e3Sthurlow #define	NT_STATUS_RESOURCE_TYPE_NOT_FOUND	0x008a
1057*4bff34e3Sthurlow #define	NT_STATUS_RESOURCE_NAME_NOT_FOUND	0x008b
1058*4bff34e3Sthurlow #define	NT_STATUS_ARRAY_BOUNDS_EXCEEDED	0x008c
1059*4bff34e3Sthurlow #define	NT_STATUS_FLOAT_DENORMAL_OPERAND	0x008d
1060*4bff34e3Sthurlow #define	NT_STATUS_FLOAT_DIVIDE_BY_ZERO	0x008e
1061*4bff34e3Sthurlow #define	NT_STATUS_FLOAT_INEXACT_RESULT	0x008f
1062*4bff34e3Sthurlow #define	NT_STATUS_FLOAT_INVALID_OPERATION	0x0090
1063*4bff34e3Sthurlow #define	NT_STATUS_FLOAT_OVERFLOW	0x0091
1064*4bff34e3Sthurlow #define	NT_STATUS_FLOAT_STACK_CHECK	0x0092
1065*4bff34e3Sthurlow #define	NT_STATUS_FLOAT_UNDERFLOW	0x0093
1066*4bff34e3Sthurlow #define	NT_STATUS_INTEGER_DIVIDE_BY_ZERO	0x0094
1067*4bff34e3Sthurlow #define	NT_STATUS_INTEGER_OVERFLOW	0x0095
1068*4bff34e3Sthurlow #define	NT_STATUS_PRIVILEGED_INSTRUCTION	0x0096
1069*4bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_PAGING_FILES	0x0097
1070*4bff34e3Sthurlow #define	NT_STATUS_FILE_INVALID	0x0098
1071*4bff34e3Sthurlow #define	NT_STATUS_ALLOTTED_SPACE_EXCEEDED	0x0099
1072*4bff34e3Sthurlow #define	NT_STATUS_INSUFFICIENT_RESOURCES	0x009a
1073*4bff34e3Sthurlow #define	NT_STATUS_DFS_EXIT_PATH_FOUND	0x009b
1074*4bff34e3Sthurlow #define	NT_STATUS_DEVICE_DATA_ERROR	0x009c
1075*4bff34e3Sthurlow #define	NT_STATUS_DEVICE_NOT_CONNECTED	0x009d
1076*4bff34e3Sthurlow #define	NT_STATUS_DEVICE_POWER_FAILURE	0x009e
1077*4bff34e3Sthurlow #define	NT_STATUS_FREE_VM_NOT_AT_BASE	0x009f
1078*4bff34e3Sthurlow #define	NT_STATUS_MEMORY_NOT_ALLOCATED	0x00a0
1079*4bff34e3Sthurlow #define	NT_STATUS_WORKING_SET_QUOTA	0x00a1
1080*4bff34e3Sthurlow #define	NT_STATUS_MEDIA_WRITE_PROTECTED	0x00a2
1081*4bff34e3Sthurlow #define	NT_STATUS_DEVICE_NOT_READY	0x00a3
1082*4bff34e3Sthurlow #define	NT_STATUS_INVALID_GROUP_ATTRIBUTES	0x00a4
1083*4bff34e3Sthurlow #define	NT_STATUS_BAD_IMPERSONATION_LEVEL	0x00a5
1084*4bff34e3Sthurlow #define	NT_STATUS_CANT_OPEN_ANONYMOUS	0x00a6
1085*4bff34e3Sthurlow #define	NT_STATUS_BAD_VALIDATION_CLASS	0x00a7
1086*4bff34e3Sthurlow #define	NT_STATUS_BAD_TOKEN_TYPE	0x00a8
1087*4bff34e3Sthurlow #define	NT_STATUS_BAD_MASTER_BOOT_RECORD	0x00a9
1088*4bff34e3Sthurlow #define	NT_STATUS_INSTRUCTION_MISALIGNMENT	0x00aa
1089*4bff34e3Sthurlow #define	NT_STATUS_INSTANCE_NOT_AVAILABLE	0x00ab
1090*4bff34e3Sthurlow #define	NT_STATUS_PIPE_NOT_AVAILABLE	0x00ac
1091*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PIPE_STATE	0x00ad
1092*4bff34e3Sthurlow #define	NT_STATUS_PIPE_BUSY		0x00ae
1093*4bff34e3Sthurlow #define	NT_STATUS_ILLEGAL_FUNCTION	0x00af
1094*4bff34e3Sthurlow #define	NT_STATUS_PIPE_DISCONNECTED	0x00b0
1095*4bff34e3Sthurlow #define	NT_STATUS_PIPE_CLOSING		0x00b1
1096*4bff34e3Sthurlow #define	NT_STATUS_PIPE_CONNECTED	0x00b2
1097*4bff34e3Sthurlow #define	NT_STATUS_PIPE_LISTENING	0x00b3
1098*4bff34e3Sthurlow #define	NT_STATUS_INVALID_READ_MODE	0x00b4
1099*4bff34e3Sthurlow #define	NT_STATUS_IO_TIMEOUT		0x00b5
1100*4bff34e3Sthurlow #define	NT_STATUS_FILE_FORCED_CLOSED	0x00b6
1101*4bff34e3Sthurlow #define	NT_STATUS_PROFILING_NOT_STARTED	0x00b7
1102*4bff34e3Sthurlow #define	NT_STATUS_PROFILING_NOT_STOPPED	0x00b8
1103*4bff34e3Sthurlow #define	NT_STATUS_COULD_NOT_INTERPRET	0x00b9
1104*4bff34e3Sthurlow #define	NT_STATUS_FILE_IS_A_DIRECTORY	0x00ba
1105*4bff34e3Sthurlow #define	NT_STATUS_NOT_SUPPORTED		0x00bb
1106*4bff34e3Sthurlow #define	NT_STATUS_REMOTE_NOT_LISTENING	0x00bc
1107*4bff34e3Sthurlow #define	NT_STATUS_DUPLICATE_NAME	0x00bd
1108*4bff34e3Sthurlow #define	NT_STATUS_BAD_NETWORK_PATH	0x00be
1109*4bff34e3Sthurlow #define	NT_STATUS_NETWORK_BUSY		0x00bf
1110*4bff34e3Sthurlow #define	NT_STATUS_DEVICE_DOES_NOT_EXIST	0x00c0
1111*4bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_COMMANDS	0x00c1
1112*4bff34e3Sthurlow #define	NT_STATUS_ADAPTER_HARDWARE_ERROR	0x00c2
1113*4bff34e3Sthurlow #define	NT_STATUS_INVALID_NETWORK_RESPONSE	0x00c3
1114*4bff34e3Sthurlow #define	NT_STATUS_UNEXPECTED_NETWORK_ERROR	0x00c4
1115*4bff34e3Sthurlow #define	NT_STATUS_BAD_REMOTE_ADAPTER	0x00c5
1116*4bff34e3Sthurlow #define	NT_STATUS_PRINT_QUEUE_FULL	0x00c6
1117*4bff34e3Sthurlow #define	NT_STATUS_NO_SPOOL_SPACE	0x00c7
1118*4bff34e3Sthurlow #define	NT_STATUS_PRINT_CANCELLED	0x00c8
1119*4bff34e3Sthurlow #define	NT_STATUS_NETWORK_NAME_DELETED	0x00c9
1120*4bff34e3Sthurlow #define	NT_STATUS_NETWORK_ACCESS_DENIED	0x00ca
1121*4bff34e3Sthurlow #define	NT_STATUS_BAD_DEVICE_TYPE	0x00cb
1122*4bff34e3Sthurlow #define	NT_STATUS_BAD_NETWORK_NAME	0x00cc
1123*4bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_NAMES	0x00cd
1124*4bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_SESSIONS	0x00ce
1125*4bff34e3Sthurlow #define	NT_STATUS_SHARING_PAUSED	0x00cf
1126*4bff34e3Sthurlow #define	NT_STATUS_REQUEST_NOT_ACCEPTED	0x00d0
1127*4bff34e3Sthurlow #define	NT_STATUS_REDIRECTOR_PAUSED	0x00d1
1128*4bff34e3Sthurlow #define	NT_STATUS_NET_WRITE_FAULT	0x00d2
1129*4bff34e3Sthurlow #define	NT_STATUS_PROFILING_AT_LIMIT	0x00d3
1130*4bff34e3Sthurlow #define	NT_STATUS_NOT_SAME_DEVICE	0x00d4
1131*4bff34e3Sthurlow #define	NT_STATUS_FILE_RENAMED		0x00d5
1132*4bff34e3Sthurlow #define	NT_STATUS_VIRTUAL_CIRCUIT_CLOSED	0x00d6
1133*4bff34e3Sthurlow #define	NT_STATUS_NO_SECURITY_ON_OBJECT	0x00d7
1134*4bff34e3Sthurlow #define	NT_STATUS_CANT_WAIT		0x00d8
1135*4bff34e3Sthurlow #define	NT_STATUS_PIPE_EMPTY		0x00d9
1136*4bff34e3Sthurlow #define	NT_STATUS_CANT_ACCESS_DOMAIN_INFO	0x00da
1137*4bff34e3Sthurlow #define	NT_STATUS_CANT_TERMINATE_SELF	0x00db
1138*4bff34e3Sthurlow #define	NT_STATUS_INVALID_SERVER_STATE	0x00dc
1139*4bff34e3Sthurlow #define	NT_STATUS_INVALID_DOMAIN_STATE	0x00dd
1140*4bff34e3Sthurlow #define	NT_STATUS_INVALID_DOMAIN_ROLE	0x00de
1141*4bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_DOMAIN	0x00df
1142*4bff34e3Sthurlow #define	NT_STATUS_DOMAIN_EXISTS		0x00e0
1143*4bff34e3Sthurlow #define	NT_STATUS_DOMAIN_LIMIT_EXCEEDED	0x00e1
1144*4bff34e3Sthurlow #define	NT_STATUS_OPLOCK_NOT_GRANTED	0x00e2
1145*4bff34e3Sthurlow #define	NT_STATUS_INVALID_OPLOCK_PROTOCOL	0x00e3
1146*4bff34e3Sthurlow #define	NT_STATUS_INTERNAL_DB_CORRUPTION	0x00e4
1147*4bff34e3Sthurlow #define	NT_STATUS_INTERNAL_ERROR	0x00e5
1148*4bff34e3Sthurlow #define	NT_STATUS_GENERIC_NOT_MAPPED	0x00e6
1149*4bff34e3Sthurlow #define	NT_STATUS_BAD_DESCRIPTOR_FORMAT	0x00e7
1150*4bff34e3Sthurlow #define	NT_STATUS_INVALID_USER_BUFFER	0x00e8
1151*4bff34e3Sthurlow #define	NT_STATUS_UNEXPECTED_IO_ERROR	0x00e9
1152*4bff34e3Sthurlow #define	NT_STATUS_UNEXPECTED_MM_CREATE_ERR	0x00ea
1153*4bff34e3Sthurlow #define	NT_STATUS_UNEXPECTED_MM_MAP_ERROR	0x00eb
1154*4bff34e3Sthurlow #define	NT_STATUS_UNEXPECTED_MM_EXTEND_ERR	0x00ec
1155*4bff34e3Sthurlow #define	NT_STATUS_NOT_LOGON_PROCESS	0x00ed
1156*4bff34e3Sthurlow #define	NT_STATUS_LOGON_SESSION_EXISTS	0x00ee
1157*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_1	0x00ef
1158*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_2	0x00f0
1159*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_3	0x00f1
1160*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_4	0x00f2
1161*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_5	0x00f3
1162*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_6	0x00f4
1163*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_7	0x00f5
1164*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_8	0x00f6
1165*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_9	0x00f7
1166*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_10	0x00f8
1167*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_11	0x00f9
1168*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_12	0x00fa
1169*4bff34e3Sthurlow #define	NT_STATUS_REDIRECTOR_NOT_STARTED	0x00fb
1170*4bff34e3Sthurlow #define	NT_STATUS_REDIRECTOR_STARTED	0x00fc
1171*4bff34e3Sthurlow #define	NT_STATUS_STACK_OVERFLOW	0x00fd
1172*4bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_PACKAGE	0x00fe
1173*4bff34e3Sthurlow #define	NT_STATUS_BAD_FUNCTION_TABLE	0x00ff
1174*4bff34e3Sthurlow #define	NT_STATUS_VARIABLE_NOT_FOUND	0x0100
1175*4bff34e3Sthurlow #define	NT_STATUS_DIRECTORY_NOT_EMPTY	0x0101
1176*4bff34e3Sthurlow #define	NT_STATUS_FILE_CORRUPT_ERROR	0x0102
1177*4bff34e3Sthurlow #define	NT_STATUS_NOT_A_DIRECTORY	0x0103
1178*4bff34e3Sthurlow #define	NT_STATUS_BAD_LOGON_SESSION_STATE	0x0104
1179*4bff34e3Sthurlow #define	NT_STATUS_LOGON_SESSION_COLLISION	0x0105
1180*4bff34e3Sthurlow #define	NT_STATUS_NAME_TOO_LONG		0x0106
1181*4bff34e3Sthurlow #define	NT_STATUS_FILES_OPEN		0x0107
1182*4bff34e3Sthurlow #define	NT_STATUS_CONNECTION_IN_USE	0x0108
1183*4bff34e3Sthurlow #define	NT_STATUS_MESSAGE_NOT_FOUND	0x0109
1184*4bff34e3Sthurlow #define	NT_STATUS_PROCESS_IS_TERMINATING	0x010a
1185*4bff34e3Sthurlow #define	NT_STATUS_INVALID_LOGON_TYPE	0x010b
1186*4bff34e3Sthurlow #define	NT_STATUS_NO_GUID_TRANSLATION	0x010c
1187*4bff34e3Sthurlow #define	NT_STATUS_CANNOT_IMPERSONATE	0x010d
1188*4bff34e3Sthurlow #define	NT_STATUS_IMAGE_ALREADY_LOADED	0x010e
1189*4bff34e3Sthurlow #define	NT_STATUS_ABIOS_NOT_PRESENT	0x010f
1190*4bff34e3Sthurlow #define	NT_STATUS_ABIOS_LID_NOT_EXIST	0x0110
1191*4bff34e3Sthurlow #define	NT_STATUS_ABIOS_LID_ALREADY_OWNED	0x0111
1192*4bff34e3Sthurlow #define	NT_STATUS_ABIOS_NOT_LID_OWNER	0x0112
1193*4bff34e3Sthurlow #define	NT_STATUS_ABIOS_INVALID_COMMAND	0x0113
1194*4bff34e3Sthurlow #define	NT_STATUS_ABIOS_INVALID_LID	0x0114
1195*4bff34e3Sthurlow #define	NT_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE	0x0115
1196*4bff34e3Sthurlow #define	NT_STATUS_ABIOS_INVALID_SELECTOR	0x0116
1197*4bff34e3Sthurlow #define	NT_STATUS_NO_LDT		0x0117
1198*4bff34e3Sthurlow #define	NT_STATUS_INVALID_LDT_SIZE	0x0118
1199*4bff34e3Sthurlow #define	NT_STATUS_INVALID_LDT_OFFSET	0x0119
1200*4bff34e3Sthurlow #define	NT_STATUS_INVALID_LDT_DESCRIPTOR	0x011a
1201*4bff34e3Sthurlow #define	NT_STATUS_INVALID_IMAGE_NE_FORMAT	0x011b
1202*4bff34e3Sthurlow #define	NT_STATUS_RXACT_INVALID_STATE	0x011c
1203*4bff34e3Sthurlow #define	NT_STATUS_RXACT_COMMIT_FAILURE	0x011d
1204*4bff34e3Sthurlow #define	NT_STATUS_MAPPED_FILE_SIZE_ZERO	0x011e
1205*4bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_OPENED_FILES	0x011f
1206*4bff34e3Sthurlow #define	NT_STATUS_CANCELLED		0x0120
1207*4bff34e3Sthurlow #define	NT_STATUS_CANNOT_DELETE		0x0121
1208*4bff34e3Sthurlow #define	NT_STATUS_INVALID_COMPUTER_NAME	0x0122
1209*4bff34e3Sthurlow #define	NT_STATUS_FILE_DELETED		0x0123
1210*4bff34e3Sthurlow #define	NT_STATUS_SPECIAL_ACCOUNT	0x0124
1211*4bff34e3Sthurlow #define	NT_STATUS_SPECIAL_GROUP		0x0125
1212*4bff34e3Sthurlow #define	NT_STATUS_SPECIAL_USER		0x0126
1213*4bff34e3Sthurlow #define	NT_STATUS_MEMBERS_PRIMARY_GROUP	0x0127
1214*4bff34e3Sthurlow #define	NT_STATUS_FILE_CLOSED		0x0128
1215*4bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_THREADS	0x0129
1216*4bff34e3Sthurlow #define	NT_STATUS_THREAD_NOT_IN_PROCESS	0x012a
1217*4bff34e3Sthurlow #define	NT_STATUS_TOKEN_ALREADY_IN_USE	0x012b
1218*4bff34e3Sthurlow #define	NT_STATUS_PAGEFILE_QUOTA_EXCEEDED	0x012c
1219*4bff34e3Sthurlow #define	NT_STATUS_COMMITMENT_LIMIT	0x012d
1220*4bff34e3Sthurlow #define	NT_STATUS_INVALID_IMAGE_LE_FORMAT	0x012e
1221*4bff34e3Sthurlow #define	NT_STATUS_INVALID_IMAGE_NOT_MZ	0x012f
1222*4bff34e3Sthurlow #define	NT_STATUS_INVALID_IMAGE_PROTECT	0x0130
1223*4bff34e3Sthurlow #define	NT_STATUS_INVALID_IMAGE_WIN_16	0x0131
1224*4bff34e3Sthurlow #define	NT_STATUS_LOGON_SERVER_CONFLICT	0x0132
1225*4bff34e3Sthurlow #define	NT_STATUS_TIME_DIFFERENCE_AT_DC	0x0133
1226*4bff34e3Sthurlow #define	NT_STATUS_SYNCHRONIZATION_REQUIRED	0x0134
1227*4bff34e3Sthurlow #define	NT_STATUS_DLL_NOT_FOUND		0x0135
1228*4bff34e3Sthurlow #define	NT_STATUS_OPEN_FAILED		0x0136
1229*4bff34e3Sthurlow #define	NT_STATUS_IO_PRIVILEGE_FAILED	0x0137
1230*4bff34e3Sthurlow #define	NT_STATUS_ORDINAL_NOT_FOUND	0x0138
1231*4bff34e3Sthurlow #define	NT_STATUS_ENTRYPOINT_NOT_FOUND	0x0139
1232*4bff34e3Sthurlow #define	NT_STATUS_CONTROL_C_EXIT	0x013a
1233*4bff34e3Sthurlow #define	NT_STATUS_LOCAL_DISCONNECT	0x013b
1234*4bff34e3Sthurlow #define	NT_STATUS_REMOTE_DISCONNECT	0x013c
1235*4bff34e3Sthurlow #define	NT_STATUS_REMOTE_RESOURCES	0x013d
1236*4bff34e3Sthurlow #define	NT_STATUS_LINK_FAILED		0x013e
1237*4bff34e3Sthurlow #define	NT_STATUS_LINK_TIMEOUT		0x013f
1238*4bff34e3Sthurlow #define	NT_STATUS_INVALID_CONNECTION	0x0140
1239*4bff34e3Sthurlow #define	NT_STATUS_INVALID_ADDRESS	0x0141
1240*4bff34e3Sthurlow #define	NT_STATUS_DLL_INIT_FAILED	0x0142
1241*4bff34e3Sthurlow #define	NT_STATUS_MISSING_SYSTEMFILE	0x0143
1242*4bff34e3Sthurlow #define	NT_STATUS_UNHANDLED_EXCEPTION	0x0144
1243*4bff34e3Sthurlow #define	NT_STATUS_APP_INIT_FAILURE	0x0145
1244*4bff34e3Sthurlow #define	NT_STATUS_PAGEFILE_CREATE_FAILED	0x0146
1245*4bff34e3Sthurlow #define	NT_STATUS_NO_PAGEFILE		0x0147
1246*4bff34e3Sthurlow #define	NT_STATUS_INVALID_LEVEL		0x0148
1247*4bff34e3Sthurlow #define	NT_STATUS_WRONG_PASSWORD_CORE	0x0149
1248*4bff34e3Sthurlow #define	NT_STATUS_ILLEGAL_FLOAT_CONTEXT	0x014a
1249*4bff34e3Sthurlow #define	NT_STATUS_PIPE_BROKEN		0x014b
1250*4bff34e3Sthurlow #define	NT_STATUS_REGISTRY_CORRUPT	0x014c
1251*4bff34e3Sthurlow #define	NT_STATUS_REGISTRY_IO_FAILED	0x014d
1252*4bff34e3Sthurlow #define	NT_STATUS_NO_EVENT_PAIR		0x014e
1253*4bff34e3Sthurlow #define	NT_STATUS_UNRECOGNIZED_VOLUME	0x014f
1254*4bff34e3Sthurlow #define	NT_STATUS_SERIAL_NO_DEVICE_INITED	0x0150
1255*4bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_ALIAS		0x0151
1256*4bff34e3Sthurlow #define	NT_STATUS_MEMBER_NOT_IN_ALIAS	0x0152
1257*4bff34e3Sthurlow #define	NT_STATUS_MEMBER_IN_ALIAS	0x0153
1258*4bff34e3Sthurlow #define	NT_STATUS_ALIAS_EXISTS		0x0154
1259*4bff34e3Sthurlow #define	NT_STATUS_LOGON_NOT_GRANTED	0x0155
1260*4bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_SECRETS	0x0156
1261*4bff34e3Sthurlow #define	NT_STATUS_SECRET_TOO_LONG	0x0157
1262*4bff34e3Sthurlow #define	NT_STATUS_INTERNAL_DB_ERROR	0x0158
1263*4bff34e3Sthurlow #define	NT_STATUS_FULLSCREEN_MODE	0x0159
1264*4bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_CONTEXT_IDS	0x015a
1265*4bff34e3Sthurlow #define	NT_STATUS_LOGON_TYPE_NOT_GRANTED	0x015b
1266*4bff34e3Sthurlow #define	NT_STATUS_NOT_REGISTRY_FILE	0x015c
1267*4bff34e3Sthurlow #define	NT_STATUS_NT_CROSS_ENCRYPTION_REQUIRED	0x015d
1268*4bff34e3Sthurlow #define	NT_STATUS_DOMAIN_CTRLR_CONFIG_ERROR	0x015e
1269*4bff34e3Sthurlow #define	NT_STATUS_FT_MISSING_MEMBER	0x015f
1270*4bff34e3Sthurlow #define	NT_STATUS_ILL_FORMED_SERVICE_ENTRY	0x0160
1271*4bff34e3Sthurlow #define	NT_STATUS_ILLEGAL_CHARACTER	0x0161
1272*4bff34e3Sthurlow #define	NT_STATUS_UNMAPPABLE_CHARACTER	0x0162
1273*4bff34e3Sthurlow #define	NT_STATUS_UNDEFINED_CHARACTER	0x0163
1274*4bff34e3Sthurlow #define	NT_STATUS_FLOPPY_VOLUME		0x0164
1275*4bff34e3Sthurlow #define	NT_STATUS_FLOPPY_ID_MARK_NOT_FOUND	0x0165
1276*4bff34e3Sthurlow #define	NT_STATUS_FLOPPY_WRONG_CYLINDER	0x0166
1277*4bff34e3Sthurlow #define	NT_STATUS_FLOPPY_UNKNOWN_ERROR	0x0167
1278*4bff34e3Sthurlow #define	NT_STATUS_FLOPPY_BAD_REGISTERS	0x0168
1279*4bff34e3Sthurlow #define	NT_STATUS_DISK_RECALIBRATE_FAILED	0x0169
1280*4bff34e3Sthurlow #define	NT_STATUS_DISK_OPERATION_FAILED	0x016a
1281*4bff34e3Sthurlow #define	NT_STATUS_DISK_RESET_FAILED	0x016b
1282*4bff34e3Sthurlow #define	NT_STATUS_SHARED_IRQ_BUSY	0x016c
1283*4bff34e3Sthurlow #define	NT_STATUS_FT_ORPHANING		0x016d
1284*4bff34e3Sthurlow #define	NT_STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT	0x016e
1285*4bff34e3Sthurlow #define	NT_STATUS_16F		0x016f
1286*4bff34e3Sthurlow #define	NT_STATUS_170		0x0170
1287*4bff34e3Sthurlow #define	NT_STATUS_171		0x0171
1288*4bff34e3Sthurlow #define	NT_STATUS_PARTITION_FAILURE	0x0172
1289*4bff34e3Sthurlow #define	NT_STATUS_INVALID_BLOCK_LENGTH	0x0173
1290*4bff34e3Sthurlow #define	NT_STATUS_DEVICE_NOT_PARTITIONED	0x0174
1291*4bff34e3Sthurlow #define	NT_STATUS_UNABLE_TO_LOCK_MEDIA	0x0175
1292*4bff34e3Sthurlow #define	NT_STATUS_UNABLE_TO_UNLOAD_MEDIA	0x0176
1293*4bff34e3Sthurlow #define	NT_STATUS_EOM_OVERFLOW		0x0177
1294*4bff34e3Sthurlow #define	NT_STATUS_NO_MEDIA		0x0178
1295*4bff34e3Sthurlow #define	NT_STATUS_179		0x0179
1296*4bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_MEMBER	0x017a
1297*4bff34e3Sthurlow #define	NT_STATUS_INVALID_MEMBER	0x017b
1298*4bff34e3Sthurlow #define	NT_STATUS_KEY_DELETED		0x017c
1299*4bff34e3Sthurlow #define	NT_STATUS_NO_LOG_SPACE		0x017d
1300*4bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_SIDS		0x017e
1301*4bff34e3Sthurlow #define	NT_STATUS_LM_CROSS_ENCRYPTION_REQUIRED	0x017f
1302*4bff34e3Sthurlow #define	NT_STATUS_KEY_HAS_CHILDREN	0x0180
1303*4bff34e3Sthurlow #define	NT_STATUS_CHILD_MUST_BE_VOLATILE	0x0181
1304*4bff34e3Sthurlow #define	NT_STATUS_DEVICE_CONFIGURATION_ERROR	0x0182
1305*4bff34e3Sthurlow #define	NT_STATUS_DRIVER_INTERNAL_ERROR	0x0183
1306*4bff34e3Sthurlow #define	NT_STATUS_INVALID_DEVICE_STATE	0x0184
1307*4bff34e3Sthurlow #define	NT_STATUS_IO_DEVICE_ERROR	0x0185
1308*4bff34e3Sthurlow #define	NT_STATUS_DEVICE_PROTOCOL_ERROR	0x0186
1309*4bff34e3Sthurlow #define	NT_STATUS_BACKUP_CONTROLLER	0x0187
1310*4bff34e3Sthurlow #define	NT_STATUS_LOG_FILE_FULL		0x0188
1311*4bff34e3Sthurlow #define	NT_STATUS_TOO_LATE		0x0189
1312*4bff34e3Sthurlow #define	NT_STATUS_NO_TRUST_LSA_SECRET	0x018a
1313*4bff34e3Sthurlow #define	NT_STATUS_NO_TRUST_SAM_ACCOUNT	0x018b
1314*4bff34e3Sthurlow #define	NT_STATUS_TRUSTED_DOMAIN_FAILURE	0x018c
1315*4bff34e3Sthurlow #define	NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE	0x018d
1316*4bff34e3Sthurlow #define	NT_STATUS_EVENTLOG_FILE_CORRUPT	0x018e
1317*4bff34e3Sthurlow #define	NT_STATUS_EVENTLOG_CANT_START	0x018f
1318*4bff34e3Sthurlow #define	NT_STATUS_TRUST_FAILURE		0x0190
1319*4bff34e3Sthurlow #define	NT_STATUS_MUTANT_LIMIT_EXCEEDED	0x0191
1320*4bff34e3Sthurlow #define	NT_STATUS_NETLOGON_NOT_STARTED	0x0192
1321*4bff34e3Sthurlow #define	NT_STATUS_ACCOUNT_EXPIRED	0x0193
1322*4bff34e3Sthurlow #define	NT_STATUS_POSSIBLE_DEADLOCK	0x0194
1323*4bff34e3Sthurlow #define	NT_STATUS_NETWORK_CREDENTIAL_CONFLICT	0x0195
1324*4bff34e3Sthurlow #define	NT_STATUS_REMOTE_SESSION_LIMIT	0x0196
1325*4bff34e3Sthurlow #define	NT_STATUS_EVENTLOG_FILE_CHANGED	0x0197
1326*4bff34e3Sthurlow #define	NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT	0x0198
1327*4bff34e3Sthurlow #define	NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT	0x0199
1328*4bff34e3Sthurlow #define	NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT	0x019a
1329*4bff34e3Sthurlow #define	NT_STATUS_DOMAIN_TRUST_INCONSISTENT	0x019b
1330*4bff34e3Sthurlow #define	NT_STATUS_FS_DRIVER_REQUIRED	0x019c
1331*4bff34e3Sthurlow #define	NT_STATUS_NO_USER_SESSION_KEY	0x0202
1332*4bff34e3Sthurlow #define	NT_STATUS_USER_SESSION_DELETED	0x0203
1333*4bff34e3Sthurlow #define	NT_STATUS_RESOURCE_LANG_NOT_FOUND	0x0204
1334*4bff34e3Sthurlow #define	NT_STATUS_INSUFF_SERVER_RESOURCES	0x0205
1335*4bff34e3Sthurlow #define	NT_STATUS_INVALID_BUFFER_SIZE	0x0206
1336*4bff34e3Sthurlow #define	NT_STATUS_INVALID_ADDRESS_COMPONENT	0x0207
1337*4bff34e3Sthurlow #define	NT_STATUS_INVALID_ADDRESS_WILDCARD	0x0208
1338*4bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_ADDRESSES	0x0209
1339*4bff34e3Sthurlow #define	NT_STATUS_ADDRESS_ALREADY_EXISTS	0x020a
1340*4bff34e3Sthurlow #define	NT_STATUS_ADDRESS_CLOSED	0x020b
1341*4bff34e3Sthurlow #define	NT_STATUS_CONNECTION_DISCONNECTED	0x020c
1342*4bff34e3Sthurlow #define	NT_STATUS_CONNECTION_RESET	0x020d
1343*4bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_NODES	0x020e
1344*4bff34e3Sthurlow #define	NT_STATUS_TRANSACTION_ABORTED	0x020f
1345*4bff34e3Sthurlow #define	NT_STATUS_TRANSACTION_TIMED_OUT	0x0210
1346*4bff34e3Sthurlow #define	NT_STATUS_TRANSACTION_NO_RELEASE	0x0211
1347*4bff34e3Sthurlow #define	NT_STATUS_TRANSACTION_NO_MATCH	0x0212
1348*4bff34e3Sthurlow #define	NT_STATUS_TRANSACTION_RESPONDED	0x0213
1349*4bff34e3Sthurlow #define	NT_STATUS_TRANSACTION_INVALID_ID	0x0214
1350*4bff34e3Sthurlow #define	NT_STATUS_TRANSACTION_INVALID_TYPE	0x0215
1351*4bff34e3Sthurlow #define	NT_STATUS_NOT_SERVER_SESSION	0x0216
1352*4bff34e3Sthurlow #define	NT_STATUS_NOT_CLIENT_SESSION	0x0217
1353*4bff34e3Sthurlow #define	NT_STATUS_CANNOT_LOAD_REGISTRY_FILE	0x0218
1354*4bff34e3Sthurlow #define	NT_STATUS_DEBUG_ATTACH_FAILED	0x0219
1355*4bff34e3Sthurlow #define	NT_STATUS_SYSTEM_PROCESS_TERMINATED	0x021a
1356*4bff34e3Sthurlow #define	NT_STATUS_DATA_NOT_ACCEPTED	0x021b
1357*4bff34e3Sthurlow #define	NT_STATUS_NO_BROWSER_SERVERS_FOUND	0x021c
1358*4bff34e3Sthurlow #define	NT_STATUS_VDM_HARD_ERROR	0x021d
1359*4bff34e3Sthurlow #define	NT_STATUS_DRIVER_CANCEL_TIMEOUT	0x021e
1360*4bff34e3Sthurlow #define	NT_STATUS_REPLY_MESSAGE_MISMATCH	0x021f
1361*4bff34e3Sthurlow #define	NT_STATUS_MAPPED_ALIGNMENT	0x0220
1362*4bff34e3Sthurlow #define	NT_STATUS_IMAGE_CHECKSUM_MISMATCH	0x0221
1363*4bff34e3Sthurlow #define	NT_STATUS_LOST_WRITEBEHIND_DATA	0x0222
1364*4bff34e3Sthurlow #define	NT_STATUS_CLIENT_SERVER_PARAMETERS_INVALID	0x0223
1365*4bff34e3Sthurlow #define	NT_STATUS_PASSWORD_MUST_CHANGE	0x0224
1366*4bff34e3Sthurlow #define	NT_STATUS_NOT_FOUND		0x0225
1367*4bff34e3Sthurlow #define	NT_STATUS_NOT_TINY_STREAM	0x0226
1368*4bff34e3Sthurlow #define	NT_STATUS_RECOVERY_FAILURE	0x0227
1369*4bff34e3Sthurlow #define	NT_STATUS_STACK_OVERFLOW_READ	0x0228
1370*4bff34e3Sthurlow #define	NT_STATUS_FAIL_CHECK		0x0229
1371*4bff34e3Sthurlow #define	NT_STATUS_DUPLICATE_OBJECTID	0x022a
1372*4bff34e3Sthurlow #define	NT_STATUS_OBJECTID_EXISTS	0x022b
1373*4bff34e3Sthurlow #define	NT_STATUS_CONVERT_TO_LARGE	0x022c
1374*4bff34e3Sthurlow #define	NT_STATUS_RETRY			0x022d
1375*4bff34e3Sthurlow #define	NT_STATUS_FOUND_OUT_OF_SCOPE	0x022e
1376*4bff34e3Sthurlow #define	NT_STATUS_ALLOCATE_BUCKET	0x022f
1377*4bff34e3Sthurlow #define	NT_STATUS_PROPSET_NOT_FOUND	0x0230
1378*4bff34e3Sthurlow #define	NT_STATUS_MARSHALL_OVERFLOW	0x0231
1379*4bff34e3Sthurlow #define	NT_STATUS_INVALID_VARIANT	0x0232
1380*4bff34e3Sthurlow #define	NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND	0x0233
1381*4bff34e3Sthurlow #define	NT_STATUS_ACCOUNT_LOCKED_OUT	0x0234
1382*4bff34e3Sthurlow #define	NT_STATUS_HANDLE_NOT_CLOSABLE	0x0235
1383*4bff34e3Sthurlow #define	NT_STATUS_CONNECTION_REFUSED	0x0236
1384*4bff34e3Sthurlow #define	NT_STATUS_GRACEFUL_DISCONNECT	0x0237
1385*4bff34e3Sthurlow #define	NT_STATUS_ADDRESS_ALREADY_ASSOCIATED	0x0238
1386*4bff34e3Sthurlow #define	NT_STATUS_ADDRESS_NOT_ASSOCIATED	0x0239
1387*4bff34e3Sthurlow #define	NT_STATUS_CONNECTION_INVALID	0x023a
1388*4bff34e3Sthurlow #define	NT_STATUS_CONNECTION_ACTIVE	0x023b
1389*4bff34e3Sthurlow #define	NT_STATUS_NETWORK_UNREACHABLE	0x023c
1390*4bff34e3Sthurlow #define	NT_STATUS_HOST_UNREACHABLE	0x023d
1391*4bff34e3Sthurlow #define	NT_STATUS_PROTOCOL_UNREACHABLE	0x023e
1392*4bff34e3Sthurlow #define	NT_STATUS_PORT_UNREACHABLE	0x023f
1393*4bff34e3Sthurlow #define	NT_STATUS_REQUEST_ABORTED	0x0240
1394*4bff34e3Sthurlow #define	NT_STATUS_CONNECTION_ABORTED	0x0241
1395*4bff34e3Sthurlow #define	NT_STATUS_BAD_COMPRESSION_BUFFER	0x0242
1396*4bff34e3Sthurlow #define	NT_STATUS_USER_MAPPED_FILE	0x0243
1397*4bff34e3Sthurlow #define	NT_STATUS_AUDIT_FAILED		0x0244
1398*4bff34e3Sthurlow #define	NT_STATUS_TIMER_RESOLUTION_NOT_SET	0x0245
1399*4bff34e3Sthurlow #define	NT_STATUS_CONNECTION_COUNT_LIMIT	0x0246
1400*4bff34e3Sthurlow #define	NT_STATUS_LOGIN_TIME_RESTRICTION	0x0247
1401*4bff34e3Sthurlow #define	NT_STATUS_LOGIN_WKSTA_RESTRICTION	0x0248
1402*4bff34e3Sthurlow #define	NT_STATUS_IMAGE_MP_UP_MISMATCH	0x0249
1403*4bff34e3Sthurlow #define	NT_STATUS_INSUFFICIENT_LOGON_INFO	0x0250
1404*4bff34e3Sthurlow #define	NT_STATUS_BAD_DLL_ENTRYPOINT	0x0251
1405*4bff34e3Sthurlow #define	NT_STATUS_BAD_SERVICE_ENTRYPOINT	0x0252
1406*4bff34e3Sthurlow #define	NT_STATUS_LPC_REPLY_LOST	0x0253
1407*4bff34e3Sthurlow #define	NT_STATUS_IP_ADDRESS_CONFLICT1	0x0254
1408*4bff34e3Sthurlow #define	NT_STATUS_IP_ADDRESS_CONFLICT2	0x0255
1409*4bff34e3Sthurlow #define	NT_STATUS_REGISTRY_QUOTA_LIMIT	0x0256
1410*4bff34e3Sthurlow #define	NT_STATUS_PATH_NOT_COVERED	0x0257
1411*4bff34e3Sthurlow #define	NT_STATUS_NO_CALLBACK_ACTIVE	0x0258
1412*4bff34e3Sthurlow #define	NT_STATUS_LICENSE_QUOTA_EXCEEDED	0x0259
1413*4bff34e3Sthurlow #define	NT_STATUS_PWD_TOO_SHORT		0x025a
1414*4bff34e3Sthurlow #define	NT_STATUS_PWD_TOO_RECENT	0x025b
1415*4bff34e3Sthurlow #define	NT_STATUS_PWD_HISTORY_CONFLICT	0x025c
1416*4bff34e3Sthurlow #define	NT_STATUS_PLUGPLAY_NO_DEVICE	0x025e
1417*4bff34e3Sthurlow #define	NT_STATUS_UNSUPPORTED_COMPRESSION	0x025f
1418*4bff34e3Sthurlow #define	NT_STATUS_INVALID_HW_PROFILE	0x0260
1419*4bff34e3Sthurlow #define	NT_STATUS_INVALID_PLUGPLAY_DEVICE_PATH	0x0261
1420*4bff34e3Sthurlow #define	NT_STATUS_DRIVER_ORDINAL_NOT_FOUND	0x0262
1421*4bff34e3Sthurlow #define	NT_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND	0x0263
1422*4bff34e3Sthurlow #define	NT_STATUS_RESOURCE_NOT_OWNED	0x0264
1423*4bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_LINKS	0x0265
1424*4bff34e3Sthurlow #define	NT_STATUS_QUOTA_LIST_INCONSISTENT	0x0266
1425*4bff34e3Sthurlow #define	NT_STATUS_FILE_IS_OFFLINE	0x0267
1426*4bff34e3Sthurlow 
1427*4bff34e3Sthurlow #define	NT_STATUS_LICENSE_VIOLATION	0x026a
1428*4bff34e3Sthurlow 
1429*4bff34e3Sthurlow #define	NT_STATUS_DFS_UNAVAILABLE	0x026d
1430*4bff34e3Sthurlow #define	NT_STATUS_VOLUME_DISMOUNTED	0x026e
1431*4bff34e3Sthurlow 
1432*4bff34e3Sthurlow #define	NT_STATUS_NOT_A_REPARSE_POINT	0x0275
1433*4bff34e3Sthurlow 
1434*4bff34e3Sthurlow #define	NT_STATUS_REPARSE_POINT_NOT_RESOLVED	0x0280
1435*4bff34e3Sthurlow #define	NT_STATUS_DIRECTORY_IS_A_REPARSE_POINT	0x0281
1436*4bff34e3Sthurlow 
1437*4bff34e3Sthurlow #define	NT_STATUS_ENCRYPTION_FAILED	0x028a
1438*4bff34e3Sthurlow #define	NT_STATUS_DECRYPTION_FAILED	0x028b
1439*4bff34e3Sthurlow #define	NT_STATUS_RANGE_NOT_FOUND	0x028c
1440*4bff34e3Sthurlow #define	NT_STATUS_NO_RECOVERY_POLICY	0x028d
1441*4bff34e3Sthurlow #define	NT_STATUS_NO_EFS		0x028e
1442*4bff34e3Sthurlow #define	NT_STATUS_WRONG_EFS		0x028f
1443*4bff34e3Sthurlow #define	NT_STATUS_NO_USER_KEYS		0x0290
1444*4bff34e3Sthurlow #define	NT_STATUS_FILE_NOT_ENCRYPTED	0x0291
1445*4bff34e3Sthurlow 
1446*4bff34e3Sthurlow #define	NT_STATUS_FILE_ENCRYPTED	0x0293
1447*4bff34e3Sthurlow 
1448*4bff34e3Sthurlow #define	NT_STATUS_VOLUME_NOT_UPGRADED	0x029c
1449*4bff34e3Sthurlow 
1450*4bff34e3Sthurlow #define	NT_STATUS_KDC_CERT_EXPIRED	0x040e
1451*4bff34e3Sthurlow /*
1452*4bff34e3Sthurlow  * 0x00010000-0x0001ffff are "DBG" errors
1453*4bff34e3Sthurlow  * 0x00020000-0x0003ffff are "RPC" errors
1454*4bff34e3Sthurlow  * 0x00040000-0x0004ffff are "PNP" errors
1455*4bff34e3Sthurlow  * 0x000A0000-0x000Affff are "CTX" errors
1456*4bff34e3Sthurlow  * 0x00130000-0x0013ffff are "CLUSTER" errors
1457*4bff34e3Sthurlow  * 0x00140000-0x0014ffff are "ACPI" errors
1458*4bff34e3Sthurlow  * 0x00150000-0x0015ffff are "SXS" errors
1459*4bff34e3Sthurlow  */
1460*4bff34e3Sthurlow 
1461*4bff34e3Sthurlow /*
1462*4bff34e3Sthurlow  * size of the GUID returned in an extended security negotiate response
1463*4bff34e3Sthurlow  */
1464*4bff34e3Sthurlow #define	SMB_GUIDLEN	16
1465*4bff34e3Sthurlow 
1466*4bff34e3Sthurlow typedef uint16_t	smbfh;
1467*4bff34e3Sthurlow 
1468*4bff34e3Sthurlow /*
1469*4bff34e3Sthurlow  * NTLMv2 blob header structure.
1470*4bff34e3Sthurlow  */
1471*4bff34e3Sthurlow struct ntlmv2_blobhdr {
1472*4bff34e3Sthurlow 	uint32_t	header;
1473*4bff34e3Sthurlow 	uint32_t	reserved;
1474*4bff34e3Sthurlow 	uint64_t	timestamp;
1475*4bff34e3Sthurlow 	uint64_t	client_nonce;
1476*4bff34e3Sthurlow 	uint32_t	unknown1;
1477*4bff34e3Sthurlow };
1478*4bff34e3Sthurlow typedef struct ntlmv2_blobhdr ntlmv2_blobhdr_t;
1479*4bff34e3Sthurlow 
1480*4bff34e3Sthurlow /*
1481*4bff34e3Sthurlow  * NTLMv2 name header structure, for names in a blob.
1482*4bff34e3Sthurlow  */
1483*4bff34e3Sthurlow struct ntlmv2_namehdr {
1484*4bff34e3Sthurlow 	uint16_t	type;
1485*4bff34e3Sthurlow 	uint16_t	len;
1486*4bff34e3Sthurlow };
1487*4bff34e3Sthurlow typedef struct ntlmv2_namehdr ntlmv2_namehdr_t;
1488*4bff34e3Sthurlow 
1489*4bff34e3Sthurlow #define	NAMETYPE_EOL		0x0000	/* end of list of names */
1490*4bff34e3Sthurlow #define	NAMETYPE_MACHINE_NB	0x0001	/* NetBIOS machine name */
1491*4bff34e3Sthurlow #define	NAMETYPE_DOMAIN_NB	0x0002	/* NetBIOS domain name */
1492*4bff34e3Sthurlow #define	NAMETYPE_MACHINE_DNS	0x0003	/* DNS machine name */
1493*4bff34e3Sthurlow #define	NAMETYPE_DOMAIN_DNS	0x0004	/* DNS Active Directory domain name */
1494*4bff34e3Sthurlow 
1495*4bff34e3Sthurlow /*
1496*4bff34e3Sthurlow  * Named pipe commands.
1497*4bff34e3Sthurlow  */
1498*4bff34e3Sthurlow #define	TRANS_CALL_NAMED_PIPE		0x54	/* open/write/read/close pipe */
1499*4bff34e3Sthurlow #define	TRANS_WAIT_NAMED_PIPE		0x53	/* wait for pipe to be !busy */
1500*4bff34e3Sthurlow #define	TRANS_PEEK_NAMED_PIPE		0x23	/* read but don't remove data */
1501*4bff34e3Sthurlow #define	TRANS_Q_NAMED_PIPE_HAND_STATE	0x21	/* query pipe handle modes */
1502*4bff34e3Sthurlow #define	TRANS_SET_NAMED_PIPE_HAND_STATE	0x01	/* set pipe handle modes */
1503*4bff34e3Sthurlow #define	TRANS_Q_NAMED_PIPE_INFO		0x22	/* query pipe attributes */
1504*4bff34e3Sthurlow #define	TRANS_TRANSACT_NAMED_PIPE	0x26	/* r/w operation on pipe */
1505*4bff34e3Sthurlow #define	TRANS_READ_NAMED_PIPE		0x11	/* read pipe in "raw" mode */
1506*4bff34e3Sthurlow 						/* (non message mode) */
1507*4bff34e3Sthurlow #define	TRANS_WRITE_NAMED_PIPE		0x31	/* write pipe "raw" mode */
1508*4bff34e3Sthurlow 						/* (non message mode) */
1509*4bff34e3Sthurlow 
1510*4bff34e3Sthurlow /*
1511*4bff34e3Sthurlow  * Share types, visible via NetShareEnum
1512*4bff34e3Sthurlow  */
1513*4bff34e3Sthurlow #define	STYPE_DISKTREE			0x00000000
1514*4bff34e3Sthurlow #define	STYPE_PRINTQ			0x00000001
1515*4bff34e3Sthurlow #define	STYPE_DEVICE			0x00000002
1516*4bff34e3Sthurlow #define	STYPE_IPC			0x00000003
1517*4bff34e3Sthurlow #define	STYPE_UNKNOWN			0x00000004
1518*4bff34e3Sthurlow #define	STYPE_MASK			0x0000000F
1519*4bff34e3Sthurlow #define	STYPE_TEMPORARY			0x40000000
1520*4bff34e3Sthurlow #define	STYPE_HIDDEN			0x80000000
1521*4bff34e3Sthurlow 
1522*4bff34e3Sthurlow #endif /* _NETSMB_SMB_H_ */
1523