xref: /titanic_53/usr/src/uts/common/netsmb/smb.h (revision 613a2f6ba31e891e3d947a356daf5e563d43c1ce)
14bff34e3Sthurlow /*
24bff34e3Sthurlow  * Copyright (c) 2000-2001 Boris Popov
34bff34e3Sthurlow  * All rights reserved.
44bff34e3Sthurlow  *
54bff34e3Sthurlow  * Now many of these defines are from samba4 code, by Andrew Tridgell.
64bff34e3Sthurlow  * (Permission given to Conrad Minshall at CIFS plugfest Aug 13 2003.)
74bff34e3Sthurlow  * (Note the main decision was whether to use defines found in MS includes
84bff34e3Sthurlow  * and web pages, versus Samba, and the deciding factor is which developers
94bff34e3Sthurlow  * are more likely to be looking at this code base.)
104bff34e3Sthurlow  *
114bff34e3Sthurlow  * Redistribution and use in source and binary forms, with or without
124bff34e3Sthurlow  * modification, are permitted provided that the following conditions
134bff34e3Sthurlow  * are met:
144bff34e3Sthurlow  * 1. Redistributions of source code must retain the above copyright
154bff34e3Sthurlow  *    notice, this list of conditions and the following disclaimer.
164bff34e3Sthurlow  * 2. Redistributions in binary form must reproduce the above copyright
174bff34e3Sthurlow  *    notice, this list of conditions and the following disclaimer in the
184bff34e3Sthurlow  *    documentation and/or other materials provided with the distribution.
194bff34e3Sthurlow  * 3. All advertising materials mentioning features or use of this software
204bff34e3Sthurlow  *    must display the following acknowledgement:
214bff34e3Sthurlow  *    This product includes software developed by Boris Popov.
224bff34e3Sthurlow  * 4. Neither the name of the author nor the names of any co-contributors
234bff34e3Sthurlow  *    may be used to endorse or promote products derived from this software
244bff34e3Sthurlow  *    without specific prior written permission.
254bff34e3Sthurlow  *
264bff34e3Sthurlow  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
274bff34e3Sthurlow  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
284bff34e3Sthurlow  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
294bff34e3Sthurlow  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
304bff34e3Sthurlow  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
314bff34e3Sthurlow  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
324bff34e3Sthurlow  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
334bff34e3Sthurlow  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
344bff34e3Sthurlow  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
354bff34e3Sthurlow  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
364bff34e3Sthurlow  * SUCH DAMAGE.
374bff34e3Sthurlow  *
384bff34e3Sthurlow  * $Id: smb.h,v 1.36.90.1 2005/05/27 02:35:29 lindak Exp $
394bff34e3Sthurlow  */
404bff34e3Sthurlow 
414bff34e3Sthurlow /*
424bff34e3Sthurlow  * Common definintions and structures for SMB/CIFS protocol
434bff34e3Sthurlow  */
444bff34e3Sthurlow 
454bff34e3Sthurlow #ifndef _NETSMB_SMB_H_
464bff34e3Sthurlow #define	_NETSMB_SMB_H_
474bff34e3Sthurlow 
484bff34e3Sthurlow /*
494bff34e3Sthurlow  * This file should be purely SMB protocol definition stuff.
504bff34e3Sthurlow  * (Please don't make it a catch-all:)
514bff34e3Sthurlow  */
524bff34e3Sthurlow 
534bff34e3Sthurlow /*
544bff34e3Sthurlow  * SMB dialects that we have to deal with.
554bff34e3Sthurlow  */
564bff34e3Sthurlow enum smb_dialects {
574bff34e3Sthurlow 	SMB_DIALECT_NONE,
584bff34e3Sthurlow 	SMB_DIALECT_CORE,		/* PC NETWORK PROGRAM 1.0, PCLAN1.0 */
594bff34e3Sthurlow 	SMB_DIALECT_COREPLUS,		/* MICROSOFT NETWORKS 1.03 */
604bff34e3Sthurlow 	SMB_DIALECT_LANMAN1_0,		/* MICROSOFT NETWORKS 3.0, LANMAN1.0 */
614bff34e3Sthurlow 	SMB_DIALECT_LANMAN2_0,		/* LM1.2X002, DOS LM1.2X002, Samba */
624bff34e3Sthurlow 	SMB_DIALECT_LANMAN2_1,		/* DOS LANMAN2.1, LANMAN2.1 */
634bff34e3Sthurlow 	SMB_DIALECT_NTLM0_12		/* NT LM 0.12, Windows for Workgroups */
644bff34e3Sthurlow 					/* 3.1a, * NT LANMAN 1.0 */
654bff34e3Sthurlow };
664bff34e3Sthurlow 
674bff34e3Sthurlow /*
684bff34e3Sthurlow  * Formats of data/string buffers
694bff34e3Sthurlow  */
704bff34e3Sthurlow #define	SMB_DT_DATA		1
714bff34e3Sthurlow #define	SMB_DT_DIALECT		2
724bff34e3Sthurlow #define	SMB_DT_PATHNAME		3
734bff34e3Sthurlow #define	SMB_DT_ASCII		4
744bff34e3Sthurlow #define	SMB_DT_VARIABLE		5
754bff34e3Sthurlow 
764bff34e3Sthurlow /*
774bff34e3Sthurlow  * SMB header
784bff34e3Sthurlow  */
794bff34e3Sthurlow #define	SMB_SIGNATURE		"\xFFSMB"
804bff34e3Sthurlow #define	SMB_SIGLEN		4
814bff34e3Sthurlow #define	SMB_HDRCMD(p)		(*((uchar_t *)(p) + SMB_SIGLEN))
82*613a2f6bSGordon Ross #define	SMB_HDRMID(p)		(*(ushort_t *)((uchar_t *)(p) + 30))
834bff34e3Sthurlow #define	SMB_HDRLEN		32
844bff34e3Sthurlow /*
854bff34e3Sthurlow  * bits in the smb_flags field
864bff34e3Sthurlow  */
874bff34e3Sthurlow #define	SMB_FLAGS_SUPPORT_LOCKREAD	0x01
884bff34e3Sthurlow #define	SMB_FLAGS_CLIENT_BUF_AVAIL	0x02
894bff34e3Sthurlow #define	SMB_FLAGS_CASELESS		0x08
904bff34e3Sthurlow #define	SMB_FLAGS_CANONICAL_PATHNAMES	0x10
914bff34e3Sthurlow #define	SMB_FLAGS_REQUEST_OPLOCK	0x20
924bff34e3Sthurlow #define	SMB_FLAGS_REQUEST_BATCH_OPLOCK	0x40
934bff34e3Sthurlow #define	SMB_FLAGS_SERVER_RESP		0x80
944bff34e3Sthurlow 
954bff34e3Sthurlow /*
964bff34e3Sthurlow  * bits in the smb_flags2 field
974bff34e3Sthurlow  */
984bff34e3Sthurlow #define	SMB_FLAGS2_KNOWS_LONG_NAMES	0x0001
994bff34e3Sthurlow #define	SMB_FLAGS2_KNOWS_EAS		0x0002	/* client know about EAs */
1004bff34e3Sthurlow #define	SMB_FLAGS2_SECURITY_SIGNATURE	0x0004	/* check SMB integrity */
1014bff34e3Sthurlow #define	SMB_FLAGS2_IS_LONG_NAME		0x0040	/* any path name is long name */
1024bff34e3Sthurlow #define	SMB_FLAGS2_EXT_SEC		0x0800	/* client aware of Extended */
1034bff34e3Sthurlow 						/* Security negotiation */
1044bff34e3Sthurlow #define	SMB_FLAGS2_DFS			0x1000	/* resolve paths in DFS */
1054bff34e3Sthurlow #define	SMB_FLAGS2_PAGING_IO		0x2000	/* for exec */
1064bff34e3Sthurlow #define	SMB_FLAGS2_ERR_STATUS		0x4000	/* 1 - status.status */
1074bff34e3Sthurlow #define	SMB_FLAGS2_UNICODE		0x8000	/* use Unicode for strings */
1084bff34e3Sthurlow 
1094bff34e3Sthurlow #define	SMB_UID_UNKNOWN		0xffff
1104bff34e3Sthurlow #define	SMB_TID_UNKNOWN		0xffff
1114bff34e3Sthurlow #define	SMB_FID_UNUSED		0xffff
1124bff34e3Sthurlow 
1134bff34e3Sthurlow /*
1144bff34e3Sthurlow  * Security mode bits
1154bff34e3Sthurlow  */
1164bff34e3Sthurlow #define	SMB_SM_USER		0x01	/* server in the user security mode */
1174bff34e3Sthurlow #define	SMB_SM_ENCRYPT		0x02	/* use challenge/responce */
1184bff34e3Sthurlow #define	SMB_SM_SIGS		0x04
1194bff34e3Sthurlow #define	SMB_SM_SIGS_REQUIRE	0x08
1204bff34e3Sthurlow 
1214bff34e3Sthurlow /*
1224bff34e3Sthurlow  * Action bits in session setup reply
1234bff34e3Sthurlow  */
1244bff34e3Sthurlow #define	SMB_ACT_GUEST		0x01
1254bff34e3Sthurlow 
1264bff34e3Sthurlow /*
1274bff34e3Sthurlow  * NTLM capabilities
1284bff34e3Sthurlow  */
1294bff34e3Sthurlow #define	SMB_CAP_RAW_MODE		0x0001
1304bff34e3Sthurlow #define	SMB_CAP_MPX_MODE		0x0002
1314bff34e3Sthurlow #define	SMB_CAP_UNICODE			0x0004
1324bff34e3Sthurlow #define	SMB_CAP_LARGE_FILES		0x0008	/* 64 bit offsets supported */
1334bff34e3Sthurlow #define	SMB_CAP_NT_SMBS			0x0010
1344bff34e3Sthurlow #define	SMB_CAP_RPC_REMOTE_APIS		0x0020
1354bff34e3Sthurlow #define	SMB_CAP_STATUS32		0x0040
1364bff34e3Sthurlow #define	SMB_CAP_LEVEL_II_OPLOCKS	0x0080
1374bff34e3Sthurlow #define	SMB_CAP_LOCK_AND_READ		0x0100
1384bff34e3Sthurlow #define	SMB_CAP_NT_FIND			0x0200
1394bff34e3Sthurlow #define	SMB_CAP_DFS			0x1000
1404bff34e3Sthurlow #define	SMB_CAP_INFOLEVEL_PASSTHRU	0x2000
1414bff34e3Sthurlow #define	SMB_CAP_LARGE_READX		0x4000
1424bff34e3Sthurlow #define	SMB_CAP_LARGE_WRITEX		0x8000
1434bff34e3Sthurlow #define	SMB_CAP_UNIX			0x00800000
1444bff34e3Sthurlow #define	SMB_CAP_BULK_TRANSFER		0x20000000
1454bff34e3Sthurlow #define	SMB_CAP_COMPRESSED_DATA		0x40000000
1464bff34e3Sthurlow #define	SMB_CAP_EXT_SECURITY		0x80000000
1474bff34e3Sthurlow 
1484bff34e3Sthurlow /*
1494bff34e3Sthurlow  * File attributes
1504bff34e3Sthurlow  */
1514bff34e3Sthurlow #define	SMB_FA_RDONLY		0x01
1524bff34e3Sthurlow #define	SMB_FA_HIDDEN		0x02
1534bff34e3Sthurlow #define	SMB_FA_SYSTEM		0x04
1544bff34e3Sthurlow #define	SMB_FA_VOLUME		0x08
1554bff34e3Sthurlow #define	SMB_FA_DIR		0x10
1564bff34e3Sthurlow #define	SMB_FA_ARCHIVE		0x20
1574bff34e3Sthurlow 
1584bff34e3Sthurlow /*
1594bff34e3Sthurlow  * Extended file attributes
1604bff34e3Sthurlow  */
1614bff34e3Sthurlow #define	SMB_EFA_RDONLY			0x00000001
1624bff34e3Sthurlow #define	SMB_EFA_HIDDEN			0x00000002
1634bff34e3Sthurlow #define	SMB_EFA_SYSTEM			0x00000004
1644bff34e3Sthurlow #define	SMB_EFA_VOLUME			0x00000008
1654bff34e3Sthurlow #define	SMB_EFA_DIRECTORY		0x00000010
1664bff34e3Sthurlow #define	SMB_EFA_ARCHIVE			0x00000020
1674bff34e3Sthurlow #define	SMB_EFA_DEVICE			0x00000040
1684bff34e3Sthurlow #define	SMB_EFA_NORMAL			0x00000080
1694bff34e3Sthurlow #define	SMB_EFA_TEMPORARY		0x00000100
1704bff34e3Sthurlow #define	SMB_EFA_SPARSE			0x00000200
1714bff34e3Sthurlow #define	SMB_EFA_REPARSE_POINT		0x00000400
1724bff34e3Sthurlow #define	SMB_EFA_COMPRESSED		0x00000800
1734bff34e3Sthurlow #define	SMB_EFA_OFFLINE			0x00001000
1744bff34e3Sthurlow #define	SMB_EFA_NONINDEXED		0x00002000
1754bff34e3Sthurlow #define	SMB_EFA_ENCRYPTED		0x00004000
1764bff34e3Sthurlow #define	SMB_EFA_POSIX_SEMANTICS		0x01000000
1774bff34e3Sthurlow #define	SMB_EFA_BACKUP_SEMANTICS	0x02000000
1784bff34e3Sthurlow #define	SMB_EFA_DELETE_ON_CLOSE		0x04000000
1794bff34e3Sthurlow #define	SMB_EFA_SEQUENTIAL_SCAN		0x08000000
1804bff34e3Sthurlow #define	SMB_EFA_RANDOM_ACCESS		0x10000000
1814bff34e3Sthurlow #define	SMB_EFA_NO_BUFFERING		0x20000000
1824bff34e3Sthurlow #define	SMB_EFA_WRITE_THROUGH		0x80000000
1834bff34e3Sthurlow 
1844bff34e3Sthurlow /*
1854bff34e3Sthurlow  * Access Mode Encoding
1864bff34e3Sthurlow  */
1874bff34e3Sthurlow #define	SMB_AM_OPENREAD		0x0000
1884bff34e3Sthurlow #define	SMB_AM_OPENWRITE	0x0001
1894bff34e3Sthurlow #define	SMB_AM_OPENRW		0x0002
1904bff34e3Sthurlow #define	SMB_AM_OPENEXEC		0x0003
1914bff34e3Sthurlow #define	SMB_AM_OPENMODE		0x0003	/* mask for access mode bits */
1924bff34e3Sthurlow #define	SMB_SM_COMPAT		0x0000
1934bff34e3Sthurlow #define	SMB_SM_EXCLUSIVE	0x0010
1944bff34e3Sthurlow #define	SMB_SM_DENYWRITE	0x0020
1954bff34e3Sthurlow #define	SMB_SM_DENYREADEXEC	0x0030
1964bff34e3Sthurlow #define	SMB_SM_DENYNONE		0x0040
1974bff34e3Sthurlow 
1984bff34e3Sthurlow /* NT_CREATE_ANDX flags */
1994bff34e3Sthurlow #define	NTCREATEX_FLAGS_REQUEST_OPLOCK		0x02
2004bff34e3Sthurlow #define	NTCREATEX_FLAGS_REQUEST_BATCH_OPLOCK	0x04
2014bff34e3Sthurlow #define	NTCREATEX_FLAGS_OPEN_DIRECTORY		0x08
2024bff34e3Sthurlow #define	NTCREATEX_FLAGS_EXTENDED		0x10
2034bff34e3Sthurlow 
2044bff34e3Sthurlow /* NT_CREATE_ANDX share_access (share mode) */
2054bff34e3Sthurlow #define	NTCREATEX_SHARE_ACCESS_NONE		0
2064bff34e3Sthurlow #define	NTCREATEX_SHARE_ACCESS_READ		1
2074bff34e3Sthurlow #define	NTCREATEX_SHARE_ACCESS_WRITE		2
2084bff34e3Sthurlow #define	NTCREATEX_SHARE_ACCESS_DELETE		4
2094bff34e3Sthurlow #define	NTCREATEX_SHARE_ACCESS_ALL		7
2104bff34e3Sthurlow 
2114bff34e3Sthurlow /* NT_CREATE_ANDX open_disposition */
2124bff34e3Sthurlow #define	NTCREATEX_DISP_SUPERSEDE	0 /* if file exists supersede it */
2134bff34e3Sthurlow #define	NTCREATEX_DISP_OPEN		1 /* exists ? open it : fail */
2144bff34e3Sthurlow #define	NTCREATEX_DISP_CREATE		2 /* exists ? fail : create it */
2154bff34e3Sthurlow #define	NTCREATEX_DISP_OPEN_IF		3 /* exists ? open it : create it */
2164bff34e3Sthurlow #define	NTCREATEX_DISP_OVERWRITE	4 /* exists ? overwrite : fail */
2174bff34e3Sthurlow #define	NTCREATEX_DISP_OVERWRITE_IF	5 /* exists ? overwrite : create */
2184bff34e3Sthurlow 
2194bff34e3Sthurlow /* NT_CREATE_ANDX create_options */
2204bff34e3Sthurlow #define	NTCREATEX_OPTIONS_DIRECTORY		0x0001
2214bff34e3Sthurlow #define	NTCREATEX_OPTIONS_WRITE_THROUGH		0x0002
2224bff34e3Sthurlow #define	NTCREATEX_OPTIONS_SEQUENTIAL_ONLY	0x0004
2234bff34e3Sthurlow #define	NTCREATEX_OPTIONS_SYNC_ALERT		0x0010
2244bff34e3Sthurlow #define	NTCREATEX_OPTIONS_ASYNC_ALERT		0x0020
2254bff34e3Sthurlow #define	NTCREATEX_OPTIONS_NON_DIRECTORY_FILE	0x0040
2264bff34e3Sthurlow #define	NTCREATEX_OPTIONS_NO_EA_KNOWLEDGE	0x0200
2274bff34e3Sthurlow #define	NTCREATEX_OPTIONS_EIGHT_DOT_THREE_ONLY	0x0400
2284bff34e3Sthurlow #define	NTCREATEX_OPTIONS_RANDOM_ACCESS		0x0800
2294bff34e3Sthurlow #define	NTCREATEX_OPTIONS_DELETE_ON_CLOSE	0x1000
2304bff34e3Sthurlow #define	NTCREATEX_OPTIONS_OPEN_BY_FILE_ID	0x2000
2314bff34e3Sthurlow 
2324bff34e3Sthurlow /* NT_CREATE_ANDX "impersonation" */
2334bff34e3Sthurlow #define	NTCREATEX_IMPERSONATION_ANONYMOUS		0
2344bff34e3Sthurlow #define	NTCREATEX_IMPERSONATION_IDENTIFICATION		1
2354bff34e3Sthurlow #define	NTCREATEX_IMPERSONATION_IMPERSONATION		2
2364bff34e3Sthurlow #define	NTCREATEX_IMPERSONATION_DELEGATION		3
2374bff34e3Sthurlow 
2384bff34e3Sthurlow /* NT_CREATE_ANDX security flags */
2394bff34e3Sthurlow #define	NTCREATEX_SECURITY_DYNAMIC	1
2404bff34e3Sthurlow #define	NTCREATEX_SECURITY_ALL		2
2414bff34e3Sthurlow 
2424bff34e3Sthurlow /* NT_CREATE_ANDX create_action in reply */
2434bff34e3Sthurlow #define	NTCREATEX_ACTION_EXISTED	1
2444bff34e3Sthurlow #define	NTCREATEX_ACTION_CREATED	2
2454bff34e3Sthurlow #define	NTCREATEX_ACTION_TRUNCATED	3
2464bff34e3Sthurlow 
2474bff34e3Sthurlow /* SMB_TRANS2_FIND_FIRST2/SMB_TRANS2_FIND_NEXT2 flags */
2484bff34e3Sthurlow #define	FIND2_CLOSE_AFTER_REQUEST	0x0001
2494bff34e3Sthurlow #define	FIND2_CLOSE_ON_EOS		0x0002
2504bff34e3Sthurlow #define	FIND2_RETURN_RESUME_KEYS	0x0004
2514bff34e3Sthurlow #define	FIND2_CONTINUE_SEARCH		0x0008
2524bff34e3Sthurlow #define	FIND2_BACKUP_INTENT		0x0010
2534bff34e3Sthurlow 
2544bff34e3Sthurlow /*
2554bff34e3Sthurlow  * SMB commands
2564bff34e3Sthurlow  */
2574bff34e3Sthurlow #define	SMB_COM_CREATE_DIRECTORY	0x00
2584bff34e3Sthurlow #define	SMB_COM_DELETE_DIRECTORY	0x01
2594bff34e3Sthurlow #define	SMB_COM_OPEN			0x02
2604bff34e3Sthurlow #define	SMB_COM_CREATE			0x03
2614bff34e3Sthurlow #define	SMB_COM_CLOSE			0x04
2624bff34e3Sthurlow #define	SMB_COM_FLUSH			0x05
2634bff34e3Sthurlow #define	SMB_COM_DELETE			0x06
2644bff34e3Sthurlow #define	SMB_COM_RENAME			0x07
2654bff34e3Sthurlow #define	SMB_COM_QUERY_INFORMATION	0x08
2664bff34e3Sthurlow #define	SMB_COM_SET_INFORMATION		0x09
2674bff34e3Sthurlow #define	SMB_COM_READ			0x0A
2684bff34e3Sthurlow #define	SMB_COM_WRITE			0x0B
2694bff34e3Sthurlow #define	SMB_COM_LOCK_BYTE_RANGE		0x0C
2704bff34e3Sthurlow #define	SMB_COM_UNLOCK_BYTE_RANGE	0x0D
2714bff34e3Sthurlow #define	SMB_COM_CREATE_TEMPORARY	0x0E
2724bff34e3Sthurlow #define	SMB_COM_CREATE_NEW		0x0F
2734bff34e3Sthurlow #define	SMB_COM_CHECK_DIRECTORY		0x10
2744bff34e3Sthurlow #define	SMB_COM_PROCESS_EXIT		0x11
2754bff34e3Sthurlow #define	SMB_COM_SEEK			0x12
2764bff34e3Sthurlow #define	SMB_COM_LOCK_AND_READ		0x13
2774bff34e3Sthurlow #define	SMB_COM_WRITE_AND_UNLOCK	0x14
2784bff34e3Sthurlow #define	SMB_COM_READ_RAW		0x1A
2794bff34e3Sthurlow #define	SMB_COM_READ_MPX		0x1B
2804bff34e3Sthurlow #define	SMB_COM_READ_MPX_SECONDARY	0x1C
2814bff34e3Sthurlow #define	SMB_COM_WRITE_RAW		0x1D
2824bff34e3Sthurlow #define	SMB_COM_WRITE_MPX		0x1E
2834bff34e3Sthurlow #define	SMB_COM_WRITE_COMPLETE		0x20
2844bff34e3Sthurlow #define	SMB_COM_SET_INFORMATION2	0x22
2854bff34e3Sthurlow #define	SMB_COM_QUERY_INFORMATION2	0x23
2864bff34e3Sthurlow #define	SMB_COM_LOCKING_ANDX		0x24
2874bff34e3Sthurlow #define	SMB_COM_TRANSACTION		0x25
2884bff34e3Sthurlow #define	SMB_COM_TRANSACTION_SECONDARY	0x26
2894bff34e3Sthurlow #define	SMB_COM_IOCTL			0x27
2904bff34e3Sthurlow #define	SMB_COM_IOCTL_SECONDARY		0x28
2914bff34e3Sthurlow #define	SMB_COM_COPY			0x29
2924bff34e3Sthurlow #define	SMB_COM_MOVE			0x2A
2934bff34e3Sthurlow #define	SMB_COM_ECHO			0x2B
2944bff34e3Sthurlow #define	SMB_COM_WRITE_AND_CLOSE		0x2C
2954bff34e3Sthurlow #define	SMB_COM_OPEN_ANDX		0x2D
2964bff34e3Sthurlow #define	SMB_COM_READ_ANDX		0x2E
2974bff34e3Sthurlow #define	SMB_COM_WRITE_ANDX		0x2F
2984bff34e3Sthurlow #define	SMB_COM_CLOSE_AND_TREE_DISC	0x31
2994bff34e3Sthurlow #define	SMB_COM_TRANSACTION2		0x32
3004bff34e3Sthurlow #define	SMB_COM_TRANSACTION2_SECONDARY	0x33
3014bff34e3Sthurlow #define	SMB_COM_FIND_CLOSE2		0x34
3024bff34e3Sthurlow #define	SMB_COM_FIND_NOTIFY_CLOSE	0x35
3034bff34e3Sthurlow #define	SMB_COM_TREE_CONNECT		0x70
3044bff34e3Sthurlow #define	SMB_COM_TREE_DISCONNECT		0x71
3054bff34e3Sthurlow #define	SMB_COM_NEGOTIATE		0x72
3064bff34e3Sthurlow #define	SMB_COM_SESSION_SETUP_ANDX	0x73
3074bff34e3Sthurlow #define	SMB_COM_LOGOFF_ANDX		0x74
3084bff34e3Sthurlow #define	SMB_COM_TREE_CONNECT_ANDX	0x75
3094bff34e3Sthurlow #define	SMB_COM_QUERY_INFORMATION_DISK	0x80
3104bff34e3Sthurlow #define	SMB_COM_SEARCH			0x81
3114bff34e3Sthurlow #define	SMB_COM_FIND			0x82
3124bff34e3Sthurlow #define	SMB_COM_FIND_UNIQUE		0x83
3134bff34e3Sthurlow #define	SMB_COM_NT_TRANSACT		0xA0
3144bff34e3Sthurlow #define	SMB_COM_NT_TRANSACT_SECONDARY	0xA1
3154bff34e3Sthurlow #define	SMB_COM_NT_CREATE_ANDX		0xA2
3164bff34e3Sthurlow #define	SMB_COM_NT_CANCEL		0xA4
3174bff34e3Sthurlow #define	SMB_COM_OPEN_PRINT_FILE		0xC0
3184bff34e3Sthurlow #define	SMB_COM_WRITE_PRINT_FILE	0xC1
3194bff34e3Sthurlow #define	SMB_COM_CLOSE_PRINT_FILE	0xC2
3204bff34e3Sthurlow #define	SMB_COM_GET_PRINT_QUEUE		0xC3
3214bff34e3Sthurlow #define	SMB_COM_READ_BULK		0xD8
3224bff34e3Sthurlow #define	SMB_COM_WRITE_BULK		0xD9
3234bff34e3Sthurlow #define	SMB_COM_WRITE_BULK_DATA		0xDA
3244bff34e3Sthurlow 
3254bff34e3Sthurlow /*
3264bff34e3Sthurlow  * SMB_COM_TRANSACTION2 subcommands
3274bff34e3Sthurlow  */
3284bff34e3Sthurlow #define	SMB_TRANS2_OPEN2			0x00
3294bff34e3Sthurlow #define	SMB_TRANS2_FIND_FIRST2			0x01
3304bff34e3Sthurlow #define	SMB_TRANS2_FIND_NEXT2			0x02
3314bff34e3Sthurlow #define	SMB_TRANS2_QUERY_FS_INFORMATION		0x03
3324bff34e3Sthurlow #define	SMB_TRANS2_SETFSINFO			0x04
3334bff34e3Sthurlow #define	SMB_TRANS2_QUERY_PATH_INFORMATION	0x05
3344bff34e3Sthurlow #define	SMB_TRANS2_SET_PATH_INFORMATION		0x06
3354bff34e3Sthurlow #define	SMB_TRANS2_QUERY_FILE_INFORMATION	0x07
3364bff34e3Sthurlow #define	SMB_TRANS2_SET_FILE_INFORMATION		0x08
3374bff34e3Sthurlow #define	SMB_TRANS2_FSCTL			0x09
3384bff34e3Sthurlow #define	SMB_TRANS2_IOCTL2			0x0A
3394bff34e3Sthurlow #define	SMB_TRANS2_FIND_NOTIFY_FIRST		0x0B
3404bff34e3Sthurlow #define	SMB_TRANS2_FIND_NOTIFY_NEXT		0x0C
3414bff34e3Sthurlow #define	SMB_TRANS2_CREATE_DIRECTORY		0x0D
3424bff34e3Sthurlow #define	SMB_TRANS2_SESSION_SETUP		0x0E
3434bff34e3Sthurlow #define	SMB_TRANS2_GET_DFS_REFERRAL		0x10
3444bff34e3Sthurlow #define	SMB_TRANS2_REPORT_DFS_INCONSISTENCY	0x11
3454bff34e3Sthurlow 
3464bff34e3Sthurlow /*
3474bff34e3Sthurlow  * SMB_COM_NT_TRANSACT subcommands
3484bff34e3Sthurlow  */
3494bff34e3Sthurlow #define	NT_TRANSACT_CREATE		0x01
3504bff34e3Sthurlow #define	NT_TRANSACT_IOCTL		0x02
3514bff34e3Sthurlow #define	NT_TRANSACT_SET_SECURITY_DESC	0x03
3524bff34e3Sthurlow #define	NT_TRANSACT_NOTIFY_CHANGE	0x04
3534bff34e3Sthurlow #define	NT_TRANSACT_RENAME		0x05
3544bff34e3Sthurlow #define	NT_TRANSACT_QUERY_SECURITY_DESC	0x06
3554bff34e3Sthurlow #define	NT_TRANSACT_GET_USER_QUOTA	0x07
3564bff34e3Sthurlow #define	NT_TRANSACT_SET_USER_QUOTA	0x08
3574bff34e3Sthurlow 
3584bff34e3Sthurlow /*
3594bff34e3Sthurlow  * SMB_TRANS2_QUERY_FS_INFORMATION levels
3604bff34e3Sthurlow  */
3614bff34e3Sthurlow #define	SMB_QFS_ALLOCATION			1
3624bff34e3Sthurlow #define	SMB_QFS_VOLUME				2
3634bff34e3Sthurlow #define	SMB_QFS_LABEL_INFO			0x101
3644bff34e3Sthurlow #define	SMB_QFS_VOLUME_INFO			0x102
3654bff34e3Sthurlow #define	SMB_QFS_SIZE_INFO			0x103
3664bff34e3Sthurlow #define	SMB_QFS_DEVICE_INFO			0x104
3674bff34e3Sthurlow #define	SMB_QFS_ATTRIBUTE_INFO			0x105
3684bff34e3Sthurlow #define	SMB_QFS_UNIX_INFO			0x200
3694bff34e3Sthurlow #define	SMB_QFS_MAC_FS_INFO			0x301
3704bff34e3Sthurlow #define	SMB_QFS_VOLUME_INFORMATION		1001
3714bff34e3Sthurlow #define	SMB_QFS_SIZE_INFORMATION		1003
3724bff34e3Sthurlow #define	SMB_QFS_DEVICE_INFORMATION		1004
3734bff34e3Sthurlow #define	SMB_QFS_ATTRIBUTE_INFORMATION		1005
3744bff34e3Sthurlow #define	SMB_QFS_QUOTA_INFORMATION		1006
3754bff34e3Sthurlow #define	SMB_QFS_FULL_SIZE_INFORMATION		1007
3764bff34e3Sthurlow #define	SMB_QFS_OBJECTID_INFORMATION		1008
3774bff34e3Sthurlow 
3784bff34e3Sthurlow 
3794bff34e3Sthurlow /*
3804bff34e3Sthurlow  * SMB_QFS_ATTRIBUTE_INFO bits.
3814bff34e3Sthurlow  * The following info found in msdn
3824bff34e3Sthurlow  * (http://msdn.microsoft.com/library/default.asp?
3834bff34e3Sthurlow  * url=/library/en-us/wmisdk/wmi/win32_cdromdrive.asp)
3844bff34e3Sthurlow  * Naming is mostly as in samba, to help Those Who Google.
3854bff34e3Sthurlow  */
3864bff34e3Sthurlow #define	FILE_CASE_SENSITIVE_SEARCH	0x00000001
3874bff34e3Sthurlow #define	FILE_CASE_PRESERVED_NAMES	0x00000002
3884bff34e3Sthurlow #define	FILE_UNICODE_ON_DISK		0x00000004
3894bff34e3Sthurlow #define	FILE_PERSISTENT_ACLS		0x00000008
3904bff34e3Sthurlow #define	FILE_FILE_COMPRESSION		0x00000010
3914bff34e3Sthurlow #define	FILE_VOLUME_QUOTAS		0x00000020
3924bff34e3Sthurlow #define	FILE_SUPPORTS_SPARSE_FILES	0x00000040
3934bff34e3Sthurlow #define	FILE_SUPPORTS_REPARSE_POINTS	0x00000080
3944bff34e3Sthurlow #define	FILE_SUPPORTS_REMOTE_STORAGE	0x00000100
3954bff34e3Sthurlow #define	FILE_SUPPORTS_LONG_NAMES	0x00004000
3964bff34e3Sthurlow #define	FILE_VOLUME_IS_COMPRESSED	0x00008000
3974bff34e3Sthurlow #define	FILE_SUPPORTS_OBJECT_IDS	0x00010000
3984bff34e3Sthurlow #define	FILE_SUPPORTS_ENCRYPTION	0x00020000
3994bff34e3Sthurlow #define	FILE_NAMED_STREAMS		0x00040000
4004bff34e3Sthurlow 
4014bff34e3Sthurlow /*
4024bff34e3Sthurlow  * SMB_TRANS2_QUERY_PATH levels
4034bff34e3Sthurlow  */
4044bff34e3Sthurlow #define	SMB_QFILEINFO_STANDARD			1
4054bff34e3Sthurlow #define	SMB_QFILEINFO_EA_SIZE			2
4064bff34e3Sthurlow #define	SMB_QFILEINFO_EAS_FROM_LIST		3
4074bff34e3Sthurlow #define	SMB_QFILEINFO_ALL_EAS			4
4084bff34e3Sthurlow #define	SMB_QFILEINFO_IS_NAME_VALID		6	/* QPATHINFO only? */
4094bff34e3Sthurlow #define	SMB_QFILEINFO_BASIC_INFO		0x101
4104bff34e3Sthurlow #define	SMB_QFILEINFO_STANDARD_INFO		0x102
4114bff34e3Sthurlow #define	SMB_QFILEINFO_EA_INFO			0x103
4124bff34e3Sthurlow #define	SMB_QFILEINFO_NAME_INFO			0x104
4134bff34e3Sthurlow #define	SMB_QFILEINFO_ALLOCATION_INFO		0x105
4144bff34e3Sthurlow #define	SMB_QFILEINFO_END_OF_FILE_INFO		0x106
4154bff34e3Sthurlow #define	SMB_QFILEINFO_ALL_INFO			0x107
4164bff34e3Sthurlow #define	SMB_QFILEINFO_ALT_NAME_INFO		0x108
4174bff34e3Sthurlow #define	SMB_QFILEINFO_STREAM_INFO		0x109
4184bff34e3Sthurlow #define	SMB_QFILEINFO_COMPRESSION_INFO		0x10b
4194bff34e3Sthurlow #define	SMB_QFILEINFO_UNIX_BASIC		0x200
4204bff34e3Sthurlow #define	SMB_QFILEINFO_UNIX_LINK			0x201
4214bff34e3Sthurlow #define	SMB_QFILEINFO_MAC_DT_GET_APPL		0x306
4224bff34e3Sthurlow #define	SMB_QFILEINFO_MAC_DT_GET_ICON		0x307
4234bff34e3Sthurlow #define	SMB_QFILEINFO_MAC_DT_GET_ICON_INFO	0x308
4244bff34e3Sthurlow #define	SMB_QFILEINFO_BASIC_INFORMATION		1004
4254bff34e3Sthurlow #define	SMB_QFILEINFO_STANDARD_INFORMATION	1005
4264bff34e3Sthurlow #define	SMB_QFILEINFO_INTERNAL_INFORMATION	1006
4274bff34e3Sthurlow #define	SMB_QFILEINFO_EA_INFORMATION		1007
4284bff34e3Sthurlow #define	SMB_QFILEINFO_ACCESS_INFORMATION	1008
4294bff34e3Sthurlow #define	SMB_QFILEINFO_NAME_INFORMATION		1009
4304bff34e3Sthurlow #define	SMB_QFILEINFO_POSITION_INFORMATION	1014
4314bff34e3Sthurlow #define	SMB_QFILEINFO_MODE_INFORMATION		1016
4324bff34e3Sthurlow #define	SMB_QFILEINFO_ALIGNMENT_INFORMATION	1017
4334bff34e3Sthurlow #define	SMB_QFILEINFO_ALL_INFORMATION		1018
4344bff34e3Sthurlow #define	SMB_QFILEINFO_ALT_NAME_INFORMATION	1021
4354bff34e3Sthurlow #define	SMB_QFILEINFO_STREAM_INFORMATION	1022
4364bff34e3Sthurlow #define	SMB_QFILEINFO_COMPRESSION_INFORMATION	1028
4374bff34e3Sthurlow #define	SMB_QFILEINFO_NETWORK_OPEN_INFORMATION	1034
4384bff34e3Sthurlow #define	SMB_QFILEINFO_ATTRIBUTE_TAG_INFORMATION 1035
4394bff34e3Sthurlow 
4404bff34e3Sthurlow /*
4414bff34e3Sthurlow  * SMB_TRANS2_FIND_FIRST2 information levels
4424bff34e3Sthurlow  */
4434bff34e3Sthurlow #define	SMB_FIND_STANDARD		1
4444bff34e3Sthurlow #define	SMB_FIND_EA_SIZE		2
4454bff34e3Sthurlow #define	SMB_FIND_EAS_FROM_LIST		3
4464bff34e3Sthurlow #define	SMB_FIND_DIRECTORY_INFO		0x101
4474bff34e3Sthurlow #define	SMB_FIND_FULL_DIRECTORY_INFO	0x102
4484bff34e3Sthurlow #define	SMB_FIND_NAME_INFO		0x103
4494bff34e3Sthurlow #define	SMB_FIND_BOTH_DIRECTORY_INFO	0x104
4504bff34e3Sthurlow #define	SMB_FIND_UNIX_INFO		0x200
4514bff34e3Sthurlow 
4524bff34e3Sthurlow /*
4534bff34e3Sthurlow  * Selectors for NT_TRANSACT_QUERY_SECURITY_DESC and
4544bff34e3Sthurlow  * NT_TRANSACT_SET_SECURITY_DESC.  Details found in the MSDN
4554bff34e3Sthurlow  * library by searching on security_information.
4564bff34e3Sthurlow  * Note the protected/unprotected bits did not exist in NT.
4574bff34e3Sthurlow  */
4584bff34e3Sthurlow 
4594bff34e3Sthurlow #define	OWNER_SECURITY_INFORMATION		0x00000001
4604bff34e3Sthurlow #define	GROUP_SECURITY_INFORMATION		0x00000002
4614bff34e3Sthurlow #define	DACL_SECURITY_INFORMATION		0x00000004
4624bff34e3Sthurlow #define	SACL_SECURITY_INFORMATION		0x00000008
4634bff34e3Sthurlow #define	UNPROTECTED_SACL_SECURITY_INFORMATION	0x10000000
4644bff34e3Sthurlow #define	UNPROTECTED_DACL_SECURITY_INFORMATION	0x20000000
4654bff34e3Sthurlow #define	PROTECTED_SACL_SECURITY_INFORMATION	0x40000000
4664bff34e3Sthurlow #define	PROTECTED_DACL_SECURITY_INFORMATION	0x80000000
4674bff34e3Sthurlow 
4684bff34e3Sthurlow /*
4694bff34e3Sthurlow  * security descriptor header
4704bff34e3Sthurlow  * it is followed by the optional SIDs and ACLs
4714bff34e3Sthurlow  * note this is "raw", ie little-endian
4724bff34e3Sthurlow  */
4734bff34e3Sthurlow struct ntsecdesc {
4744bff34e3Sthurlow 	uint8_t		sd_revision;	/* 0x01 observed between W2K */
4754bff34e3Sthurlow 	uint8_t		sd_pad1;
4764bff34e3Sthurlow 	uint16_t	sd_flags;
4774bff34e3Sthurlow 	uint32_t	sd_owneroff;	/* offset to owner SID */
4784bff34e3Sthurlow 	uint32_t	sd_groupoff;	/* offset to group SID */
4794bff34e3Sthurlow 	uint32_t	sd_sacloff;	/* offset to system/audit ACL */
4804bff34e3Sthurlow 	uint32_t	sd_dacloff;	/* offset to discretionary ACL */
4814bff34e3Sthurlow }; /* XXX: __attribute__((__packed__)); */
4824bff34e3Sthurlow typedef struct ntsecdesc ntsecdesc_t;
4834bff34e3Sthurlow 
4844bff34e3Sthurlow #define	wset_sdrevision(s) ((s)->sd_revision = 0x01)
4854bff34e3Sthurlow #define	sdflags(s) (letohs((s)->sd_flags))
4864bff34e3Sthurlow #define	wset_sdflags(s, f) ((s)->sd_flags = letohs(f))
4874bff34e3Sthurlow #define	sdowner(s) \
4884bff34e3Sthurlow 	((struct ntsid *)((s)->sd_owneroff ? \
4894bff34e3Sthurlow 	(char *)(s) + letohl((s)->sd_owneroff) : \
4904bff34e3Sthurlow 	NULL))
4914bff34e3Sthurlow #define	wset_sdowneroff(s, o) ((s)->sd_owneroff = htolel(o))
4924bff34e3Sthurlow #define	sdgroup(s) \
4934bff34e3Sthurlow 	((struct ntsid *)((s)->sd_groupoff ? \
4944bff34e3Sthurlow 	(char *)(s) + letohl((s)->sd_groupoff) : \
4954bff34e3Sthurlow 	NULL))
4964bff34e3Sthurlow #define	wset_sdgroupoff(s, o) ((s)->sd_groupoff = htolel(o))
4974bff34e3Sthurlow #define	sdsacl(s) \
4984bff34e3Sthurlow 	((struct ntacl *)((s)->sd_sacloff ? \
4994bff34e3Sthurlow 	(char *)(s) + letohl((s)->sd_sacloff) : \
5004bff34e3Sthurlow 	NULL))
5014bff34e3Sthurlow #define	wset_sdsacloff(s, o) ((s)->sd_sacloff = htolel(o))
5024bff34e3Sthurlow #define	sddacl(s) \
5034bff34e3Sthurlow 	((struct ntacl *)((s)->sd_dacloff ? \
5044bff34e3Sthurlow 	(char *)(s) + letohl((s)->sd_dacloff) : \
5054bff34e3Sthurlow 	NULL))
5064bff34e3Sthurlow #define	wset_sddacloff(s, o) ((s)->sd_dacloff = htolel(o))
5074bff34e3Sthurlow 
5084bff34e3Sthurlow /*
5094bff34e3Sthurlow  * sd_flags bits
5104bff34e3Sthurlow  */
5114bff34e3Sthurlow #define	SD_OWNER_DEFAULTED		0x0001
5124bff34e3Sthurlow #define	SD_GROUP_DEFAULTED		0x0002
5134bff34e3Sthurlow #define	SD_DACL_PRESENT			0x0004
5144bff34e3Sthurlow #define	SD_DACL_DEFAULTED		0x0008
5154bff34e3Sthurlow #define	SD_SACL_PRESENT			0x0010
5164bff34e3Sthurlow #define	SD_SACL_DEFAULTED		0x0020
5174bff34e3Sthurlow #define	SD_DACL_TRUSTED			0x0040
5184bff34e3Sthurlow #define	SD_SERVER_SECURITY		0x0080
5194bff34e3Sthurlow #define	SD_DACL_AUTO_INHERIT_REQ	0x0100
5204bff34e3Sthurlow #define	SD_SACL_AUTO_INHERIT_REQ	0x0200
5214bff34e3Sthurlow #define	SD_DACL_AUTO_INHERITED		0x0400
5224bff34e3Sthurlow #define	SD_SACL_AUTO_INHERITED		0x0800
5234bff34e3Sthurlow #define	SD_DACL_PROTECTED		0x1000
5244bff34e3Sthurlow #define	SD_SACL_PROTECTED		0x2000
5254bff34e3Sthurlow #define	SD_RM_CONTROL_VALID		0x4000
5264bff34e3Sthurlow #define	SD_SELF_RELATIVE		0x8000
5274bff34e3Sthurlow 
5284bff34e3Sthurlow /*
5294bff34e3Sthurlow  * access control list header
5304bff34e3Sthurlow  * it is followed by the ACEs
5314bff34e3Sthurlow  * note this is "raw", ie little-endian
5324bff34e3Sthurlow  */
5334bff34e3Sthurlow struct ntacl {
5344bff34e3Sthurlow 	uint8_t	acl_revision;	/* 0x02 observed with W2K */
5354bff34e3Sthurlow 	uint8_t	acl_pad1;
5364bff34e3Sthurlow 	uint16_t	acl_len; /* bytes; includes this header */
5374bff34e3Sthurlow 	uint16_t	acl_acecount;
5384bff34e3Sthurlow 	uint16_t	acl_pad2;
5394bff34e3Sthurlow }; /* XXX: __attribute__((__packed__)); */
5404bff34e3Sthurlow typedef struct ntacl ntacl_t;
5414bff34e3Sthurlow 
5424bff34e3Sthurlow #define	wset_aclrevision(a) ((a)->acl_revision = 0x02)
5434bff34e3Sthurlow #define	acllen(a) (letohs((a)->acl_len))
5444bff34e3Sthurlow #define	wset_acllen(a, l) ((a)->acl_len = htoles(l))
5454bff34e3Sthurlow #define	aclacecount(a) (letohs((a)->acl_acecount))
5464bff34e3Sthurlow #define	wset_aclacecount(a, c) ((a)->acl_acecount = htoles(c))
5474bff34e3Sthurlow #define	aclace(a) ((struct ntace *)((char *)(a) + sizeof (struct ntacl)))
5484bff34e3Sthurlow 
5494bff34e3Sthurlow /*
5504bff34e3Sthurlow  * access control entry header
5514bff34e3Sthurlow  * it is followed by type-specific ace data,
5524bff34e3Sthurlow  * which for the simple types is just a SID
5534bff34e3Sthurlow  * note this is "raw", ie little-endian
5544bff34e3Sthurlow  */
5554bff34e3Sthurlow struct ntace {
5564bff34e3Sthurlow 	uint8_t	ace_type;
5574bff34e3Sthurlow 	uint8_t	ace_flags;
5584bff34e3Sthurlow 	uint16_t	ace_len; /* bytes; includes this header */
5594bff34e3Sthurlow 	uint32_t	ace_rights; /* generic, standard, specific, etc */
5604bff34e3Sthurlow }; /* XXX: __attribute__((__packed__)); */
5614bff34e3Sthurlow 
5624bff34e3Sthurlow #define	acetype(a) ((a)->ace_type)
5634bff34e3Sthurlow #define	wset_acetype(a, t) ((a)->ace_type = (t))
5644bff34e3Sthurlow #define	aceflags(a) ((a)->ace_flags)
5654bff34e3Sthurlow #define	wset_aceflags(a, f) ((a)->ace_flags = (f))
5664bff34e3Sthurlow #define	acelen(a) (letohs((a)->ace_len))
5674bff34e3Sthurlow #define	wset_acelen(a, l) ((a)->ace_len = htoles(l))
5684bff34e3Sthurlow #define	acerights(a) (letohl((a)->ace_rights))
5694bff34e3Sthurlow #define	wset_acerights(a, r) ((a)->ace_rights = htolel(r))
5704bff34e3Sthurlow #define	aceace(a) ((struct ntace *)((char *)(a) + acelen(a)))
5714bff34e3Sthurlow #define	acesid(a) ((struct ntsid *)((char *)(a) + sizeof (struct ntace)))
5724bff34e3Sthurlow 
5734bff34e3Sthurlow /*
5744bff34e3Sthurlow  * ace_rights
5754bff34e3Sthurlow  * (Samba bit names are used here, with permission, as the shorter Windows
5764bff34e3Sthurlow  * names are more likely to cause namespace collisions)
5774bff34e3Sthurlow  */
5784bff34e3Sthurlow #define	SA_RIGHT_FILE_READ_DATA		0x00000001
5794bff34e3Sthurlow #define	SA_RIGHT_FILE_WRITE_DATA	0x00000002
5804bff34e3Sthurlow #define	SA_RIGHT_FILE_APPEND_DATA	0x00000004
5814bff34e3Sthurlow #define	SA_RIGHT_FILE_READ_EA		0x00000008
5824bff34e3Sthurlow #define	SA_RIGHT_FILE_WRITE_EA		0x00000010
5834bff34e3Sthurlow #define	SA_RIGHT_FILE_EXECUTE		0x00000020
5844bff34e3Sthurlow #define	SA_RIGHT_FILE_DELETE_CHILD	0x00000040
5854bff34e3Sthurlow #define	SA_RIGHT_FILE_READ_ATTRIBUTES	0x00000080
5864bff34e3Sthurlow #define	SA_RIGHT_FILE_WRITE_ATTRIBUTES	0x00000100
5874bff34e3Sthurlow #define	SA_RIGHT_FILE_ALL_ACCESS	0x000001FF
5884bff34e3Sthurlow 
5894bff34e3Sthurlow #define	STD_RIGHT_DELETE_ACCESS		0x00010000
5904bff34e3Sthurlow #define	STD_RIGHT_READ_CONTROL_ACCESS	0x00020000
5914bff34e3Sthurlow #define	STD_RIGHT_WRITE_DAC_ACCESS	0x00040000
5924bff34e3Sthurlow #define	STD_RIGHT_WRITE_OWNER_ACCESS	0x00080000
5934bff34e3Sthurlow #define	STD_RIGHT_SYNCHRONIZE_ACCESS	0x00100000
5944bff34e3Sthurlow #define	STD_RIGHT_ALL_ACCESS		0x001F0000
5954bff34e3Sthurlow 
5964bff34e3Sthurlow #define	SEC_RIGHT_SYSTEM_SECURITY	0x01000000
5974bff34e3Sthurlow /*
5984bff34e3Sthurlow  * Don't use MAXIMUM_ALLOWED as Samba (2.2.3 at least) will
5994bff34e3Sthurlow  * return NT_STATUS_INVALID_LOCK_SEQUENCE
6004bff34e3Sthurlow  */
6014bff34e3Sthurlow #define	SEC_RIGHT_MAXIMUM_ALLOWED	0x02000000
6024bff34e3Sthurlow 
6034bff34e3Sthurlow #define	GENERIC_RIGHT_ALL_ACCESS	0x10000000
6044bff34e3Sthurlow #define	GENERIC_RIGHT_EXECUTE_ACCESS	0x20000000
6054bff34e3Sthurlow #define	GENERIC_RIGHT_WRITE_ACCESS	0x40000000
6064bff34e3Sthurlow #define	GENERIC_RIGHT_READ_ACCESS	0x80000000
6074bff34e3Sthurlow 
6084bff34e3Sthurlow /*
6094bff34e3Sthurlow  * these mappings are from Windows sample code but are likely incomplete
6104bff34e3Sthurlow  *
6114bff34e3Sthurlow  * GENERIC_RIGHT_READ_ACCESS :
6124bff34e3Sthurlow  *	STD_RIGHT_SYNCHRONIZE_ACCESS |
6134bff34e3Sthurlow  *	STD_RIGHT_READ_CONTROL_ACCESS |
6144bff34e3Sthurlow  *	SA_RIGHT_FILE_READ_ATTRIBUTES |
6154bff34e3Sthurlow  *	SA_RIGHT_FILE_READ_EA |
6164bff34e3Sthurlow  *	SA_RIGHT_FILE_READ_DATA
6174bff34e3Sthurlow  * GENERIC_RIGHT_WRITE_ACCESS :
6184bff34e3Sthurlow  *	STD_RIGHT_SYNCHRONIZE_ACCESS |
6194bff34e3Sthurlow  *	STD_RIGHT_READ_CONTROL_ACCESS |
6204bff34e3Sthurlow  *	SA_RIGHT_FILE_WRITE_ATTRIBUTES |
6214bff34e3Sthurlow  *	SA_RIGHT_FILE_WRITE_EA |
6224bff34e3Sthurlow  *	SA_RIGHT_FILE_APPEND_DATA |
6234bff34e3Sthurlow  *	SA_RIGHT_FILE_WRITE_DATA
6244bff34e3Sthurlow  * GENERIC_RIGHT_EXECUTE_ACCESS :
6254bff34e3Sthurlow  *	STD_RIGHT_SYNCHRONIZE_ACCESS |
6264bff34e3Sthurlow  *	STD_RIGHT_READ_CONTROL_ACCESS |
6274bff34e3Sthurlow  *	SA_RIGHT_FILE_READ_ATTRIBUTES |
6284bff34e3Sthurlow  *	SA_RIGHT_FILE_EXECUTE
6294bff34e3Sthurlow  * GENERIC_RIGHT_ALL_ACCESS :
6304bff34e3Sthurlow  *	STD_RIGHT_SYNCHRONIZE_ACCESS |
6314bff34e3Sthurlow  *	STD_RIGHT_WRITE_OWNER_ACCESS |
6324bff34e3Sthurlow  *	STD_RIGHT_WRITE_DAC_ACCESS |
6334bff34e3Sthurlow  *	STD_RIGHT_READ_CONTROL_ACCESS |
6344bff34e3Sthurlow  *	STD_RIGHT_DELETE_ACCESS |
6354bff34e3Sthurlow  *	SA_RIGHT_FILE_ALL_ACCESS
6364bff34e3Sthurlow  */
6374bff34e3Sthurlow 
6384bff34e3Sthurlow /*
6394bff34e3Sthurlow  * security identifier header
6404bff34e3Sthurlow  * it is followed by sid_numauth sub-authorities,
6414bff34e3Sthurlow  * which are 32 bits each.
6424bff34e3Sthurlow  * note the subauths are little-endian on the wire, but
6434bff34e3Sthurlow  * need to be big-endian for memberd/DS
6444bff34e3Sthurlow  */
6454bff34e3Sthurlow #define	SIDAUTHSIZE 6
6464bff34e3Sthurlow struct ntsid {
6474bff34e3Sthurlow 	uint8_t	sid_revision;
6484bff34e3Sthurlow 	uint8_t	sid_subauthcount;
6494bff34e3Sthurlow 	uint8_t	sid_authority[SIDAUTHSIZE]; /* ie not little endian */
6504bff34e3Sthurlow }; /* XXX: __attribute__((__packed__)); */
6514bff34e3Sthurlow typedef struct ntsid ntsid_t;
6524bff34e3Sthurlow 
6534bff34e3Sthurlow #define	sidsubauthcount(s) (s->sid_subauthcount)
6544bff34e3Sthurlow #define	sidlen(s) (sizeof (struct ntsid) + 4 * (s)->sid_subauthcount)
6554bff34e3Sthurlow #define	MAXSIDLEN (sizeof (struct ntsid) + 4 * KAUTH_NTSID_MAX_AUTHORITIES)
6564bff34e3Sthurlow #define	sidsub(s) ((uint32_t *)((char *)(s) + sizeof (struct ntsid)))
6574bff34e3Sthurlow 
6584bff34e3Sthurlow /*
6594bff34e3Sthurlow  * MS' defined values for ace_type
6604bff34e3Sthurlow  */
6614bff34e3Sthurlow #define	ACCESS_ALLOWED_ACE_TYPE			0x0
6624bff34e3Sthurlow #define	ACCESS_DENIED_ACE_TYPE			0x1
6634bff34e3Sthurlow #define	SYSTEM_AUDIT_ACE_TYPE			0x2
6644bff34e3Sthurlow #define	SYSTEM_ALARM_ACE_TYPE			0x3
6654bff34e3Sthurlow #define	ACCESS_ALLOWED_COMPOUND_ACE_TYPE	0x4
6664bff34e3Sthurlow #define	ACCESS_ALLOWED_OBJECT_ACE_TYPE		0x5
6674bff34e3Sthurlow #define	ACCESS_DENIED_OBJECT_ACE_TYPE		0x6
6684bff34e3Sthurlow #define	SYSTEM_AUDIT_OBJECT_ACE_TYPE		0x7
6694bff34e3Sthurlow #define	SYSTEM_ALARM_OBJECT_ACE_TYPE		0x8
6704bff34e3Sthurlow #define	ACCESS_ALLOWED_CALLBACK_ACE_TYPE	0x9
6714bff34e3Sthurlow #define	ACCESS_DENIED_CALLBACK_ACE_TYPE		0xA
6724bff34e3Sthurlow #define	ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE	0xB
6734bff34e3Sthurlow #define	ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE	0xC
6744bff34e3Sthurlow #define	SYSTEM_AUDIT_CALLBACK_ACE_TYPE		0xD
6754bff34e3Sthurlow #define	SYSTEM_ALARM_CALLBACK_ACE_TYPE		0xE
6764bff34e3Sthurlow #define	SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE	0xF
6774bff34e3Sthurlow #define	SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE	0x10
6784bff34e3Sthurlow 
6794bff34e3Sthurlow /*
6804bff34e3Sthurlow  * MS' defined values for ace_flags
6814bff34e3Sthurlow  */
6824bff34e3Sthurlow #define	OBJECT_INHERIT_ACE_FLAG			0x01
6834bff34e3Sthurlow #define	CONTAINER_INHERIT_ACE_FLAG		0x02
6844bff34e3Sthurlow #define	NO_PROPAGATE_INHERIT_ACE_FLAG		0x04
6854bff34e3Sthurlow #define	INHERIT_ONLY_ACE_FLAG			0x08
6864bff34e3Sthurlow #define	INHERITED_ACE_FLAG			0x10
6874bff34e3Sthurlow #define	UNDEF_ACE_FLAG				0x20 /* MS doesn't define it */
6884bff34e3Sthurlow #define	VALID_INHERIT_ACE_FLAGS			0x1F
6894bff34e3Sthurlow #define	SUCCESSFUL_ACCESS_ACE_FLAG		0x40
6904bff34e3Sthurlow #define	FAILED_ACCESS_ACE_FLAG			0x80
6914bff34e3Sthurlow 
6924bff34e3Sthurlow /*
6934bff34e3Sthurlow  * Set PATH/FILE information levels
6944bff34e3Sthurlow  */
6954bff34e3Sthurlow #define	SMB_SFILEINFO_STANDARD			1
6964bff34e3Sthurlow #define	SMB_SFILEINFO_EA_SET			2
6974bff34e3Sthurlow #define	SMB_SFILEINFO_BASIC_INFO		0x101
6984bff34e3Sthurlow #define	SMB_SFILEINFO_DISPOSITION_INFO		0x102
6994bff34e3Sthurlow #define	SMB_SFILEINFO_ALLOCATION_INFO		0x103
7004bff34e3Sthurlow #define	SMB_SFILEINFO_END_OF_FILE_INFO		0x104
7014bff34e3Sthurlow #define	SMB_SFILEINFO_UNIX_BASIC		0x200
7024bff34e3Sthurlow #define	SMB_SFILEINFO_UNIX_LINK			0x201
7034bff34e3Sthurlow #define	SMB_SFILEINFO_UNIX_HLINK		0x203
7044bff34e3Sthurlow #define	SMB_SFILEINFO_DIRECTORY_INFORMATION	1001
7054bff34e3Sthurlow #define	SMB_SFILEINFO_FULL_DIRECTORY_INFORMATION	1002
7064bff34e3Sthurlow #define	SMB_SFILEINFO_BOTH_DIRECTORY_INFORMATION	1003
7074bff34e3Sthurlow #define	SMB_SFILEINFO_BASIC_INFORMATION		1004
7084bff34e3Sthurlow #define	SMB_SFILEINFO_STANDARD_INFORMATION	1005
7094bff34e3Sthurlow #define	SMB_SFILEINFO_INTERNAL_INFORMATION	1006
7104bff34e3Sthurlow #define	SMB_SFILEINFO_EA_INFORMATION		1007
7114bff34e3Sthurlow #define	SMB_SFILEINFO_ACCESS_INFORMATION	1008
7124bff34e3Sthurlow #define	SMB_SFILEINFO_NAME_INFORMATION		1009
7134bff34e3Sthurlow #define	SMB_SFILEINFO_RENAME_INFORMATION	1010
7144bff34e3Sthurlow #define	SMB_SFILEINFO_LINK_INFORMATION		1011
7154bff34e3Sthurlow #define	SMB_SFILEINFO_NAMES_INFORMATION		1012
7164bff34e3Sthurlow #define	SMB_SFILEINFO_DISPOSITION_INFORMATION	1013
7174bff34e3Sthurlow #define	SMB_SFILEINFO_POSITION_INFORMATION	1014
7184bff34e3Sthurlow #define	SMB_SFILEINFO_1015			1015 /* ? */
7194bff34e3Sthurlow #define	SMB_SFILEINFO_MODE_INFORMATION		1016
7204bff34e3Sthurlow #define	SMB_SFILEINFO_ALIGNMENT_INFORMATION	1017
7214bff34e3Sthurlow #define	SMB_SFILEINFO_ALL_INFORMATION		1018
7224bff34e3Sthurlow #define	SMB_SFILEINFO_ALLOCATION_INFORMATION	1019
7234bff34e3Sthurlow #define	SMB_SFILEINFO_END_OF_FILE_INFORMATION	1020
7244bff34e3Sthurlow #define	SMB_SFILEINFO_ALT_NAME_INFORMATION	1021
7254bff34e3Sthurlow #define	SMB_SFILEINFO_STREAM_INFORMATION	1022
7264bff34e3Sthurlow #define	SMB_SFILEINFO_PIPE_INFORMATION		1023
7274bff34e3Sthurlow #define	SMB_SFILEINFO_PIPE_LOCAL_INFORMATION	1024
7284bff34e3Sthurlow #define	SMB_SFILEINFO_PIPE_REMOTE_INFORMATION	1025
7294bff34e3Sthurlow #define	SMB_SFILEINFO_MAILSLOT_QUERY_INFORMATION	1026
7304bff34e3Sthurlow #define	SMB_SFILEINFO_MAILSLOT_SET_INFORMATION		1027
7314bff34e3Sthurlow #define	SMB_SFILEINFO_COMPRESSION_INFORMATION		1028
7324bff34e3Sthurlow #define	SMB_SFILEINFO_OBJECT_ID_INFORMATION		1029
7334bff34e3Sthurlow #define	SMB_SFILEINFO_COMPLETION_INFORMATION		1030
7344bff34e3Sthurlow #define	SMB_SFILEINFO_MOVE_CLUSTER_INFORMATION		1031
7354bff34e3Sthurlow #define	SMB_SFILEINFO_QUOTA_INFORMATION		1032
7364bff34e3Sthurlow #define	SMB_SFILEINFO_REPARSE_POINT_INFORMATION	1033
7374bff34e3Sthurlow #define	SMB_SFILEINFO_NETWORK_OPEN_INFORMATION	1034
7384bff34e3Sthurlow #define	SMB_SFILEINFO_ATTRIBUTE_TAG_INFORMATION 1035
7394bff34e3Sthurlow #define	SMB_SFILEINFO_TRACKING_INFORMATION	1036
7404bff34e3Sthurlow #define	SMB_SFILEINFO_MAXIMUM_INFORMATION	1037
7414bff34e3Sthurlow 
7424bff34e3Sthurlow /*
7434bff34e3Sthurlow  * LOCKING_ANDX LockType flags
7444bff34e3Sthurlow  */
7454bff34e3Sthurlow #define	SMB_LOCKING_ANDX_SHARED_LOCK	0x01
7464bff34e3Sthurlow #define	SMB_LOCKING_ANDX_OPLOCK_RELEASE	0x02
7474bff34e3Sthurlow #define	SMB_LOCKING_ANDX_CHANGE_LOCKTYPE 0x04
7484bff34e3Sthurlow #define	SMB_LOCKING_ANDX_CANCEL_LOCK	0x08
7494bff34e3Sthurlow #define	SMB_LOCKING_ANDX_LARGE_FILES	0x10
7504bff34e3Sthurlow 
7514bff34e3Sthurlow /*
7524bff34e3Sthurlow  * Error classes
7534bff34e3Sthurlow  */
7544bff34e3Sthurlow #define	SMBSUCCESS	0x00
7554bff34e3Sthurlow #define	ERRDOS		0x01
7564bff34e3Sthurlow #define	ERRSRV		0x02
7574bff34e3Sthurlow #define	ERRHRD		0x03	/* Error is an hardware error. */
7584bff34e3Sthurlow #define	ERRCMD		0xFF	/* Command was not in the "SMB" format. */
7594bff34e3Sthurlow 
7604bff34e3Sthurlow /*
7614bff34e3Sthurlow  * Error codes for the ERRDOS class
7624bff34e3Sthurlow  */
7634bff34e3Sthurlow #define	ERRbadfunc	1	/* Invalid function */
7644bff34e3Sthurlow #define	ERRbadfile	2	/* File not found (last component) */
7654bff34e3Sthurlow #define	ERRbadpath	3	/* Directory invalid */
7664bff34e3Sthurlow #define	ERRnofids	4	/* Too many open files */
7674bff34e3Sthurlow #define	ERRnoaccess	5	/* Access denied */
7684bff34e3Sthurlow #define	ERRbadfid	6	/* Invalid file handle */
7694bff34e3Sthurlow #define	ERRbadmcb	7	/* Memory control blocks destroyed (huh ?) */
7704bff34e3Sthurlow #define	ERRnomem	8	/* Insufficient memory */
7714bff34e3Sthurlow #define	ERRbadmem	9	/* Invalid memory block address */
7724bff34e3Sthurlow #define	ERRbadenv	10	/* Invalid environment */
7734bff34e3Sthurlow #define	ERRbadformat	11	/* Invalid format */
7744bff34e3Sthurlow #define	ERRbadaccess	12	/* Invalid open mode */
7754bff34e3Sthurlow #define	ERRbaddata	13	/* Invalid data */
7764bff34e3Sthurlow #define	ERRoutofmem	14	/* out of memory */
7774bff34e3Sthurlow #define	ERRbaddrive	15	/* Invalid drive specified */
7784bff34e3Sthurlow #define	ERRremcd	16	/* An attempt to delete current directory */
7794bff34e3Sthurlow #define	ERRdiffdevice	17	/* cross fs rename/move */
7804bff34e3Sthurlow #define	ERRnofiles	18	/* no more files found in file search */
7814bff34e3Sthurlow #define	ERRwriteprotect	19
7824bff34e3Sthurlow #define	ERRnotready	21
7834bff34e3Sthurlow #define	ERRbadcmd	22
7844bff34e3Sthurlow #define	ERRcrc		23
7854bff34e3Sthurlow #define	ERRbadlength	24
7864bff34e3Sthurlow #define	ERRsectornotfound	27
7874bff34e3Sthurlow #define	ERRbadshare	32	/* Share mode can't be granted */
7884bff34e3Sthurlow #define	ERRlock		33	/* Lock conflicts with existing lock */
7894bff34e3Sthurlow #define	ERRwrongdisk	34
7904bff34e3Sthurlow #define	ERRhandleeof	38
7914bff34e3Sthurlow #define	ERRunsup	50	/* unsupported - Win 95 */
7924bff34e3Sthurlow #define	ERRnetnamedel	64
7934bff34e3Sthurlow #define	ERRnoipc	66	/* ipc unsupported */
7944bff34e3Sthurlow #define	ERRnosuchshare	67	/* invalid share name */
7954bff34e3Sthurlow #define	ERRtoomanynames	68
7964bff34e3Sthurlow #define	ERRfilexists	80	/* requested file name already exists */
7974bff34e3Sthurlow #define	ERRinvalidparam 87
7984bff34e3Sthurlow #define	ERRcannotopen	110	/* cannot open the file */
7994bff34e3Sthurlow #define	ERRinsufficientbuffer 122
8004bff34e3Sthurlow #define	ERRinvalidname	123
8014bff34e3Sthurlow #define	ERRunknownlevel 124
8024bff34e3Sthurlow #define	ERRdirnotempty	145
8034bff34e3Sthurlow #define	ERRnotlocked	158	/* region was not locked by this context */
8044bff34e3Sthurlow #define	ERRrename	183
8054bff34e3Sthurlow #define	ERRbadpipe	230	/* named pipe invalid */
8064bff34e3Sthurlow #define	ERRpipebusy	231	/* all pipe instances are busy */
8074bff34e3Sthurlow #define	ERRpipeclosing	232	/* close in progress */
8084bff34e3Sthurlow #define	ERRnotconnected	233	/* nobody on other end of pipe */
8094bff34e3Sthurlow #define	ERRmoredata	234	/* more data to be returned */
8104bff34e3Sthurlow #define	ERRnomoreitems 259
8114bff34e3Sthurlow #define	ERRbaddirectory	267	/* invalid directory name */
8124bff34e3Sthurlow #define	ERReasunsupported	282	/* extended attributes not supported */
8134bff34e3Sthurlow #define	ERRlogonfailure 1326
8144bff34e3Sthurlow #define	ERRbuftoosmall	2123
8154bff34e3Sthurlow #define	ERRunknownipc	2142
8164bff34e3Sthurlow #define	ERRnosuchprintjob	2151
8174bff34e3Sthurlow #define	ERRinvgroup 2455
8184bff34e3Sthurlow 
8194bff34e3Sthurlow /*
8204bff34e3Sthurlow  * Error codes for the ERRSRV class
8214bff34e3Sthurlow  */
8224bff34e3Sthurlow #define	ERRerror	1	/* Non-specific error code */
8234bff34e3Sthurlow #define	ERRbadpw	2	/* Bad password */
8244bff34e3Sthurlow #define	ERRbadtype	3	/* reserved */
8254bff34e3Sthurlow #define	ERRaccess	4	/* client doesn't have enough access rights */
8264bff34e3Sthurlow #define	ERRinvnid	5	/* The Tid specified in a command is invalid */
8274bff34e3Sthurlow #define	ERRinvnetname	6	/* Invalid server name in the tree connect */
8284bff34e3Sthurlow #define	ERRinvdevice	7	/* Printer and not printer devices are mixed */
8294bff34e3Sthurlow #define	ERRqfull	49	/* Print queue full */
8304bff34e3Sthurlow #define	ERRqtoobig	50	/* Print queue full - no space */
8314bff34e3Sthurlow #define	ERRinvpfid	52	/* Invalid print file FID */
8324bff34e3Sthurlow #define	ERRsmbcmd	64	/* The server did not recognise the command */
8334bff34e3Sthurlow #define	ERRsrverror	65	/* The server encountered and internal error */
8344bff34e3Sthurlow #define	ERRfilespecs	67	/* The Fid and path name contains an */
8354bff34e3Sthurlow 				/* invalid combination */
8364bff34e3Sthurlow #define	ERRbadpermits	69	/* Access mode invalid */
8374bff34e3Sthurlow #define	ERRsetattrmode	71	/* Attribute mode invalid */
8384bff34e3Sthurlow #define	ERRpaused	81	/* Server is paused */
8394bff34e3Sthurlow #define	ERRmsgoff	82	/* Not receiving messages */
8404bff34e3Sthurlow #define	ERRnoroom	83	/* No room to buffer message */
8414bff34e3Sthurlow #define	ERRrmuns	87	/* Too many remote user names */
8424bff34e3Sthurlow #define	ERRtimeout	88	/* Operation timed out */
8434bff34e3Sthurlow #define	ERRnoresource	89	/* No resources currently available for req */
8444bff34e3Sthurlow #define	ERRtoomanyuids	90	/* Too many UIDs active on this session */
8454bff34e3Sthurlow #define	ERRbaduid	91	/* The UID is not known in this session */
8464bff34e3Sthurlow #define	ERRusempx	250	/* Temporarily unable to support Raw, */
8474bff34e3Sthurlow 				/* use MPX mode */
8484bff34e3Sthurlow #define	ERRusestd	251	/* Temporarily unable to support Raw, */
8494bff34e3Sthurlow 				/* use stdandard r/w */
8504bff34e3Sthurlow #define	ERRcontmpx	252	/* Continue in MPX mode */
8514bff34e3Sthurlow #define	ERRacctexpired	2239
8524bff34e3Sthurlow #define	ERRnosupport	65535	/* Invalid function */
8534bff34e3Sthurlow 
8544bff34e3Sthurlow /*
8554bff34e3Sthurlow  * Error codes for the ERRHRD class
8564bff34e3Sthurlow  */
8574bff34e3Sthurlow #define	ERRnowrite	19	/* write protected media */
8584bff34e3Sthurlow #define	ERRbadunit	20	/* Unknown unit */
8594bff34e3Sthurlow #define	ERRnotready	21	/* Drive not ready */
8604bff34e3Sthurlow #define	ERRbadcmd	22	/* Unknown command */
8614bff34e3Sthurlow #define	ERRdata		23	/* Data error (CRC) */
8624bff34e3Sthurlow #define	ERRbadreq	24	/* Bad request structure length */
8634bff34e3Sthurlow #define	ERRseek		25	/* Seek error */
8644bff34e3Sthurlow #define	ERRbadmedia	26	/* Unknown media type */
8654bff34e3Sthurlow #define	ERRbadsector	27	/* Sector not found */
8664bff34e3Sthurlow #define	ERRnopaper	28	/* Printer out of paper */
8674bff34e3Sthurlow #define	ERRwrite	29	/* Write fault */
8684bff34e3Sthurlow #define	ERRread		30	/* Read fault */
8694bff34e3Sthurlow #define	ERRgeneral	31	/* General failure */
8704bff34e3Sthurlow #define	ERRbadshare	32	/* A open conflicts with an existing open */
8714bff34e3Sthurlow #define	ERRlock		33	/* lock/unlock conflict */
8724bff34e3Sthurlow #define	ERRwrongdisk	34	/* The wrong disk was found in a drive */
8734bff34e3Sthurlow #define	ERRFCBunavail	35	/* No FCBs available */
8744bff34e3Sthurlow #define	ERRsharebufexc	36	/* A sharing buffer has been exceeded */
8754bff34e3Sthurlow #define	ERRdiskfull	39
8764bff34e3Sthurlow 
8774bff34e3Sthurlow /*
8784bff34e3Sthurlow  * RAP error codes (it seems that they returned not only by RAP)
8794bff34e3Sthurlow  */
8804bff34e3Sthurlow #define	SMB_ERROR_ACCESS_DENIED		5
8814bff34e3Sthurlow #define	SMB_ERROR_NETWORK_ACCESS_DENIED	65
8824bff34e3Sthurlow #define	SMB_ERROR_MORE_DATA		ERRmoredata
8834bff34e3Sthurlow 
8844bff34e3Sthurlow /*
8854bff34e3Sthurlow  * An INCOMPLETE list of 32 bit error codes
8864bff34e3Sthurlow  * For more detail see MSDN and ntstatus.h in the MS DDK
8874bff34e3Sthurlow  *
8884bff34e3Sthurlow  * XXX - these should have the severity and "customer defined" fields
8894bff34e3Sthurlow  * added back in, and smb_maperr32() shouldn't mask those fields out;
8904bff34e3Sthurlow  * 0x80000005 is STATUS_BUFFER_OVERFLOW, with 0xC0000000 is
8914bff34e3Sthurlow  * STATUS_ACCESS_VIOLATION, and we need to distinguish between them.
8924bff34e3Sthurlow  * We use STATUS_BUFFER_OVERFLOW, and need to know its exact value,
8934bff34e3Sthurlow  * so we #define	it correctly here; don't strip off the leading
8944bff34e3Sthurlow  * 0x80000000 from it!
8954bff34e3Sthurlow  */
8964bff34e3Sthurlow #define	NT_STATUS_BUFFER_OVERFLOW	0x80000005
8974bff34e3Sthurlow #define	NT_STATUS_UNSUCCESSFUL		0x0001
8984bff34e3Sthurlow #define	NT_STATUS_NOT_IMPLEMENTED	0x0002
8994bff34e3Sthurlow #define	NT_STATUS_INVALID_INFO_CLASS	0x0003
9004bff34e3Sthurlow #define	NT_STATUS_INFO_LENGTH_MISMATCH	0x0004
9014bff34e3Sthurlow #define	NT_STATUS_ACCESS_VIOLATION	0x0005
9024bff34e3Sthurlow #define	NT_STATUS_IN_PAGE_ERROR		0x0006
9034bff34e3Sthurlow #define	NT_STATUS_PAGEFILE_QUOTA	0x0007
9044bff34e3Sthurlow #define	NT_STATUS_INVALID_HANDLE	0x0008
9054bff34e3Sthurlow #define	NT_STATUS_BAD_INITIAL_STACK	0x0009
9064bff34e3Sthurlow #define	NT_STATUS_BAD_INITIAL_PC	0x000a
9074bff34e3Sthurlow #define	NT_STATUS_INVALID_CID		0x000b
9084bff34e3Sthurlow #define	NT_STATUS_TIMER_NOT_CANCELED	0x000c
9094bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER	0x000d
9104bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_DEVICE	0x000e
9114bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_FILE		0x000f
9124bff34e3Sthurlow #define	NT_STATUS_INVALID_DEVICE_REQUEST	0x0010
9134bff34e3Sthurlow #define	NT_STATUS_END_OF_FILE		0x0011
9144bff34e3Sthurlow #define	NT_STATUS_WRONG_VOLUME		0x0012
9154bff34e3Sthurlow #define	NT_STATUS_NO_MEDIA_IN_DEVICE	0x0013
9164bff34e3Sthurlow #define	NT_STATUS_UNRECOGNIZED_MEDIA	0x0014
9174bff34e3Sthurlow #define	NT_STATUS_NONEXISTENT_SECTOR	0x0015
9184bff34e3Sthurlow #define	NT_STATUS_MORE_PROCESSING_REQUIRED	0x0016
9194bff34e3Sthurlow #define	NT_STATUS_NO_MEMORY		0x0017
9204bff34e3Sthurlow #define	NT_STATUS_CONFLICTING_ADDRESSES	0x0018
9214bff34e3Sthurlow #define	NT_STATUS_NOT_MAPPED_VIEW	0x0019
9224bff34e3Sthurlow #define	NT_STATUS_UNABLE_TO_FREE_VM	0x001a
9234bff34e3Sthurlow #define	NT_STATUS_UNABLE_TO_DELETE_SECTION	0x001b
9244bff34e3Sthurlow #define	NT_STATUS_INVALID_SYSTEM_SERVICE	0x001c
9254bff34e3Sthurlow #define	NT_STATUS_ILLEGAL_INSTRUCTION	0x001d
9264bff34e3Sthurlow #define	NT_STATUS_INVALID_LOCK_SEQUENCE	0x001e
9274bff34e3Sthurlow #define	NT_STATUS_INVALID_VIEW_SIZE	0x001f
9284bff34e3Sthurlow #define	NT_STATUS_INVALID_FILE_FOR_SECTION	0x0020
9294bff34e3Sthurlow #define	NT_STATUS_ALREADY_COMMITTED	0x0021
9304bff34e3Sthurlow #define	NT_STATUS_ACCESS_DENIED		0x0022
9314bff34e3Sthurlow #define	NT_STATUS_BUFFER_TOO_SMALL	0x0023
9324bff34e3Sthurlow #define	NT_STATUS_OBJECT_TYPE_MISMATCH	0x0024
9334bff34e3Sthurlow #define	NT_STATUS_NONCONTINUABLE_EXCEPTION	0x0025
9344bff34e3Sthurlow #define	NT_STATUS_INVALID_DISPOSITION	0x0026
9354bff34e3Sthurlow #define	NT_STATUS_UNWIND		0x0027
9364bff34e3Sthurlow #define	NT_STATUS_BAD_STACK		0x0028
9374bff34e3Sthurlow #define	NT_STATUS_INVALID_UNWIND_TARGET	0x0029
9384bff34e3Sthurlow #define	NT_STATUS_NOT_LOCKED		0x002a
9394bff34e3Sthurlow #define	NT_STATUS_PARITY_ERROR		0x002b
9404bff34e3Sthurlow #define	NT_STATUS_UNABLE_TO_DECOMMIT_VM	0x002c
9414bff34e3Sthurlow #define	NT_STATUS_NOT_COMMITTED		0x002d
9424bff34e3Sthurlow #define	NT_STATUS_INVALID_PORT_ATTRIBUTES	0x002e
9434bff34e3Sthurlow #define	NT_STATUS_PORT_MESSAGE_TOO_LONG	0x002f
9444bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_MIX	0x0030
9454bff34e3Sthurlow #define	NT_STATUS_INVALID_QUOTA_LOWER	0x0031
9464bff34e3Sthurlow #define	NT_STATUS_DISK_CORRUPT_ERROR	0x0032
9474bff34e3Sthurlow #define	NT_STATUS_OBJECT_NAME_INVALID	0x0033
9484bff34e3Sthurlow #define	NT_STATUS_OBJECT_NAME_NOT_FOUND	0x0034
9494bff34e3Sthurlow #define	NT_STATUS_OBJECT_NAME_COLLISION	0x0035
9504bff34e3Sthurlow #define	NT_STATUS_HANDLE_NOT_WAITABLE	0x0036
9514bff34e3Sthurlow #define	NT_STATUS_PORT_DISCONNECTED	0x0037
9524bff34e3Sthurlow #define	NT_STATUS_DEVICE_ALREADY_ATTACHED	0x0038
9534bff34e3Sthurlow #define	NT_STATUS_OBJECT_PATH_INVALID	0x0039
9544bff34e3Sthurlow #define	NT_STATUS_OBJECT_PATH_NOT_FOUND	0x003a
9554bff34e3Sthurlow #define	NT_STATUS_OBJECT_PATH_SYNTAX_BAD	0x003b
9564bff34e3Sthurlow #define	NT_STATUS_DATA_OVERRUN		0x003c
9574bff34e3Sthurlow #define	NT_STATUS_DATA_LATE_ERROR	0x003d
9584bff34e3Sthurlow #define	NT_STATUS_DATA_ERROR		0x003e
9594bff34e3Sthurlow #define	NT_STATUS_CRC_ERROR		0x003f
9604bff34e3Sthurlow #define	NT_STATUS_SECTION_TOO_BIG	0x0040
9614bff34e3Sthurlow #define	NT_STATUS_PORT_CONNECTION_REFUSED	0x0041
9624bff34e3Sthurlow #define	NT_STATUS_INVALID_PORT_HANDLE	0x0042
9634bff34e3Sthurlow #define	NT_STATUS_SHARING_VIOLATION	0x0043
9644bff34e3Sthurlow #define	NT_STATUS_QUOTA_EXCEEDED	0x0044
9654bff34e3Sthurlow #define	NT_STATUS_INVALID_PAGE_PROTECTION	0x0045
9664bff34e3Sthurlow #define	NT_STATUS_MUTANT_NOT_OWNED	0x0046
9674bff34e3Sthurlow #define	NT_STATUS_SEMAPHORE_LIMIT_EXCEEDED	0x0047
9684bff34e3Sthurlow #define	NT_STATUS_PORT_ALREADY_SET	0x0048
9694bff34e3Sthurlow #define	NT_STATUS_SECTION_NOT_IMAGE	0x0049
9704bff34e3Sthurlow #define	NT_STATUS_SUSPEND_COUNT_EXCEEDED	0x004a
9714bff34e3Sthurlow #define	NT_STATUS_THREAD_IS_TERMINATING	0x004b
9724bff34e3Sthurlow #define	NT_STATUS_BAD_WORKING_SET_LIMIT	0x004c
9734bff34e3Sthurlow #define	NT_STATUS_INCOMPATIBLE_FILE_MAP	0x004d
9744bff34e3Sthurlow #define	NT_STATUS_SECTION_PROTECTION	0x004e
9754bff34e3Sthurlow #define	NT_STATUS_EAS_NOT_SUPPORTED	0x004f
9764bff34e3Sthurlow #define	NT_STATUS_EA_TOO_LARGE		0x0050
9774bff34e3Sthurlow #define	NT_STATUS_NONEXISTENT_EA_ENTRY	0x0051
9784bff34e3Sthurlow #define	NT_STATUS_NO_EAS_ON_FILE	0x0052
9794bff34e3Sthurlow #define	NT_STATUS_EA_CORRUPT_ERROR	0x0053
9804bff34e3Sthurlow #define	NT_STATUS_FILE_LOCK_CONFLICT	0x0054
9814bff34e3Sthurlow #define	NT_STATUS_LOCK_NOT_GRANTED	0x0055
9824bff34e3Sthurlow #define	NT_STATUS_DELETE_PENDING	0x0056
9834bff34e3Sthurlow #define	NT_STATUS_CTL_FILE_NOT_SUPPORTED	0x0057
9844bff34e3Sthurlow #define	NT_STATUS_UNKNOWN_REVISION	0x0058
9854bff34e3Sthurlow #define	NT_STATUS_REVISION_MISMATCH	0x0059
9864bff34e3Sthurlow #define	NT_STATUS_INVALID_OWNER		0x005a
9874bff34e3Sthurlow #define	NT_STATUS_INVALID_PRIMARY_GROUP	0x005b
9884bff34e3Sthurlow #define	NT_STATUS_NO_IMPERSONATION_TOKEN	0x005c
9894bff34e3Sthurlow #define	NT_STATUS_CANT_DISABLE_MANDATORY	0x005d
9904bff34e3Sthurlow #define	NT_STATUS_NO_LOGON_SERVERS	0x005e
9914bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_LOGON_SESSION	0x005f
9924bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_PRIVILEGE	0x0060
9934bff34e3Sthurlow #define	NT_STATUS_PRIVILEGE_NOT_HELD	0x0061
9944bff34e3Sthurlow #define	NT_STATUS_INVALID_ACCOUNT_NAME	0x0062
9954bff34e3Sthurlow #define	NT_STATUS_USER_EXISTS		0x0063
9964bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_USER		0x0064
9974bff34e3Sthurlow #define	NT_STATUS_GROUP_EXISTS		0x0065
9984bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_GROUP		0x0066
9994bff34e3Sthurlow #define	NT_STATUS_MEMBER_IN_GROUP	0x0067
10004bff34e3Sthurlow #define	NT_STATUS_MEMBER_NOT_IN_GROUP	0x0068
10014bff34e3Sthurlow #define	NT_STATUS_LAST_ADMIN		0x0069
10024bff34e3Sthurlow #define	NT_STATUS_WRONG_PASSWORD	0x006a
10034bff34e3Sthurlow #define	NT_STATUS_ILL_FORMED_PASSWORD	0x006b
10044bff34e3Sthurlow #define	NT_STATUS_PASSWORD_RESTRICTION	0x006c
10054bff34e3Sthurlow #define	NT_STATUS_LOGON_FAILURE		0x006d
10064bff34e3Sthurlow #define	NT_STATUS_ACCOUNT_RESTRICTION	0x006e
10074bff34e3Sthurlow #define	NT_STATUS_INVALID_LOGON_HOURS	0x006f
10084bff34e3Sthurlow #define	NT_STATUS_INVALID_WORKSTATION	0x0070
10094bff34e3Sthurlow #define	NT_STATUS_PASSWORD_EXPIRED	0x0071
10104bff34e3Sthurlow #define	NT_STATUS_ACCOUNT_DISABLED	0x0072
10114bff34e3Sthurlow #define	NT_STATUS_NONE_MAPPED		0x0073
10124bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_LUIDS_REQUESTED	0x0074
10134bff34e3Sthurlow #define	NT_STATUS_LUIDS_EXHAUSTED	0x0075
10144bff34e3Sthurlow #define	NT_STATUS_INVALID_SUB_AUTHORITY	0x0076
10154bff34e3Sthurlow #define	NT_STATUS_INVALID_ACL		0x0077
10164bff34e3Sthurlow #define	NT_STATUS_INVALID_SID		0x0078
10174bff34e3Sthurlow #define	NT_STATUS_INVALID_SECURITY_DESCR	0x0079
10184bff34e3Sthurlow #define	NT_STATUS_PROCEDURE_NOT_FOUND	0x007a
10194bff34e3Sthurlow #define	NT_STATUS_INVALID_IMAGE_FORMAT	0x007b
10204bff34e3Sthurlow #define	NT_STATUS_NO_TOKEN		0x007c
10214bff34e3Sthurlow #define	NT_STATUS_BAD_INHERITANCE_ACL	0x007d
10224bff34e3Sthurlow #define	NT_STATUS_RANGE_NOT_LOCKED	0x007e
10234bff34e3Sthurlow #define	NT_STATUS_DISK_FULL		0x007f
10244bff34e3Sthurlow #define	NT_STATUS_SERVER_DISABLED	0x0080
10254bff34e3Sthurlow #define	NT_STATUS_SERVER_NOT_DISABLED	0x0081
10264bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_GUIDS_REQUESTED	0x0082
10274bff34e3Sthurlow #define	NT_STATUS_GUIDS_EXHAUSTED	0x0083
10284bff34e3Sthurlow #define	NT_STATUS_INVALID_ID_AUTHORITY	0x0084
10294bff34e3Sthurlow #define	NT_STATUS_AGENTS_EXHAUSTED	0x0085
10304bff34e3Sthurlow #define	NT_STATUS_INVALID_VOLUME_LABEL	0x0086
10314bff34e3Sthurlow #define	NT_STATUS_SECTION_NOT_EXTENDED	0x0087
10324bff34e3Sthurlow #define	NT_STATUS_NOT_MAPPED_DATA	0x0088
10334bff34e3Sthurlow #define	NT_STATUS_RESOURCE_DATA_NOT_FOUND	0x0089
10344bff34e3Sthurlow #define	NT_STATUS_RESOURCE_TYPE_NOT_FOUND	0x008a
10354bff34e3Sthurlow #define	NT_STATUS_RESOURCE_NAME_NOT_FOUND	0x008b
10364bff34e3Sthurlow #define	NT_STATUS_ARRAY_BOUNDS_EXCEEDED	0x008c
10374bff34e3Sthurlow #define	NT_STATUS_FLOAT_DENORMAL_OPERAND	0x008d
10384bff34e3Sthurlow #define	NT_STATUS_FLOAT_DIVIDE_BY_ZERO	0x008e
10394bff34e3Sthurlow #define	NT_STATUS_FLOAT_INEXACT_RESULT	0x008f
10404bff34e3Sthurlow #define	NT_STATUS_FLOAT_INVALID_OPERATION	0x0090
10414bff34e3Sthurlow #define	NT_STATUS_FLOAT_OVERFLOW	0x0091
10424bff34e3Sthurlow #define	NT_STATUS_FLOAT_STACK_CHECK	0x0092
10434bff34e3Sthurlow #define	NT_STATUS_FLOAT_UNDERFLOW	0x0093
10444bff34e3Sthurlow #define	NT_STATUS_INTEGER_DIVIDE_BY_ZERO	0x0094
10454bff34e3Sthurlow #define	NT_STATUS_INTEGER_OVERFLOW	0x0095
10464bff34e3Sthurlow #define	NT_STATUS_PRIVILEGED_INSTRUCTION	0x0096
10474bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_PAGING_FILES	0x0097
10484bff34e3Sthurlow #define	NT_STATUS_FILE_INVALID	0x0098
10494bff34e3Sthurlow #define	NT_STATUS_ALLOTTED_SPACE_EXCEEDED	0x0099
10504bff34e3Sthurlow #define	NT_STATUS_INSUFFICIENT_RESOURCES	0x009a
10514bff34e3Sthurlow #define	NT_STATUS_DFS_EXIT_PATH_FOUND	0x009b
10524bff34e3Sthurlow #define	NT_STATUS_DEVICE_DATA_ERROR	0x009c
10534bff34e3Sthurlow #define	NT_STATUS_DEVICE_NOT_CONNECTED	0x009d
10544bff34e3Sthurlow #define	NT_STATUS_DEVICE_POWER_FAILURE	0x009e
10554bff34e3Sthurlow #define	NT_STATUS_FREE_VM_NOT_AT_BASE	0x009f
10564bff34e3Sthurlow #define	NT_STATUS_MEMORY_NOT_ALLOCATED	0x00a0
10574bff34e3Sthurlow #define	NT_STATUS_WORKING_SET_QUOTA	0x00a1
10584bff34e3Sthurlow #define	NT_STATUS_MEDIA_WRITE_PROTECTED	0x00a2
10594bff34e3Sthurlow #define	NT_STATUS_DEVICE_NOT_READY	0x00a3
10604bff34e3Sthurlow #define	NT_STATUS_INVALID_GROUP_ATTRIBUTES	0x00a4
10614bff34e3Sthurlow #define	NT_STATUS_BAD_IMPERSONATION_LEVEL	0x00a5
10624bff34e3Sthurlow #define	NT_STATUS_CANT_OPEN_ANONYMOUS	0x00a6
10634bff34e3Sthurlow #define	NT_STATUS_BAD_VALIDATION_CLASS	0x00a7
10644bff34e3Sthurlow #define	NT_STATUS_BAD_TOKEN_TYPE	0x00a8
10654bff34e3Sthurlow #define	NT_STATUS_BAD_MASTER_BOOT_RECORD	0x00a9
10664bff34e3Sthurlow #define	NT_STATUS_INSTRUCTION_MISALIGNMENT	0x00aa
10674bff34e3Sthurlow #define	NT_STATUS_INSTANCE_NOT_AVAILABLE	0x00ab
10684bff34e3Sthurlow #define	NT_STATUS_PIPE_NOT_AVAILABLE	0x00ac
10694bff34e3Sthurlow #define	NT_STATUS_INVALID_PIPE_STATE	0x00ad
10704bff34e3Sthurlow #define	NT_STATUS_PIPE_BUSY		0x00ae
10714bff34e3Sthurlow #define	NT_STATUS_ILLEGAL_FUNCTION	0x00af
10724bff34e3Sthurlow #define	NT_STATUS_PIPE_DISCONNECTED	0x00b0
10734bff34e3Sthurlow #define	NT_STATUS_PIPE_CLOSING		0x00b1
10744bff34e3Sthurlow #define	NT_STATUS_PIPE_CONNECTED	0x00b2
10754bff34e3Sthurlow #define	NT_STATUS_PIPE_LISTENING	0x00b3
10764bff34e3Sthurlow #define	NT_STATUS_INVALID_READ_MODE	0x00b4
10774bff34e3Sthurlow #define	NT_STATUS_IO_TIMEOUT		0x00b5
10784bff34e3Sthurlow #define	NT_STATUS_FILE_FORCED_CLOSED	0x00b6
10794bff34e3Sthurlow #define	NT_STATUS_PROFILING_NOT_STARTED	0x00b7
10804bff34e3Sthurlow #define	NT_STATUS_PROFILING_NOT_STOPPED	0x00b8
10814bff34e3Sthurlow #define	NT_STATUS_COULD_NOT_INTERPRET	0x00b9
10824bff34e3Sthurlow #define	NT_STATUS_FILE_IS_A_DIRECTORY	0x00ba
10834bff34e3Sthurlow #define	NT_STATUS_NOT_SUPPORTED		0x00bb
10844bff34e3Sthurlow #define	NT_STATUS_REMOTE_NOT_LISTENING	0x00bc
10854bff34e3Sthurlow #define	NT_STATUS_DUPLICATE_NAME	0x00bd
10864bff34e3Sthurlow #define	NT_STATUS_BAD_NETWORK_PATH	0x00be
10874bff34e3Sthurlow #define	NT_STATUS_NETWORK_BUSY		0x00bf
10884bff34e3Sthurlow #define	NT_STATUS_DEVICE_DOES_NOT_EXIST	0x00c0
10894bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_COMMANDS	0x00c1
10904bff34e3Sthurlow #define	NT_STATUS_ADAPTER_HARDWARE_ERROR	0x00c2
10914bff34e3Sthurlow #define	NT_STATUS_INVALID_NETWORK_RESPONSE	0x00c3
10924bff34e3Sthurlow #define	NT_STATUS_UNEXPECTED_NETWORK_ERROR	0x00c4
10934bff34e3Sthurlow #define	NT_STATUS_BAD_REMOTE_ADAPTER	0x00c5
10944bff34e3Sthurlow #define	NT_STATUS_PRINT_QUEUE_FULL	0x00c6
10954bff34e3Sthurlow #define	NT_STATUS_NO_SPOOL_SPACE	0x00c7
10964bff34e3Sthurlow #define	NT_STATUS_PRINT_CANCELLED	0x00c8
10974bff34e3Sthurlow #define	NT_STATUS_NETWORK_NAME_DELETED	0x00c9
10984bff34e3Sthurlow #define	NT_STATUS_NETWORK_ACCESS_DENIED	0x00ca
10994bff34e3Sthurlow #define	NT_STATUS_BAD_DEVICE_TYPE	0x00cb
11004bff34e3Sthurlow #define	NT_STATUS_BAD_NETWORK_NAME	0x00cc
11014bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_NAMES	0x00cd
11024bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_SESSIONS	0x00ce
11034bff34e3Sthurlow #define	NT_STATUS_SHARING_PAUSED	0x00cf
11044bff34e3Sthurlow #define	NT_STATUS_REQUEST_NOT_ACCEPTED	0x00d0
11054bff34e3Sthurlow #define	NT_STATUS_REDIRECTOR_PAUSED	0x00d1
11064bff34e3Sthurlow #define	NT_STATUS_NET_WRITE_FAULT	0x00d2
11074bff34e3Sthurlow #define	NT_STATUS_PROFILING_AT_LIMIT	0x00d3
11084bff34e3Sthurlow #define	NT_STATUS_NOT_SAME_DEVICE	0x00d4
11094bff34e3Sthurlow #define	NT_STATUS_FILE_RENAMED		0x00d5
11104bff34e3Sthurlow #define	NT_STATUS_VIRTUAL_CIRCUIT_CLOSED	0x00d6
11114bff34e3Sthurlow #define	NT_STATUS_NO_SECURITY_ON_OBJECT	0x00d7
11124bff34e3Sthurlow #define	NT_STATUS_CANT_WAIT		0x00d8
11134bff34e3Sthurlow #define	NT_STATUS_PIPE_EMPTY		0x00d9
11144bff34e3Sthurlow #define	NT_STATUS_CANT_ACCESS_DOMAIN_INFO	0x00da
11154bff34e3Sthurlow #define	NT_STATUS_CANT_TERMINATE_SELF	0x00db
11164bff34e3Sthurlow #define	NT_STATUS_INVALID_SERVER_STATE	0x00dc
11174bff34e3Sthurlow #define	NT_STATUS_INVALID_DOMAIN_STATE	0x00dd
11184bff34e3Sthurlow #define	NT_STATUS_INVALID_DOMAIN_ROLE	0x00de
11194bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_DOMAIN	0x00df
11204bff34e3Sthurlow #define	NT_STATUS_DOMAIN_EXISTS		0x00e0
11214bff34e3Sthurlow #define	NT_STATUS_DOMAIN_LIMIT_EXCEEDED	0x00e1
11224bff34e3Sthurlow #define	NT_STATUS_OPLOCK_NOT_GRANTED	0x00e2
11234bff34e3Sthurlow #define	NT_STATUS_INVALID_OPLOCK_PROTOCOL	0x00e3
11244bff34e3Sthurlow #define	NT_STATUS_INTERNAL_DB_CORRUPTION	0x00e4
11254bff34e3Sthurlow #define	NT_STATUS_INTERNAL_ERROR	0x00e5
11264bff34e3Sthurlow #define	NT_STATUS_GENERIC_NOT_MAPPED	0x00e6
11274bff34e3Sthurlow #define	NT_STATUS_BAD_DESCRIPTOR_FORMAT	0x00e7
11284bff34e3Sthurlow #define	NT_STATUS_INVALID_USER_BUFFER	0x00e8
11294bff34e3Sthurlow #define	NT_STATUS_UNEXPECTED_IO_ERROR	0x00e9
11304bff34e3Sthurlow #define	NT_STATUS_UNEXPECTED_MM_CREATE_ERR	0x00ea
11314bff34e3Sthurlow #define	NT_STATUS_UNEXPECTED_MM_MAP_ERROR	0x00eb
11324bff34e3Sthurlow #define	NT_STATUS_UNEXPECTED_MM_EXTEND_ERR	0x00ec
11334bff34e3Sthurlow #define	NT_STATUS_NOT_LOGON_PROCESS	0x00ed
11344bff34e3Sthurlow #define	NT_STATUS_LOGON_SESSION_EXISTS	0x00ee
11354bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_1	0x00ef
11364bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_2	0x00f0
11374bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_3	0x00f1
11384bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_4	0x00f2
11394bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_5	0x00f3
11404bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_6	0x00f4
11414bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_7	0x00f5
11424bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_8	0x00f6
11434bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_9	0x00f7
11444bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_10	0x00f8
11454bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_11	0x00f9
11464bff34e3Sthurlow #define	NT_STATUS_INVALID_PARAMETER_12	0x00fa
11474bff34e3Sthurlow #define	NT_STATUS_REDIRECTOR_NOT_STARTED	0x00fb
11484bff34e3Sthurlow #define	NT_STATUS_REDIRECTOR_STARTED	0x00fc
11494bff34e3Sthurlow #define	NT_STATUS_STACK_OVERFLOW	0x00fd
11504bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_PACKAGE	0x00fe
11514bff34e3Sthurlow #define	NT_STATUS_BAD_FUNCTION_TABLE	0x00ff
11524bff34e3Sthurlow #define	NT_STATUS_VARIABLE_NOT_FOUND	0x0100
11534bff34e3Sthurlow #define	NT_STATUS_DIRECTORY_NOT_EMPTY	0x0101
11544bff34e3Sthurlow #define	NT_STATUS_FILE_CORRUPT_ERROR	0x0102
11554bff34e3Sthurlow #define	NT_STATUS_NOT_A_DIRECTORY	0x0103
11564bff34e3Sthurlow #define	NT_STATUS_BAD_LOGON_SESSION_STATE	0x0104
11574bff34e3Sthurlow #define	NT_STATUS_LOGON_SESSION_COLLISION	0x0105
11584bff34e3Sthurlow #define	NT_STATUS_NAME_TOO_LONG		0x0106
11594bff34e3Sthurlow #define	NT_STATUS_FILES_OPEN		0x0107
11604bff34e3Sthurlow #define	NT_STATUS_CONNECTION_IN_USE	0x0108
11614bff34e3Sthurlow #define	NT_STATUS_MESSAGE_NOT_FOUND	0x0109
11624bff34e3Sthurlow #define	NT_STATUS_PROCESS_IS_TERMINATING	0x010a
11634bff34e3Sthurlow #define	NT_STATUS_INVALID_LOGON_TYPE	0x010b
11644bff34e3Sthurlow #define	NT_STATUS_NO_GUID_TRANSLATION	0x010c
11654bff34e3Sthurlow #define	NT_STATUS_CANNOT_IMPERSONATE	0x010d
11664bff34e3Sthurlow #define	NT_STATUS_IMAGE_ALREADY_LOADED	0x010e
11674bff34e3Sthurlow #define	NT_STATUS_ABIOS_NOT_PRESENT	0x010f
11684bff34e3Sthurlow #define	NT_STATUS_ABIOS_LID_NOT_EXIST	0x0110
11694bff34e3Sthurlow #define	NT_STATUS_ABIOS_LID_ALREADY_OWNED	0x0111
11704bff34e3Sthurlow #define	NT_STATUS_ABIOS_NOT_LID_OWNER	0x0112
11714bff34e3Sthurlow #define	NT_STATUS_ABIOS_INVALID_COMMAND	0x0113
11724bff34e3Sthurlow #define	NT_STATUS_ABIOS_INVALID_LID	0x0114
11734bff34e3Sthurlow #define	NT_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE	0x0115
11744bff34e3Sthurlow #define	NT_STATUS_ABIOS_INVALID_SELECTOR	0x0116
11754bff34e3Sthurlow #define	NT_STATUS_NO_LDT		0x0117
11764bff34e3Sthurlow #define	NT_STATUS_INVALID_LDT_SIZE	0x0118
11774bff34e3Sthurlow #define	NT_STATUS_INVALID_LDT_OFFSET	0x0119
11784bff34e3Sthurlow #define	NT_STATUS_INVALID_LDT_DESCRIPTOR	0x011a
11794bff34e3Sthurlow #define	NT_STATUS_INVALID_IMAGE_NE_FORMAT	0x011b
11804bff34e3Sthurlow #define	NT_STATUS_RXACT_INVALID_STATE	0x011c
11814bff34e3Sthurlow #define	NT_STATUS_RXACT_COMMIT_FAILURE	0x011d
11824bff34e3Sthurlow #define	NT_STATUS_MAPPED_FILE_SIZE_ZERO	0x011e
11834bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_OPENED_FILES	0x011f
11844bff34e3Sthurlow #define	NT_STATUS_CANCELLED		0x0120
11854bff34e3Sthurlow #define	NT_STATUS_CANNOT_DELETE		0x0121
11864bff34e3Sthurlow #define	NT_STATUS_INVALID_COMPUTER_NAME	0x0122
11874bff34e3Sthurlow #define	NT_STATUS_FILE_DELETED		0x0123
11884bff34e3Sthurlow #define	NT_STATUS_SPECIAL_ACCOUNT	0x0124
11894bff34e3Sthurlow #define	NT_STATUS_SPECIAL_GROUP		0x0125
11904bff34e3Sthurlow #define	NT_STATUS_SPECIAL_USER		0x0126
11914bff34e3Sthurlow #define	NT_STATUS_MEMBERS_PRIMARY_GROUP	0x0127
11924bff34e3Sthurlow #define	NT_STATUS_FILE_CLOSED		0x0128
11934bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_THREADS	0x0129
11944bff34e3Sthurlow #define	NT_STATUS_THREAD_NOT_IN_PROCESS	0x012a
11954bff34e3Sthurlow #define	NT_STATUS_TOKEN_ALREADY_IN_USE	0x012b
11964bff34e3Sthurlow #define	NT_STATUS_PAGEFILE_QUOTA_EXCEEDED	0x012c
11974bff34e3Sthurlow #define	NT_STATUS_COMMITMENT_LIMIT	0x012d
11984bff34e3Sthurlow #define	NT_STATUS_INVALID_IMAGE_LE_FORMAT	0x012e
11994bff34e3Sthurlow #define	NT_STATUS_INVALID_IMAGE_NOT_MZ	0x012f
12004bff34e3Sthurlow #define	NT_STATUS_INVALID_IMAGE_PROTECT	0x0130
12014bff34e3Sthurlow #define	NT_STATUS_INVALID_IMAGE_WIN_16	0x0131
12024bff34e3Sthurlow #define	NT_STATUS_LOGON_SERVER_CONFLICT	0x0132
12034bff34e3Sthurlow #define	NT_STATUS_TIME_DIFFERENCE_AT_DC	0x0133
12044bff34e3Sthurlow #define	NT_STATUS_SYNCHRONIZATION_REQUIRED	0x0134
12054bff34e3Sthurlow #define	NT_STATUS_DLL_NOT_FOUND		0x0135
12064bff34e3Sthurlow #define	NT_STATUS_OPEN_FAILED		0x0136
12074bff34e3Sthurlow #define	NT_STATUS_IO_PRIVILEGE_FAILED	0x0137
12084bff34e3Sthurlow #define	NT_STATUS_ORDINAL_NOT_FOUND	0x0138
12094bff34e3Sthurlow #define	NT_STATUS_ENTRYPOINT_NOT_FOUND	0x0139
12104bff34e3Sthurlow #define	NT_STATUS_CONTROL_C_EXIT	0x013a
12114bff34e3Sthurlow #define	NT_STATUS_LOCAL_DISCONNECT	0x013b
12124bff34e3Sthurlow #define	NT_STATUS_REMOTE_DISCONNECT	0x013c
12134bff34e3Sthurlow #define	NT_STATUS_REMOTE_RESOURCES	0x013d
12144bff34e3Sthurlow #define	NT_STATUS_LINK_FAILED		0x013e
12154bff34e3Sthurlow #define	NT_STATUS_LINK_TIMEOUT		0x013f
12164bff34e3Sthurlow #define	NT_STATUS_INVALID_CONNECTION	0x0140
12174bff34e3Sthurlow #define	NT_STATUS_INVALID_ADDRESS	0x0141
12184bff34e3Sthurlow #define	NT_STATUS_DLL_INIT_FAILED	0x0142
12194bff34e3Sthurlow #define	NT_STATUS_MISSING_SYSTEMFILE	0x0143
12204bff34e3Sthurlow #define	NT_STATUS_UNHANDLED_EXCEPTION	0x0144
12214bff34e3Sthurlow #define	NT_STATUS_APP_INIT_FAILURE	0x0145
12224bff34e3Sthurlow #define	NT_STATUS_PAGEFILE_CREATE_FAILED	0x0146
12234bff34e3Sthurlow #define	NT_STATUS_NO_PAGEFILE		0x0147
12244bff34e3Sthurlow #define	NT_STATUS_INVALID_LEVEL		0x0148
12254bff34e3Sthurlow #define	NT_STATUS_WRONG_PASSWORD_CORE	0x0149
12264bff34e3Sthurlow #define	NT_STATUS_ILLEGAL_FLOAT_CONTEXT	0x014a
12274bff34e3Sthurlow #define	NT_STATUS_PIPE_BROKEN		0x014b
12284bff34e3Sthurlow #define	NT_STATUS_REGISTRY_CORRUPT	0x014c
12294bff34e3Sthurlow #define	NT_STATUS_REGISTRY_IO_FAILED	0x014d
12304bff34e3Sthurlow #define	NT_STATUS_NO_EVENT_PAIR		0x014e
12314bff34e3Sthurlow #define	NT_STATUS_UNRECOGNIZED_VOLUME	0x014f
12324bff34e3Sthurlow #define	NT_STATUS_SERIAL_NO_DEVICE_INITED	0x0150
12334bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_ALIAS		0x0151
12344bff34e3Sthurlow #define	NT_STATUS_MEMBER_NOT_IN_ALIAS	0x0152
12354bff34e3Sthurlow #define	NT_STATUS_MEMBER_IN_ALIAS	0x0153
12364bff34e3Sthurlow #define	NT_STATUS_ALIAS_EXISTS		0x0154
12374bff34e3Sthurlow #define	NT_STATUS_LOGON_NOT_GRANTED	0x0155
12384bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_SECRETS	0x0156
12394bff34e3Sthurlow #define	NT_STATUS_SECRET_TOO_LONG	0x0157
12404bff34e3Sthurlow #define	NT_STATUS_INTERNAL_DB_ERROR	0x0158
12414bff34e3Sthurlow #define	NT_STATUS_FULLSCREEN_MODE	0x0159
12424bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_CONTEXT_IDS	0x015a
12434bff34e3Sthurlow #define	NT_STATUS_LOGON_TYPE_NOT_GRANTED	0x015b
12444bff34e3Sthurlow #define	NT_STATUS_NOT_REGISTRY_FILE	0x015c
12454bff34e3Sthurlow #define	NT_STATUS_NT_CROSS_ENCRYPTION_REQUIRED	0x015d
12464bff34e3Sthurlow #define	NT_STATUS_DOMAIN_CTRLR_CONFIG_ERROR	0x015e
12474bff34e3Sthurlow #define	NT_STATUS_FT_MISSING_MEMBER	0x015f
12484bff34e3Sthurlow #define	NT_STATUS_ILL_FORMED_SERVICE_ENTRY	0x0160
12494bff34e3Sthurlow #define	NT_STATUS_ILLEGAL_CHARACTER	0x0161
12504bff34e3Sthurlow #define	NT_STATUS_UNMAPPABLE_CHARACTER	0x0162
12514bff34e3Sthurlow #define	NT_STATUS_UNDEFINED_CHARACTER	0x0163
12524bff34e3Sthurlow #define	NT_STATUS_FLOPPY_VOLUME		0x0164
12534bff34e3Sthurlow #define	NT_STATUS_FLOPPY_ID_MARK_NOT_FOUND	0x0165
12544bff34e3Sthurlow #define	NT_STATUS_FLOPPY_WRONG_CYLINDER	0x0166
12554bff34e3Sthurlow #define	NT_STATUS_FLOPPY_UNKNOWN_ERROR	0x0167
12564bff34e3Sthurlow #define	NT_STATUS_FLOPPY_BAD_REGISTERS	0x0168
12574bff34e3Sthurlow #define	NT_STATUS_DISK_RECALIBRATE_FAILED	0x0169
12584bff34e3Sthurlow #define	NT_STATUS_DISK_OPERATION_FAILED	0x016a
12594bff34e3Sthurlow #define	NT_STATUS_DISK_RESET_FAILED	0x016b
12604bff34e3Sthurlow #define	NT_STATUS_SHARED_IRQ_BUSY	0x016c
12614bff34e3Sthurlow #define	NT_STATUS_FT_ORPHANING		0x016d
12624bff34e3Sthurlow #define	NT_STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT	0x016e
12634bff34e3Sthurlow #define	NT_STATUS_16F		0x016f
12644bff34e3Sthurlow #define	NT_STATUS_170		0x0170
12654bff34e3Sthurlow #define	NT_STATUS_171		0x0171
12664bff34e3Sthurlow #define	NT_STATUS_PARTITION_FAILURE	0x0172
12674bff34e3Sthurlow #define	NT_STATUS_INVALID_BLOCK_LENGTH	0x0173
12684bff34e3Sthurlow #define	NT_STATUS_DEVICE_NOT_PARTITIONED	0x0174
12694bff34e3Sthurlow #define	NT_STATUS_UNABLE_TO_LOCK_MEDIA	0x0175
12704bff34e3Sthurlow #define	NT_STATUS_UNABLE_TO_UNLOAD_MEDIA	0x0176
12714bff34e3Sthurlow #define	NT_STATUS_EOM_OVERFLOW		0x0177
12724bff34e3Sthurlow #define	NT_STATUS_NO_MEDIA		0x0178
12734bff34e3Sthurlow #define	NT_STATUS_179		0x0179
12744bff34e3Sthurlow #define	NT_STATUS_NO_SUCH_MEMBER	0x017a
12754bff34e3Sthurlow #define	NT_STATUS_INVALID_MEMBER	0x017b
12764bff34e3Sthurlow #define	NT_STATUS_KEY_DELETED		0x017c
12774bff34e3Sthurlow #define	NT_STATUS_NO_LOG_SPACE		0x017d
12784bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_SIDS		0x017e
12794bff34e3Sthurlow #define	NT_STATUS_LM_CROSS_ENCRYPTION_REQUIRED	0x017f
12804bff34e3Sthurlow #define	NT_STATUS_KEY_HAS_CHILDREN	0x0180
12814bff34e3Sthurlow #define	NT_STATUS_CHILD_MUST_BE_VOLATILE	0x0181
12824bff34e3Sthurlow #define	NT_STATUS_DEVICE_CONFIGURATION_ERROR	0x0182
12834bff34e3Sthurlow #define	NT_STATUS_DRIVER_INTERNAL_ERROR	0x0183
12844bff34e3Sthurlow #define	NT_STATUS_INVALID_DEVICE_STATE	0x0184
12854bff34e3Sthurlow #define	NT_STATUS_IO_DEVICE_ERROR	0x0185
12864bff34e3Sthurlow #define	NT_STATUS_DEVICE_PROTOCOL_ERROR	0x0186
12874bff34e3Sthurlow #define	NT_STATUS_BACKUP_CONTROLLER	0x0187
12884bff34e3Sthurlow #define	NT_STATUS_LOG_FILE_FULL		0x0188
12894bff34e3Sthurlow #define	NT_STATUS_TOO_LATE		0x0189
12904bff34e3Sthurlow #define	NT_STATUS_NO_TRUST_LSA_SECRET	0x018a
12914bff34e3Sthurlow #define	NT_STATUS_NO_TRUST_SAM_ACCOUNT	0x018b
12924bff34e3Sthurlow #define	NT_STATUS_TRUSTED_DOMAIN_FAILURE	0x018c
12934bff34e3Sthurlow #define	NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE	0x018d
12944bff34e3Sthurlow #define	NT_STATUS_EVENTLOG_FILE_CORRUPT	0x018e
12954bff34e3Sthurlow #define	NT_STATUS_EVENTLOG_CANT_START	0x018f
12964bff34e3Sthurlow #define	NT_STATUS_TRUST_FAILURE		0x0190
12974bff34e3Sthurlow #define	NT_STATUS_MUTANT_LIMIT_EXCEEDED	0x0191
12984bff34e3Sthurlow #define	NT_STATUS_NETLOGON_NOT_STARTED	0x0192
12994bff34e3Sthurlow #define	NT_STATUS_ACCOUNT_EXPIRED	0x0193
13004bff34e3Sthurlow #define	NT_STATUS_POSSIBLE_DEADLOCK	0x0194
13014bff34e3Sthurlow #define	NT_STATUS_NETWORK_CREDENTIAL_CONFLICT	0x0195
13024bff34e3Sthurlow #define	NT_STATUS_REMOTE_SESSION_LIMIT	0x0196
13034bff34e3Sthurlow #define	NT_STATUS_EVENTLOG_FILE_CHANGED	0x0197
13044bff34e3Sthurlow #define	NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT	0x0198
13054bff34e3Sthurlow #define	NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT	0x0199
13064bff34e3Sthurlow #define	NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT	0x019a
13074bff34e3Sthurlow #define	NT_STATUS_DOMAIN_TRUST_INCONSISTENT	0x019b
13084bff34e3Sthurlow #define	NT_STATUS_FS_DRIVER_REQUIRED	0x019c
13094bff34e3Sthurlow #define	NT_STATUS_NO_USER_SESSION_KEY	0x0202
13104bff34e3Sthurlow #define	NT_STATUS_USER_SESSION_DELETED	0x0203
13114bff34e3Sthurlow #define	NT_STATUS_RESOURCE_LANG_NOT_FOUND	0x0204
13124bff34e3Sthurlow #define	NT_STATUS_INSUFF_SERVER_RESOURCES	0x0205
13134bff34e3Sthurlow #define	NT_STATUS_INVALID_BUFFER_SIZE	0x0206
13144bff34e3Sthurlow #define	NT_STATUS_INVALID_ADDRESS_COMPONENT	0x0207
13154bff34e3Sthurlow #define	NT_STATUS_INVALID_ADDRESS_WILDCARD	0x0208
13164bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_ADDRESSES	0x0209
13174bff34e3Sthurlow #define	NT_STATUS_ADDRESS_ALREADY_EXISTS	0x020a
13184bff34e3Sthurlow #define	NT_STATUS_ADDRESS_CLOSED	0x020b
13194bff34e3Sthurlow #define	NT_STATUS_CONNECTION_DISCONNECTED	0x020c
13204bff34e3Sthurlow #define	NT_STATUS_CONNECTION_RESET	0x020d
13214bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_NODES	0x020e
13224bff34e3Sthurlow #define	NT_STATUS_TRANSACTION_ABORTED	0x020f
13234bff34e3Sthurlow #define	NT_STATUS_TRANSACTION_TIMED_OUT	0x0210
13244bff34e3Sthurlow #define	NT_STATUS_TRANSACTION_NO_RELEASE	0x0211
13254bff34e3Sthurlow #define	NT_STATUS_TRANSACTION_NO_MATCH	0x0212
13264bff34e3Sthurlow #define	NT_STATUS_TRANSACTION_RESPONDED	0x0213
13274bff34e3Sthurlow #define	NT_STATUS_TRANSACTION_INVALID_ID	0x0214
13284bff34e3Sthurlow #define	NT_STATUS_TRANSACTION_INVALID_TYPE	0x0215
13294bff34e3Sthurlow #define	NT_STATUS_NOT_SERVER_SESSION	0x0216
13304bff34e3Sthurlow #define	NT_STATUS_NOT_CLIENT_SESSION	0x0217
13314bff34e3Sthurlow #define	NT_STATUS_CANNOT_LOAD_REGISTRY_FILE	0x0218
13324bff34e3Sthurlow #define	NT_STATUS_DEBUG_ATTACH_FAILED	0x0219
13334bff34e3Sthurlow #define	NT_STATUS_SYSTEM_PROCESS_TERMINATED	0x021a
13344bff34e3Sthurlow #define	NT_STATUS_DATA_NOT_ACCEPTED	0x021b
13354bff34e3Sthurlow #define	NT_STATUS_NO_BROWSER_SERVERS_FOUND	0x021c
13364bff34e3Sthurlow #define	NT_STATUS_VDM_HARD_ERROR	0x021d
13374bff34e3Sthurlow #define	NT_STATUS_DRIVER_CANCEL_TIMEOUT	0x021e
13384bff34e3Sthurlow #define	NT_STATUS_REPLY_MESSAGE_MISMATCH	0x021f
13394bff34e3Sthurlow #define	NT_STATUS_MAPPED_ALIGNMENT	0x0220
13404bff34e3Sthurlow #define	NT_STATUS_IMAGE_CHECKSUM_MISMATCH	0x0221
13414bff34e3Sthurlow #define	NT_STATUS_LOST_WRITEBEHIND_DATA	0x0222
13424bff34e3Sthurlow #define	NT_STATUS_CLIENT_SERVER_PARAMETERS_INVALID	0x0223
13434bff34e3Sthurlow #define	NT_STATUS_PASSWORD_MUST_CHANGE	0x0224
13444bff34e3Sthurlow #define	NT_STATUS_NOT_FOUND		0x0225
13454bff34e3Sthurlow #define	NT_STATUS_NOT_TINY_STREAM	0x0226
13464bff34e3Sthurlow #define	NT_STATUS_RECOVERY_FAILURE	0x0227
13474bff34e3Sthurlow #define	NT_STATUS_STACK_OVERFLOW_READ	0x0228
13484bff34e3Sthurlow #define	NT_STATUS_FAIL_CHECK		0x0229
13494bff34e3Sthurlow #define	NT_STATUS_DUPLICATE_OBJECTID	0x022a
13504bff34e3Sthurlow #define	NT_STATUS_OBJECTID_EXISTS	0x022b
13514bff34e3Sthurlow #define	NT_STATUS_CONVERT_TO_LARGE	0x022c
13524bff34e3Sthurlow #define	NT_STATUS_RETRY			0x022d
13534bff34e3Sthurlow #define	NT_STATUS_FOUND_OUT_OF_SCOPE	0x022e
13544bff34e3Sthurlow #define	NT_STATUS_ALLOCATE_BUCKET	0x022f
13554bff34e3Sthurlow #define	NT_STATUS_PROPSET_NOT_FOUND	0x0230
13564bff34e3Sthurlow #define	NT_STATUS_MARSHALL_OVERFLOW	0x0231
13574bff34e3Sthurlow #define	NT_STATUS_INVALID_VARIANT	0x0232
13584bff34e3Sthurlow #define	NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND	0x0233
13594bff34e3Sthurlow #define	NT_STATUS_ACCOUNT_LOCKED_OUT	0x0234
13604bff34e3Sthurlow #define	NT_STATUS_HANDLE_NOT_CLOSABLE	0x0235
13614bff34e3Sthurlow #define	NT_STATUS_CONNECTION_REFUSED	0x0236
13624bff34e3Sthurlow #define	NT_STATUS_GRACEFUL_DISCONNECT	0x0237
13634bff34e3Sthurlow #define	NT_STATUS_ADDRESS_ALREADY_ASSOCIATED	0x0238
13644bff34e3Sthurlow #define	NT_STATUS_ADDRESS_NOT_ASSOCIATED	0x0239
13654bff34e3Sthurlow #define	NT_STATUS_CONNECTION_INVALID	0x023a
13664bff34e3Sthurlow #define	NT_STATUS_CONNECTION_ACTIVE	0x023b
13674bff34e3Sthurlow #define	NT_STATUS_NETWORK_UNREACHABLE	0x023c
13684bff34e3Sthurlow #define	NT_STATUS_HOST_UNREACHABLE	0x023d
13694bff34e3Sthurlow #define	NT_STATUS_PROTOCOL_UNREACHABLE	0x023e
13704bff34e3Sthurlow #define	NT_STATUS_PORT_UNREACHABLE	0x023f
13714bff34e3Sthurlow #define	NT_STATUS_REQUEST_ABORTED	0x0240
13724bff34e3Sthurlow #define	NT_STATUS_CONNECTION_ABORTED	0x0241
13734bff34e3Sthurlow #define	NT_STATUS_BAD_COMPRESSION_BUFFER	0x0242
13744bff34e3Sthurlow #define	NT_STATUS_USER_MAPPED_FILE	0x0243
13754bff34e3Sthurlow #define	NT_STATUS_AUDIT_FAILED		0x0244
13764bff34e3Sthurlow #define	NT_STATUS_TIMER_RESOLUTION_NOT_SET	0x0245
13774bff34e3Sthurlow #define	NT_STATUS_CONNECTION_COUNT_LIMIT	0x0246
13784bff34e3Sthurlow #define	NT_STATUS_LOGIN_TIME_RESTRICTION	0x0247
13794bff34e3Sthurlow #define	NT_STATUS_LOGIN_WKSTA_RESTRICTION	0x0248
13804bff34e3Sthurlow #define	NT_STATUS_IMAGE_MP_UP_MISMATCH	0x0249
13814bff34e3Sthurlow #define	NT_STATUS_INSUFFICIENT_LOGON_INFO	0x0250
13824bff34e3Sthurlow #define	NT_STATUS_BAD_DLL_ENTRYPOINT	0x0251
13834bff34e3Sthurlow #define	NT_STATUS_BAD_SERVICE_ENTRYPOINT	0x0252
13844bff34e3Sthurlow #define	NT_STATUS_LPC_REPLY_LOST	0x0253
13854bff34e3Sthurlow #define	NT_STATUS_IP_ADDRESS_CONFLICT1	0x0254
13864bff34e3Sthurlow #define	NT_STATUS_IP_ADDRESS_CONFLICT2	0x0255
13874bff34e3Sthurlow #define	NT_STATUS_REGISTRY_QUOTA_LIMIT	0x0256
13884bff34e3Sthurlow #define	NT_STATUS_PATH_NOT_COVERED	0x0257
13894bff34e3Sthurlow #define	NT_STATUS_NO_CALLBACK_ACTIVE	0x0258
13904bff34e3Sthurlow #define	NT_STATUS_LICENSE_QUOTA_EXCEEDED	0x0259
13914bff34e3Sthurlow #define	NT_STATUS_PWD_TOO_SHORT		0x025a
13924bff34e3Sthurlow #define	NT_STATUS_PWD_TOO_RECENT	0x025b
13934bff34e3Sthurlow #define	NT_STATUS_PWD_HISTORY_CONFLICT	0x025c
13944bff34e3Sthurlow #define	NT_STATUS_PLUGPLAY_NO_DEVICE	0x025e
13954bff34e3Sthurlow #define	NT_STATUS_UNSUPPORTED_COMPRESSION	0x025f
13964bff34e3Sthurlow #define	NT_STATUS_INVALID_HW_PROFILE	0x0260
13974bff34e3Sthurlow #define	NT_STATUS_INVALID_PLUGPLAY_DEVICE_PATH	0x0261
13984bff34e3Sthurlow #define	NT_STATUS_DRIVER_ORDINAL_NOT_FOUND	0x0262
13994bff34e3Sthurlow #define	NT_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND	0x0263
14004bff34e3Sthurlow #define	NT_STATUS_RESOURCE_NOT_OWNED	0x0264
14014bff34e3Sthurlow #define	NT_STATUS_TOO_MANY_LINKS	0x0265
14024bff34e3Sthurlow #define	NT_STATUS_QUOTA_LIST_INCONSISTENT	0x0266
14034bff34e3Sthurlow #define	NT_STATUS_FILE_IS_OFFLINE	0x0267
14044bff34e3Sthurlow 
14054bff34e3Sthurlow #define	NT_STATUS_LICENSE_VIOLATION	0x026a
14064bff34e3Sthurlow 
14074bff34e3Sthurlow #define	NT_STATUS_DFS_UNAVAILABLE	0x026d
14084bff34e3Sthurlow #define	NT_STATUS_VOLUME_DISMOUNTED	0x026e
14094bff34e3Sthurlow 
14104bff34e3Sthurlow #define	NT_STATUS_NOT_A_REPARSE_POINT	0x0275
14114bff34e3Sthurlow 
14124bff34e3Sthurlow #define	NT_STATUS_REPARSE_POINT_NOT_RESOLVED	0x0280
14134bff34e3Sthurlow #define	NT_STATUS_DIRECTORY_IS_A_REPARSE_POINT	0x0281
14144bff34e3Sthurlow 
14154bff34e3Sthurlow #define	NT_STATUS_ENCRYPTION_FAILED	0x028a
14164bff34e3Sthurlow #define	NT_STATUS_DECRYPTION_FAILED	0x028b
14174bff34e3Sthurlow #define	NT_STATUS_RANGE_NOT_FOUND	0x028c
14184bff34e3Sthurlow #define	NT_STATUS_NO_RECOVERY_POLICY	0x028d
14194bff34e3Sthurlow #define	NT_STATUS_NO_EFS		0x028e
14204bff34e3Sthurlow #define	NT_STATUS_WRONG_EFS		0x028f
14214bff34e3Sthurlow #define	NT_STATUS_NO_USER_KEYS		0x0290
14224bff34e3Sthurlow #define	NT_STATUS_FILE_NOT_ENCRYPTED	0x0291
14234bff34e3Sthurlow 
14244bff34e3Sthurlow #define	NT_STATUS_FILE_ENCRYPTED	0x0293
14254bff34e3Sthurlow 
14264bff34e3Sthurlow #define	NT_STATUS_VOLUME_NOT_UPGRADED	0x029c
14274bff34e3Sthurlow 
14284bff34e3Sthurlow #define	NT_STATUS_KDC_CERT_EXPIRED	0x040e
14294bff34e3Sthurlow /*
14304bff34e3Sthurlow  * 0x00010000-0x0001ffff are "DBG" errors
14314bff34e3Sthurlow  * 0x00020000-0x0003ffff are "RPC" errors
14324bff34e3Sthurlow  * 0x00040000-0x0004ffff are "PNP" errors
14334bff34e3Sthurlow  * 0x000A0000-0x000Affff are "CTX" errors
14344bff34e3Sthurlow  * 0x00130000-0x0013ffff are "CLUSTER" errors
14354bff34e3Sthurlow  * 0x00140000-0x0014ffff are "ACPI" errors
14364bff34e3Sthurlow  * 0x00150000-0x0015ffff are "SXS" errors
14374bff34e3Sthurlow  */
14384bff34e3Sthurlow 
14394bff34e3Sthurlow /*
14404bff34e3Sthurlow  * size of the GUID returned in an extended security negotiate response
14414bff34e3Sthurlow  */
14424bff34e3Sthurlow #define	SMB_GUIDLEN	16
14434bff34e3Sthurlow 
14444bff34e3Sthurlow typedef uint16_t	smbfh;
14454bff34e3Sthurlow 
14464bff34e3Sthurlow /*
14474bff34e3Sthurlow  * NTLMv2 blob header structure.
14484bff34e3Sthurlow  */
14494bff34e3Sthurlow struct ntlmv2_blobhdr {
14504bff34e3Sthurlow 	uint32_t	header;
14514bff34e3Sthurlow 	uint32_t	reserved;
14524bff34e3Sthurlow 	uint64_t	timestamp;
14534bff34e3Sthurlow 	uint64_t	client_nonce;
14544bff34e3Sthurlow 	uint32_t	unknown1;
14554bff34e3Sthurlow };
14564bff34e3Sthurlow typedef struct ntlmv2_blobhdr ntlmv2_blobhdr_t;
14574bff34e3Sthurlow 
14584bff34e3Sthurlow /*
14594bff34e3Sthurlow  * NTLMv2 name header structure, for names in a blob.
14604bff34e3Sthurlow  */
14614bff34e3Sthurlow struct ntlmv2_namehdr {
14624bff34e3Sthurlow 	uint16_t	type;
14634bff34e3Sthurlow 	uint16_t	len;
14644bff34e3Sthurlow };
14654bff34e3Sthurlow typedef struct ntlmv2_namehdr ntlmv2_namehdr_t;
14664bff34e3Sthurlow 
14674bff34e3Sthurlow #define	NAMETYPE_EOL		0x0000	/* end of list of names */
14684bff34e3Sthurlow #define	NAMETYPE_MACHINE_NB	0x0001	/* NetBIOS machine name */
14694bff34e3Sthurlow #define	NAMETYPE_DOMAIN_NB	0x0002	/* NetBIOS domain name */
14704bff34e3Sthurlow #define	NAMETYPE_MACHINE_DNS	0x0003	/* DNS machine name */
14714bff34e3Sthurlow #define	NAMETYPE_DOMAIN_DNS	0x0004	/* DNS Active Directory domain name */
14724bff34e3Sthurlow 
14734bff34e3Sthurlow /*
14744bff34e3Sthurlow  * Named pipe commands.
14754bff34e3Sthurlow  */
14764bff34e3Sthurlow #define	TRANS_CALL_NAMED_PIPE		0x54	/* open/write/read/close pipe */
14774bff34e3Sthurlow #define	TRANS_WAIT_NAMED_PIPE		0x53	/* wait for pipe to be !busy */
14784bff34e3Sthurlow #define	TRANS_PEEK_NAMED_PIPE		0x23	/* read but don't remove data */
14794bff34e3Sthurlow #define	TRANS_Q_NAMED_PIPE_HAND_STATE	0x21	/* query pipe handle modes */
14804bff34e3Sthurlow #define	TRANS_SET_NAMED_PIPE_HAND_STATE	0x01	/* set pipe handle modes */
14814bff34e3Sthurlow #define	TRANS_Q_NAMED_PIPE_INFO		0x22	/* query pipe attributes */
14824bff34e3Sthurlow #define	TRANS_TRANSACT_NAMED_PIPE	0x26	/* r/w operation on pipe */
14834bff34e3Sthurlow #define	TRANS_READ_NAMED_PIPE		0x11	/* read pipe in "raw" mode */
14844bff34e3Sthurlow 						/* (non message mode) */
14854bff34e3Sthurlow #define	TRANS_WRITE_NAMED_PIPE		0x31	/* write pipe "raw" mode */
14864bff34e3Sthurlow 						/* (non message mode) */
14874bff34e3Sthurlow 
14884bff34e3Sthurlow /*
14894bff34e3Sthurlow  * Share types, visible via NetShareEnum
14904bff34e3Sthurlow  */
14914bff34e3Sthurlow #define	STYPE_DISKTREE			0x00000000
14924bff34e3Sthurlow #define	STYPE_PRINTQ			0x00000001
14934bff34e3Sthurlow #define	STYPE_DEVICE			0x00000002
14944bff34e3Sthurlow #define	STYPE_IPC			0x00000003
14954bff34e3Sthurlow #define	STYPE_UNKNOWN			0x00000004
14964bff34e3Sthurlow #define	STYPE_MASK			0x0000000F
14974bff34e3Sthurlow #define	STYPE_TEMPORARY			0x40000000
14984bff34e3Sthurlow #define	STYPE_HIDDEN			0x80000000
14994bff34e3Sthurlow 
15004bff34e3Sthurlow #endif /* _NETSMB_SMB_H_ */
1501