/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _SMB_NTSTATUS_H
#define _SMB_NTSTATUS_H
/*
* This file defines the list of Win32 status codes. If you need
* a status code that is defined in the [MS-ERREF] document but
* is not listed here, please add it to the file. This file is
* compatible with the Windows DDK file inc/ntstatus.h
* Please preserve this compatibility.
*
* Be careful not to confuse error codes with status codes. The error
* codes are listed in nterror.h. Some mappings between NT status
* codes and Win32 error codes is provided in the Microsoft knowledge
* base article Q113996.
*
* Also note that this file is used as the input to a small AWK program
* to generate an error name lookup table. If you modify this file,
* please check that a make in libsmb is successful. At present, the
* AWK program checks that the NTSTATUS constants are in this format:
* 0x0123CDEF Please keep that format.
*
* Win32 error codes are 32-bit values with the following format
* (ntstatus.h):
*
* 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
* 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
* +---+-+-+-----------------------+-------------------------------+
* |Sev|C|R| Facility | Code |
* +---+-+-+-----------------------+-------------------------------+
*
* Sev severity code
* 00 - Success
* 01 - Informational
* 10 - Warning
* 11 - Error
*
* C - is the Customer code flag
* R - is a reserved bit
* Facility - is the facility code
* Code - is the facility's status code
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* XXX: Some temporary left-overs from the old ntstatus.h
* Should eliminate uses of these macros when convenient.
*/
/* This used to OR in the severity bits. */
#define NT_SC_ERROR(S) (S)
/* This used to mask off the severity bits. */
#define NT_SC_VALUE(S) (S)
/* XXX end of temporary left-overs. */
/*
* One non-NT macro added for getting the severity value
* from a given NT status code. Evaluates to one of the
* SEVERITY values defined below.
*/
/*
* All NT-compatible from here on.
* (modulo the "NT_" prefix)
*/
/*
* Define the severity codes (same as in the NT DDK).
* These are the top two bits, so shift left 30 bits.
*/
#define NT_STATUS_SEVERITY_SUCCESS 0
/* Facility OS (0x..00....) */
/* All severity zero (success) */
/* All severity 1 (informational) */
/* All severity 2 (warning) */
/* Mostly severity 3 (error) - but NOT all! */
/* Facility Debugger (0x..01....) not used */
/* Facility RPC Runtime (0x..02....) */
/* Facility RPC Stubs (0x..03....) */
/*
* Status codes from higher numbered facilities are not used.
*/
#ifdef __cplusplus
}
#endif
#endif /* _SMB_NTSTATUS_H */