Add NT_STATUS_IO_REPARSE_DATA_INVALID
[metze/samba/wip.git] / libcli / util / ntstatus.h
index d7c60389909be64cd07211320223473f79f3315a..b1286a292e5e986d991e32cd0dd75cb23a0a353e 100644 (file)
@@ -5,17 +5,17 @@
    Copyright (C) John H Terpstra              1996-2000
    Copyright (C) Luke Kenneth Casson Leighton 1996-2000
    Copyright (C) Paul Ashton                  1998-2000
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -597,10 +597,13 @@ typedef uint32_t NTSTATUS;
 #define NT_STATUS_FILE_IS_OFFLINE NT_STATUS(0xC0000000 | 0x0267)
 #define NT_STATUS_DS_NO_MORE_RIDS NT_STATUS(0xC0000000 | 0x02A8)
 #define NT_STATUS_NOT_A_REPARSE_POINT NT_STATUS(0xC0000000 | 0x0275)
+#define NT_STATUS_IO_REPARSE_DATA_INVALID NT_STATUS(0xC0000000 | 0x0278)
 #define NT_STATUS_CURRENT_DOMAIN_NOT_ALLOWED NT_STATUS(0xC0000000 | 0x02E9)
 #define NT_STATUS_OBJECTID_NOT_FOUND NT_STATUS(0xC0000000 | 0x02F0)
 #define NT_STATUS_NO_SUCH_JOB NT_STATUS(0xC0000000 | 0xEDE) /* scheduler */
 #define NT_STATUS_DOWNGRADE_DETECTED NT_STATUS(0xC0000000 | 0x0388)
+#define NT_STATUS_NO_S4U_PROT_SUPPORT NT_STATUS(0xC0000000 | 0x040A)
+#define NT_STATUS_CROSSREALM_DELEGATION_FAILURE NT_STATUS(0xC0000000 | 0x040B)
 #define NT_STATUS_NO_SUCH_JOB NT_STATUS(0xC0000000 | 0xEDE) /* scheduler */
 #define NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED NT_STATUS(0xC0000000 | 0x20004)
 #define NT_STATUS_RPC_UNSUPPORTED_NAME_SYNTAX NT_STATUS(0xC0000000 | 0x20026)
@@ -626,6 +629,15 @@ typedef uint32_t NTSTATUS;
  * this means we need a torture test */
 #define NT_STATUS_FOOBAR NT_STATUS_UNSUCCESSFUL
 
+/*****************************************************************************
+ Returns an NT error message.  not amazingly helpful, but better than a number.
+
+ This version is const, and so neither allocates memory nor uses a
+ static variable for unknown errors.
+ *****************************************************************************/
+
+const char *nt_errstr_const(NTSTATUS nt_code);
+
 /*****************************************************************************
  returns an NT error message.  not amazingly helpful, but better than a number.
  *****************************************************************************/
@@ -639,16 +651,13 @@ const char *get_friendly_nt_error_msg(NTSTATUS nt_code);
 /*****************************************************************************
  returns an NT_STATUS constant as a string for inclusion in autogen C code
  *****************************************************************************/
-const char *get_nt_error_c_code(NTSTATUS nt_code);
+const char *get_nt_error_c_code(void *mem_ctx, NTSTATUS nt_code);
 
 /*****************************************************************************
  returns the NT_STATUS constant matching the string supplied (as an NTSTATUS)
  *****************************************************************************/
 NTSTATUS nt_status_string_to_code(const char *nt_status_str);
 
-/** Used by ntstatus_dos_equal: */
-extern bool ntstatus_check_dos_mapping;
-
 /* we need these here for openchange */
 #ifndef likely
 #define likely(x) (x)
@@ -659,13 +668,7 @@ extern bool ntstatus_check_dos_mapping;
 
 #define NT_STATUS_IS_OK(x) (likely(NT_STATUS_V(x) == 0))
 #define NT_STATUS_IS_ERR(x) (unlikely((NT_STATUS_V(x) & 0xc0000000) == 0xc0000000))
-/* checking for DOS error mapping here is ugly, but unfortunately the
-   alternative is a very intrusive rewrite of the torture code */
-#if _SAMBA_BUILD_ == 4
-#define NT_STATUS_EQUAL(x,y) (NT_STATUS_IS_DOS(x)||NT_STATUS_IS_DOS(y)?ntstatus_dos_equal(x,y):NT_STATUS_V(x) == NT_STATUS_V(y))
-#else
 #define NT_STATUS_EQUAL(x,y) (NT_STATUS_V(x) == NT_STATUS_V(y))
-#endif
 
 #define NT_STATUS_HAVE_NO_MEMORY(x) do { \
        if (unlikely(!(x))) {           \
@@ -730,4 +733,10 @@ extern bool ntstatus_check_dos_mapping;
        (((NT_STATUS_V(status) & 0xFFFF) == 0xC0020000) || \
         ((NT_STATUS_V(status) & 0xFFFF) == 0xC0030000))
 
+typedef struct
+{
+       const char *nt_errstr;
+       NTSTATUS nt_errcode;
+} nt_err_code_struct;
+
 #endif /* _NTSTATUS_H */