2023-03-03 18:48:25 +01:00
/*
Unix SMB / CIFS implementation .
2006-03-25 18:47:47 +00:00
Error handling code
2023-03-03 18:48:25 +01:00
2006-03-25 18:47:47 +00:00
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
2007-07-10 02:07:03 +00:00
the Free Software Foundation ; either version 3 of the License , or
2006-03-25 18:47:47 +00:00
( at your option ) any later version .
2023-03-03 18:48:25 +01:00
2006-03-25 18:47:47 +00:00
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 .
2023-03-03 18:48:25 +01:00
2006-03-25 18:47:47 +00:00
You should have received a copy of the GNU General Public License
2007-07-10 02:07:03 +00:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2006-03-25 18:47:47 +00:00
*/
# ifndef _SAMBA_ERROR_H_
# define _SAMBA_ERROR_H_
2007-09-23 21:35:03 +00:00
# include "libcli/util/werror.h"
2006-03-25 18:47:47 +00:00
# include "libcli/util/doserr.h"
2007-09-23 21:35:03 +00:00
# include "libcli/util/ntstatus.h"
2014-04-07 15:46:32 +02:00
# include "libcli/util/hresult.h"
2007-09-23 21:35:03 +00:00
/*****************************************************************************
convert a NT status code to a dos class / code
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void ntstatus_to_dos ( NTSTATUS ntstatus , uint8_t * eclass , uint32_t * ecode ) ;
/*****************************************************************************
convert a WERROR to a NT status32 code
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
NTSTATUS werror_to_ntstatus ( WERROR error ) ;
/*****************************************************************************
convert a NTSTATUS to a WERROR
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
WERROR ntstatus_to_werror ( NTSTATUS error ) ;
/*********************************************************************
Map an NT error code from a Unix error code .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2011-06-20 14:55:32 +10:00
NTSTATUS map_nt_error_from_unix_common ( int unix_error ) ;
2007-09-23 21:35:03 +00:00
2021-01-22 14:04:35 +01:00
/*********************************************************************
Map a Unix error code from a NT error code .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
int map_errno_from_nt_status ( NTSTATUS status ) ;
2011-03-19 00:45:56 +01:00
NTSTATUS nt_status_squash ( NTSTATUS nt_status ) ;
2011-01-26 22:17:43 +01:00
/*****************************************************************************
convert a Unix error to a WERROR
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
WERROR unix_to_werror ( int unix_error ) ;
2006-03-25 18:47:47 +00:00
# endif /* _SAMBA_ERROR_H */