diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-08-27 17:52:23 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-08-27 17:52:23 +0000 |
commit | 1b778bc7d22efff3f90dc450eb12baa1241cf68f (patch) | |
tree | 6b1d11d27770295964ca18712ca841fc566db5b3 /source/libsmb | |
parent | 83d9896c1ea8be796192b51a4678c2a3b87f7518 (diff) | |
download | samba-1b778bc7d22efff3f90dc450eb12baa1241cf68f.tar.gz samba-1b778bc7d22efff3f90dc450eb12baa1241cf68f.tar.xz samba-1b778bc7d22efff3f90dc450eb12baa1241cf68f.zip |
started converting NTSTATUS to be a structure on systems with gcc in order to make it type incompatible with BOOL so we catch errors sooner. This has already found a number of bugs
Diffstat (limited to 'source/libsmb')
-rw-r--r-- | source/libsmb/clierror.c | 53 | ||||
-rw-r--r-- | source/libsmb/clireadwrite.c | 9 | ||||
-rw-r--r-- | source/libsmb/clitrans.c | 26 | ||||
-rw-r--r-- | source/libsmb/errormap.c | 854 | ||||
-rw-r--r-- | source/libsmb/nterr.c | 13 |
5 files changed, 902 insertions, 53 deletions
diff --git a/source/libsmb/clierror.c b/source/libsmb/clierror.c index 896360ce980..f485d328e26 100644 --- a/source/libsmb/clierror.c +++ b/source/libsmb/clierror.c @@ -76,7 +76,7 @@ char *cli_errstr(struct cli_state *cli) /* Case #1: 32-bit NT errors */ if (flgs2 & FLAGS2_32_BIT_ERROR_CODES) { - uint32 status = IVAL(cli->inbuf,smb_rcls); + NTSTATUS status = NT_STATUS(IVAL(cli->inbuf,smb_rcls)); return get_nt_error_msg(status); } @@ -103,7 +103,7 @@ char *cli_errstr(struct cli_state *cli) /* Return the 32-bit NT status code from the last packet */ -uint32 cli_nt_error(struct cli_state *cli) +NTSTATUS cli_nt_error(struct cli_state *cli) { int flgs2 = SVAL(cli->inbuf,smb_flg2); @@ -113,7 +113,7 @@ uint32 cli_nt_error(struct cli_state *cli) return dos_to_ntstatus(class, code); } - return IVAL(cli->inbuf,smb_rcls); + return NT_STATUS(IVAL(cli->inbuf,smb_rcls)); } @@ -130,7 +130,7 @@ void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *ecode) flgs2 = SVAL(cli->inbuf,smb_flg2); if (flgs2 & FLAGS2_32_BIT_ERROR_CODES) { - uint32 ntstatus = IVAL(cli->inbuf, smb_rcls); + NTSTATUS ntstatus = NT_STATUS(IVAL(cli->inbuf, smb_rcls)); ntstatus_to_dos(ntstatus, eclass, ecode); return; } @@ -175,29 +175,38 @@ int cli_errno_from_dos(uint8 eclass, uint32 num) } /* Return a UNIX errno from a NT status code */ - -int cli_errno_from_nt(uint32 status) +static struct { + NTSTATUS status; + int error; +} nt_errno_map[] = { + {NT_STATUS_ACCESS_VIOLATION, EACCES}, + {NT_STATUS_NO_SUCH_FILE, ENOENT}, + {NT_STATUS_NO_SUCH_DEVICE, ENODEV}, + {NT_STATUS_INVALID_HANDLE, EBADF}, + {NT_STATUS_NO_MEMORY, ENOMEM}, + {NT_STATUS_ACCESS_DENIED, EACCES}, + {NT_STATUS_OBJECT_NAME_NOT_FOUND, ENOENT}, + {NT_STATUS_SHARING_VIOLATION, EBUSY}, + {NT_STATUS_OBJECT_PATH_INVALID, ENOTDIR}, + {NT_STATUS_OBJECT_NAME_COLLISION, EEXIST}, + {NT_STATUS_PATH_NOT_COVERED, ENOENT}, + {NT_STATUS(0), 0} +}; + +int cli_errno_from_nt(NTSTATUS status) { - DEBUG(10,("cli_errno_from_nt: 32 bit codes: code=%08x\n", status)); + int i; + DEBUG(10,("cli_errno_from_nt: 32 bit codes: code=%08x\n", NT_STATUS_V(status))); /* Status codes without this bit set are not errors */ - if (!(status & 0xc0000000)) + if (!(NT_STATUS_V(status) & 0xc0000000)) return 0; - switch (status) { - case NT_STATUS_ACCESS_VIOLATION: return EACCES; - case NT_STATUS_NO_SUCH_FILE: return ENOENT; - case NT_STATUS_NO_SUCH_DEVICE: return ENODEV; - case NT_STATUS_INVALID_HANDLE: return EBADF; - case NT_STATUS_NO_MEMORY: return ENOMEM; - case NT_STATUS_ACCESS_DENIED: return EACCES; - case NT_STATUS_OBJECT_NAME_NOT_FOUND: return ENOENT; - case NT_STATUS_SHARING_VIOLATION: return EBUSY; - case NT_STATUS_OBJECT_PATH_INVALID: return ENOTDIR; - case NT_STATUS_OBJECT_NAME_COLLISION: return EEXIST; - case NT_STATUS_PATH_NOT_COVERED: return ENOENT; - } + for (i=0;nt_errno_map[i].error;i++) { + if (NT_STATUS_V(nt_errno_map[i].status) == + NT_STATUS_V(status)) return nt_errno_map[i].error; + } /* for all other cases - a default code */ return EINVAL; @@ -208,7 +217,7 @@ int cli_errno_from_nt(uint32 status) int cli_errno(struct cli_state *cli) { - uint32 status; + NTSTATUS status; if (cli_is_dos_error) { uint8 eclass; diff --git a/source/libsmb/clireadwrite.c b/source/libsmb/clireadwrite.c index 6566acf4efb..abbb8cd110d 100644 --- a/source/libsmb/clireadwrite.c +++ b/source/libsmb/clireadwrite.c @@ -110,16 +110,17 @@ ssize_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_ errors. */ if (cli_is_error(cli)) { - uint32 status = 0; + NTSTATUS status = NT_STATUS_OK; uint8 eclass = 0; + uint32 ecode = 0; if (cli_is_nt_error(cli)) status = cli_nt_error(cli); else - cli_dos_error(cli, &eclass, &status); + cli_dos_error(cli, &eclass, &ecode); - if ((eclass == ERRDOS && status == ERRmoredata) || - status == STATUS_MORE_ENTRIES) + if ((eclass == ERRDOS && ecode == ERRmoredata) || + NT_STATUS_V(status) == NT_STATUS_V(STATUS_MORE_ENTRIES)) return -1; } diff --git a/source/libsmb/clitrans.c b/source/libsmb/clitrans.c index 6ae10144354..bcf1bf5f744 100644 --- a/source/libsmb/clitrans.c +++ b/source/libsmb/clitrans.c @@ -145,8 +145,7 @@ BOOL cli_receive_trans(struct cli_state *cli,int trans, int total_data=0; int total_param=0; int this_data,this_param; - uint8 eclass; - uint32 ecode; + NTSTATUS status; char *tdata; char *tparam; @@ -170,19 +169,9 @@ BOOL cli_receive_trans(struct cli_state *cli,int trans, * to a trans call. This is not an error and should not * be treated as such. */ - - if (cli_is_error(cli)) { - if (cli_is_dos_error(cli)) { - cli_dos_error(cli, &eclass, &ecode); - - if(cli->nt_pipe_fnum == 0) - return(False); - - if(!(eclass == ERRDOS && ecode == ERRmoredata)) { - if (eclass != 0 && (ecode != (0x80000000 | STATUS_BUFFER_OVERFLOW))) - return(False); - } - } + status = cli_nt_error(cli); + + if (NT_STATUS_IS_ERR(status)) { return False; } @@ -251,11 +240,8 @@ BOOL cli_receive_trans(struct cli_state *cli,int trans, CVAL(cli->inbuf,smb_com))); return(False); } - if (cli_is_dos_error(cli)) { - cli_dos_error(cli, &eclass, &ecode); - if(cli->nt_pipe_fnum == 0 || - !(eclass == ERRDOS && ecode == ERRmoredata)) - return(False); + if (NT_STATUS_IS_ERR(cli_nt_error(cli))) { + return(False); } } diff --git a/source/libsmb/errormap.c b/source/libsmb/errormap.c new file mode 100644 index 00000000000..92a4b19847f --- /dev/null +++ b/source/libsmb/errormap.c @@ -0,0 +1,854 @@ +/* + * Unix SMB/Netbios implementation. + * Version 3.0 + * error mapping functions + * Copyright (C) Andrew Tridgell 2001 + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "includes.h" + +/* NT status -> dos error map */ +static struct { + uint8 dos_class; + uint32 dos_code; + NTSTATUS ntstatus; +} ntstatus_to_dos_map[] = { + {ERRDOS, 997, NT_STATUS(0x00000103)}, + {ERRDOS, 111, STATUS_MORE_ENTRIES}, + {ERRDOS, 1300, NT_STATUS(0x00000106)}, + {ERRDOS, 1301, NT_STATUS(0x00000107)}, + {ERRDOS, 1022, NT_STATUS(0x0000010c)}, + {ERRDOS, 1302, NT_STATUS(0x0000010d)}, + {ERRDOS, 8201, NT_STATUS(0x00000121)}, + {ERRDOS, 31, NT_STATUS_UNSUCCESSFUL}, + {ERRSRV, ERRsmbcmd, NT_STATUS_NOT_IMPLEMENTED}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_INFO_CLASS}, + {ERRDOS, 24, NT_STATUS_INFO_LENGTH_MISMATCH}, + {ERRDOS, 998, NT_STATUS_ACCESS_VIOLATION}, + {ERRDOS, 999, NT_STATUS_IN_PAGE_ERROR}, + {ERRDOS, 1454, NT_STATUS_PAGEFILE_QUOTA}, + {ERRDOS, ERRbadfid, NT_STATUS_INVALID_HANDLE}, + {ERRDOS, 1001, NT_STATUS_BAD_INITIAL_STACK}, + {ERRDOS, 193, NT_STATUS_BAD_INITIAL_PC}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_CID}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PARAMETER}, + {ERRDOS, ERRbadfile, NT_STATUS_NO_SUCH_DEVICE}, + {ERRDOS, ERRbadfile, NT_STATUS_NO_SUCH_FILE}, + {ERRSRV, ERRsmbcmd, NT_STATUS_INVALID_DEVICE_REQUEST}, + {ERRDOS, 38, NT_STATUS_END_OF_FILE}, + {ERRDOS, 34, NT_STATUS_WRONG_VOLUME}, + {ERRDOS, 21, NT_STATUS_NO_MEDIA_IN_DEVICE}, + {ERRDOS, 1785, NT_STATUS_UNRECOGNIZED_MEDIA}, + {ERRDOS, 27, NT_STATUS_NONEXISTENT_SECTOR}, + {ERRDOS, 111, NT_STATUS_MORE_PROCESSING_REQUIRED}, + {ERRDOS, ERRnomem, NT_STATUS_NO_MEMORY}, + {ERRDOS, 487, NT_STATUS_CONFLICTING_ADDRESSES}, + {ERRDOS, 487, NT_STATUS_NOT_MAPPED_VIEW}, + {ERRDOS, ERRbadpipe, NT_STATUS(0xc000001a)}, + {ERRDOS, ERRbadpipe, NT_STATUS_UNABLE_TO_DELETE_SECTION}, + {ERRSRV, ERRsmbcmd, NT_STATUS_INVALID_SYSTEM_SERVICE}, + {ERRDOS, 29, NT_STATUS_ILLEGAL_INSTRUCTION}, + {ERRDOS, ERRbadaccess, NT_STATUS_INVALID_LOCK_SEQUENCE}, + {ERRDOS, ERRbadaccess, NT_STATUS_INVALID_VIEW_SIZE}, + {ERRDOS, 193, NT_STATUS_INVALID_FILE_FOR_SECTION}, + {ERRDOS, ERRbadaccess, NT_STATUS_ALREADY_COMMITTED}, + {ERRDOS, ERRbadaccess, NT_STATUS_ACCESS_DENIED}, + {ERRDOS, 122, NT_STATUS_BUFFER_TOO_SMALL}, + {ERRDOS, ERRbadfid, NT_STATUS_OBJECT_TYPE_MISMATCH}, + {ERRDOS, 37, NT_STATUS_NONCONTINUABLE_EXCEPTION}, + {ERRDOS, 38, NT_STATUS_INVALID_DISPOSITION}, + {ERRDOS, 158, NT_STATUS_NOT_LOCKED}, + {ERRDOS, 43, NT_STATUS_PARITY_ERROR}, + {ERRDOS, 487, NT_STATUS_UNABLE_TO_DECOMMIT_VM}, + {ERRDOS, 487, NT_STATUS_NOT_COMMITTED}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PARAMETER_MIX}, + {ERRDOS, 26, NT_STATUS_DISK_CORRUPT_ERROR}, + {ERRSRV, 206, NT_STATUS_OBJECT_NAME_INVALID}, + {ERRDOS, ERRbadfile, NT_STATUS_OBJECT_NAME_NOT_FOUND}, + {ERRDOS, ERRfilexists, NT_STATUS_OBJECT_NAME_COLLISION}, + {ERRDOS, ERRbadfid, NT_STATUS_PORT_DISCONNECTED}, + {ERRDOS, 161, NT_STATUS_OBJECT_PATH_INVALID}, + {ERRDOS, ERRbadpath, NT_STATUS_OBJECT_PATH_NOT_FOUND}, + {ERRDOS, 161, NT_STATUS_OBJECT_PATH_SYNTAX_BAD}, + {ERRDOS, 1117, NT_STATUS_DATA_OVERRUN}, + {ERRDOS, 1117, NT_STATUS_DATA_LATE_ERROR}, + {ERRDOS, ERRbaddata, NT_STATUS_DATA_ERROR}, + {ERRDOS, ERRbaddata, NT_STATUS_CRC_ERROR}, + {ERRDOS, ERRnomem, NT_STATUS_SECTION_TOO_BIG}, + {ERRDOS, ERRbadaccess, NT_STATUS_PORT_CONNECTION_REFUSED}, + {ERRDOS, ERRbadfid, NT_STATUS_INVALID_PORT_HANDLE}, + {ERRDOS, ERRbadshare, NT_STATUS_SHARING_VIOLATION}, + {ERRDOS, 1816, NT_STATUS_QUOTA_EXCEEDED}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PAGE_PROTECTION}, + {ERRDOS, 288, NT_STATUS_MUTANT_NOT_OWNED}, + {ERRDOS, 298, NT_STATUS_SEMAPHORE_LIMIT_EXCEEDED}, + {ERRDOS, ERRbadpipe, NT_STATUS_PORT_ALREADY_SET}, + {ERRDOS, ERRbadpipe, NT_STATUS_SECTION_NOT_IMAGE}, + {ERRDOS, 156, NT_STATUS_SUSPEND_COUNT_EXCEEDED}, + {ERRDOS, ERRbadaccess, NT_STATUS_THREAD_IS_TERMINATING}, + {ERRDOS, ERRbadpipe, NT_STATUS_BAD_WORKING_SET_LIMIT}, + {ERRDOS, ERRbadpipe, NT_STATUS_INCOMPATIBLE_FILE_MAP}, + {ERRDOS, ERRbadpipe, NT_STATUS_SECTION_PROTECTION}, + {ERRDOS, 282, NT_STATUS_EAS_NOT_SUPPORTED}, + {ERRDOS, 275, NT_STATUS_EA_TOO_LARGE}, + {ERRDOS, 276, NT_STATUS_NONEXISTENT_EA_ENTRY}, + {ERRDOS, 276, NT_STATUS_NO_EAS_ON_FILE}, + {ERRDOS, 276, NT_STATUS_EA_CORRUPT_ERROR}, + {ERRDOS, ERRlock, NT_STATUS_FILE_LOCK_CONFLICT}, + {ERRDOS, ERRlock, NT_STATUS_LOCK_NOT_GRANTED}, + {ERRDOS, ERRbadaccess, NT_STATUS_DELETE_PENDING}, + {ERRDOS, ERRunsup, NT_STATUS_CTL_FILE_NOT_SUPPORTED}, + {ERRDOS, 1305, NT_STATUS_UNKNOWN_REVISION}, + {ERRDOS, 1306, NT_STATUS_REVISION_MISMATCH}, + {ERRDOS, 1307, NT_STATUS_INVALID_OWNER}, + {ERRDOS, 1308, NT_STATUS_INVALID_PRIMARY_GROUP}, + {ERRDOS, 1309, NT_STATUS_NO_IMPERSONATION_TOKEN}, + {ERRDOS, 1310, NT_STATUS_CANT_DISABLE_MANDATORY}, + {ERRDOS, 1311, NT_STATUS_NO_LOGON_SERVERS}, + {ERRDOS, 1312, NT_STATUS_NO_SUCH_LOGON_SESSION}, + {ERRDOS, 1313, NT_STATUS_NO_SUCH_PRIVILEGE}, + {ERRDOS, 1314, NT_STATUS_PRIVILEGE_NOT_HELD}, + {ERRDOS, 1315, NT_STATUS_INVALID_ACCOUNT_NAME}, + {ERRDOS, 1316, NT_STATUS_USER_EXISTS}, + {ERRDOS, 1317, NT_STATUS_NO_SUCH_USER}, + {ERRDOS, 1318, NT_STATUS_GROUP_EXISTS}, + {ERRDOS, 1319, NT_STATUS_NO_SUCH_GROUP}, + {ERRDOS, 1320, NT_STATUS_MEMBER_IN_GROUP}, + {ERRDOS, 1321, NT_STATUS_MEMBER_NOT_IN_GROUP}, + {ERRDOS, 1322, NT_STATUS_LAST_ADMIN}, + {ERRSRV, ERRbadpw, NT_STATUS_WRONG_PASSWORD}, + {ERRDOS, 1324, NT_STATUS_ILL_FORMED_PASSWORD}, + {ERRDOS, 1325, NT_STATUS_PASSWORD_RESTRICTION}, + {ERRDOS, 1326, NT_STATUS_LOGON_FAILURE}, + {ERRDOS, 1327, NT_STATUS_ACCOUNT_RESTRICTION}, + {ERRDOS, 1328, NT_STATUS_INVALID_LOGON_HOURS}, + {ERRDOS, 1329, NT_STATUS_INVALID_WORKSTATION}, + {ERRDOS, 1330, NT_STATUS_PASSWORD_EXPIRED}, + {ERRDOS, 1331, NT_STATUS_ACCOUNT_DISABLED}, + {ERRDOS, 1332, NT_STATUS_NONE_MAPPED}, + {ERRDOS, 1333, NT_STATUS_TOO_MANY_LUIDS_REQUESTED}, + {ERRDOS, 1334, NT_STATUS_LUIDS_EXHAUSTED}, + {ERRDOS, 1335, NT_STATUS_INVALID_SUB_AUTHORITY}, + {ERRDOS, 1336, NT_STATUS_INVALID_ACL}, + {ERRDOS, 1337, NT_STATUS_INVALID_SID}, + {ERRDOS, 1338, NT_STATUS_INVALID_SECURITY_DESCR}, + {ERRDOS, 127, NT_STATUS_PROCEDURE_NOT_FOUND}, + {ERRDOS, 193, NT_STATUS_INVALID_IMAGE_FORMAT}, + {ERRDOS, 1008, NT_STATUS_NO_TOKEN}, + {ERRDOS, 1340, NT_STATUS_BAD_INHERITANCE_ACL}, + {ERRDOS, 158, NT_STATUS_RANGE_NOT_LOCKED}, + {ERRSRV, ERRnoroom, NT_STATUS_DISK_FULL}, + {ERRDOS, 1341, NT_STATUS_SERVER_DISABLED}, + {ERRDOS, 1342, NT_STATUS_SERVER_NOT_DISABLED}, + {ERRDOS, 68, NT_STATUS_TOO_MANY_GUIDS_REQUESTED}, + {ERRDOS, 259, NT_STATUS_GUIDS_EXHAUSTED}, + {ERRDOS, 1343, NT_STATUS_INVALID_ID_AUTHORITY}, + {ERRDOS, 259, NT_STATUS_AGENTS_EXHAUSTED}, + {ERRDOS, 154, NT_STATUS_INVALID_VOLUME_LABEL}, + {ERRDOS, 14, NT_STATUS_SECTION_NOT_EXTENDED}, + {ERRDOS, 487, NT_STATUS_NOT_MAPPED_DATA}, + {ERRDOS, 1812, NT_STATUS_RESOURCE_DATA_NOT_FOUND}, + {ERRDOS, 1813, NT_STATUS_RESOURCE_TYPE_NOT_FOUND}, + {ERRDOS, 1814, NT_STATUS_RESOURCE_NAME_NOT_FOUND}, + {ERRDOS, 140, NT_STATUS_ARRAY_BOUNDS_EXCEEDED}, + {ERRDOS, 141, NT_STATUS_FLOAT_DENORMAL_OPERAND}, + {ERRDOS, 142, NT_STATUS_FLOAT_DIVIDE_BY_ZERO}, + {ERRDOS, 143, NT_STATUS_FLOAT_INEXACT_RESULT}, + {ERRDOS, 144, NT_STATUS_FLOAT_INVALID_OPERATION}, + {ERRDOS, 145, NT_STATUS_FLOAT_OVERFLOW}, + {ERRDOS, 146, NT_STATUS_FLOAT_STACK_CHECK}, + {ERRDOS, 147, NT_STATUS_FLOAT_UNDERFLOW}, + {ERRDOS, 148, NT_STATUS_INTEGER_DIVIDE_BY_ZERO}, + {ERRDOS, 534, NT_STATUS_INTEGER_OVERFLOW}, + {ERRDOS, 150, NT_STATUS_PRIVILEGED_INSTRUCTION}, + {ERRDOS, ERRnomem, NT_STATUS_TOO_MANY_PAGING_FILES}, + {ERRDOS, 1006, NT_STATUS_FILE_INVALID}, + {ERRDOS, 1344, NT_STATUS_ALLOTTED_SPACE_EXCEEDED}, + {ERRDOS, ERRnomem, NT_STATUS_INSUFFICIENT_RESOURCES}, + {ERRDOS, ERRbadpath, NT_STATUS_DFS_EXIT_PATH_FOUND}, + {ERRDOS, ERRbaddata, NT_STATUS_DEVICE_DATA_ERROR}, + {ERRDOS, 1167, NT_STATUS_DEVICE_NOT_CONNECTED}, + {ERRDOS, 21, NT_STATUS_DEVICE_POWER_FAILURE}, + {ERRDOS, 487, NT_STATUS_FREE_VM_NOT_AT_BASE}, + {ERRDOS, 487, NT_STATUS_MEMORY_NOT_ALLOCATED}, + {ERRDOS, 1453, NT_STATUS_WORKING_SET_QUOTA}, + {ERRDOS, 19, NT_STATUS_MEDIA_WRITE_PROTECTED}, + {ERRDOS, 21, NT_STATUS_DEVICE_NOT_READY}, + {ERRDOS, 1345, NT_STATUS_INVALID_GROUP_ATTRIBUTES}, + {ERRDOS, 1346, NT_STATUS_BAD_IMPERSONATION_LEVEL}, + {ERRDOS, 1347, NT_STATUS_CANT_OPEN_ANONYMOUS}, + {ERRDOS, 1348, NT_STATUS_BAD_VALIDATION_CLASS}, + {ERRDOS, 1349, NT_STATUS_BAD_TOKEN_TYPE}, + {ERRDOS, ERRbadpipe, NT_STATUS_BAD_MASTER_BOOT_RECORD}, + {ERRDOS, ERRpipebusy, NT_STATUS_INSTANCE_NOT_AVAILABLE}, + {ERRDOS, ERRpipebusy, NT_STATUS_PIPE_NOT_AVAILABLE}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PIPE_STATE}, + {ERRDOS, ERRpipebusy, NT_STATUS_PIPE_BUSY}, + {ERRSRV, ERRsmbcmd, NT_STATUS_ILLEGAL_FUNCTION}, + {ERRDOS, ERRnotconnected, NT_STATUS_PIPE_DISCONNECTED}, + {ERRDOS, ERRpipeclosing, NT_STATUS_PIPE_CLOSING}, + {ERRDOS, 535, NT_STATUS_PIPE_CONNECTED}, + {ERRDOS, 536, NT_STATUS_PIPE_LISTENING}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_READ_MODE}, + {ERRDOS, 121, NT_STATUS_IO_TIMEOUT}, + {ERRDOS, 38, NT_STATUS_FILE_FORCED_CLOSED}, + {ERRDOS, ERRbadaccess, NT_STATUS_FILE_IS_A_DIRECTORY}, + {ERRDOS, ERRunsup, NT_STATUS_NOT_SUPPORTED}, + {ERRDOS, 51, NT_STATUS_REMOTE_NOT_LISTENING}, + {ERRDOS, 52, NT_STATUS_DUPLICATE_NAME}, + {ERRDOS, 53, NT_STATUS_BAD_NETWORK_PATH}, + {ERRDOS, 54, NT_STATUS_NETWORK_BUSY}, + {ERRDOS, 55, NT_STATUS_DEVICE_DOES_NOT_EXIST}, + {ERRDOS, 56, NT_STATUS_TOO_MANY_COMMANDS}, + {ERRDOS, 57, NT_STATUS_ADAPTER_HARDWARE_ERROR}, + {ERRDOS, 58, NT_STATUS_INVALID_NETWORK_RESPONSE}, + {ERRDOS, 59, NT_STATUS_UNEXPECTED_NETWORK_ERROR}, + {ERRDOS, 60, NT_STATUS_BAD_REMOTE_ADAPTER}, + {ERRSRV, ERRqfull, NT_STATUS_PRINT_QUEUE_FULL}, + {ERRSRV, ERRqtoobig, NT_STATUS_NO_SPOOL_SPACE}, + {ERRSRV, ERRinvpfid, NT_STATUS_PRINT_CANCELLED}, + {ERRSRV, ERRinvnid, NT_STATUS_NETWORK_NAME_DELETED}, + {ERRSRV, ERRaccess, NT_STATUS_NETWORK_ACCESS_DENIED}, + {ERRSRV, ERRbadtype, NT_STATUS_BAD_DEVICE_TYPE}, + {ERRSRV, ERRinvnetname, NT_STATUS_BAD_NETWORK_NAME}, + {ERRDOS, 68, NT_STATUS_TOO_MANY_NAMES}, + {ERRSRV, ERRtoomanyuids, NT_STATUS_TOO_MANY_SESSIONS}, + {ERRSRV, ERRpaused, NT_STATUS_SHARING_PAUSED}, + {ERRSRV, ERRmsgoff, NT_STATUS_REQUEST_NOT_ACCEPTED}, + {ERRDOS, 72, NT_STATUS_REDIRECTOR_PAUSED}, + {ERRDOS, 88, NT_STATUS_NET_WRITE_FAULT}, + {ERRDOS, ERRdiffdevice, NT_STATUS_NOT_SAME_DEVICE}, + {ERRDOS, ERRbadaccess, NT_STATUS_FILE_RENAMED}, + {ERRDOS, 240, NT_STATUS_VIRTUAL_CIRCUIT_CLOSED}, + {ERRDOS, 1350, NT_STATUS_NO_SECURITY_ON_OBJECT}, + {ERRDOS, ERRpipeclosing, NT_STATUS_PIPE_EMPTY}, + {ERRDOS, 1351, NT_STATUS_CANT_ACCESS_DOMAIN_INFO}, + {ERRDOS, 1352, NT_STATUS_INVALID_SERVER_STATE}, + {ERRDOS, 1353, NT_STATUS_INVALID_DOMAIN_STATE}, + {ERRDOS, 1354, NT_STATUS_INVALID_DOMAIN_ROLE}, + {ERRDOS, 1355, NT_STATUS_NO_SUCH_DOMAIN}, + {ERRDOS, 1356, NT_STATUS_DOMAIN_EXISTS}, + {ERRDOS, 1357, NT_STATUS_DOMAIN_LIMIT_EXCEEDED}, + {ERRDOS, 300, NT_STATUS_OPLOCK_NOT_GRANTED}, + {ERRDOS, 301, NT_STATUS_INVALID_OPLOCK_PROTOCOL}, + {ERRDOS, 1358, NT_STATUS_INTERNAL_DB_CORRUPTION}, + {ERRDOS, 1359, NT_STATUS_INTERNAL_ERROR}, + {ERRDOS, 1360, NT_STATUS_GENERIC_NOT_MAPPED}, + {ERRDOS, 1361, NT_STATUS_BAD_DESCRIPTOR_FORMAT}, + {ERRDOS, 1784, NT_STATUS_INVALID_USER_BUFFER}, + {ERRDOS, 1362, NT_STATUS_NOT_LOGON_PROCESS}, + {ERRDOS, 1363, NT_STATUS_LOGON_SESSION_EXISTS}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PARAMETER_1}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PARAMETER_2}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PARAMETER_3}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PARAMETER_4}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PARAMETER_5}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PARAMETER_6}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PARAMETER_7}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PARAMETER_8}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PARAMETER_9}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PARAMETER_10}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PARAMETER_11}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_PARAMETER_12}, + {ERRDOS, ERRbadpath, NT_STATUS_REDIRECTOR_NOT_STARTED}, + {ERRDOS, 1001, NT_STATUS_STACK_OVERFLOW}, + {ERRDOS, 1364, NT_STATUS_NO_SUCH_PACKAGE}, + {ERRDOS, 203, NT_STATUS(0xc0000100)}, + {ERRDOS, ERRremcd, NT_STATUS_DIRECTORY_NOT_EMPTY}, + {ERRDOS, 276, NT_STATUS_FILE_CORRUPT_ERROR}, + {ERRDOS, 267, NT_STATUS_NOT_A_DIRECTORY}, + {ERRDOS, 1365, NT_STATUS_BAD_LOGON_SESSION_STATE}, + {ERRDOS, 1366, NT_STATUS_LOGON_SESSION_COLLISION}, + {ERRDOS, 206, NT_STATUS_NAME_TOO_LONG}, + {ERRDOS, 2401, NT_STATUS_FILES_OPEN}, + {ERRDOS, 2404, NT_STATUS_CONNECTION_IN_USE}, + {ERRDOS, ERRbadaccess, NT_STATUS_PROCESS_IS_TERMINATING}, + {ERRDOS, 1367, NT_STATUS_INVALID_LOGON_TYPE}, + {ERRDOS, 1368, NT_STATUS_CANNOT_IMPERSONATE}, + {ERRDOS, 1056, NT_STATUS_IMAGE_ALREADY_LOADED}, + {ERRDOS, 1444, NT_STATUS_NO_LDT}, + {ERRDOS, 193, NT_STATUS_INVALID_IMAGE_NE_FORMAT}, + {ERRDOS, 1369, NT_STATUS_RXACT_INVALID_STATE}, + {ERRDOS, 1370, NT_STATUS_RXACT_COMMIT_FAILURE}, + {ERRDOS, 1006, NT_STATUS_MAPPED_FILE_SIZE_ZERO}, + {ERRDOS, ERRnofids, NT_STATUS_TOO_MANY_OPENED_FILES}, + {ERRDOS, 995, NT_STATUS_CANCELLED}, + {ERRDOS, ERRbadaccess, NT_STATUS_CANNOT_DELETE}, + {ERRDOS, 1210, NT_STATUS_INVALID_COMPUTER_NAME}, + {ERRDOS, ERRbadaccess, NT_STATUS_FILE_DELETED}, + {ERRDOS, 1371, NT_STATUS_SPECIAL_ACCOUNT}, + {ERRDOS, 1372, NT_STATUS_SPECIAL_GROUP}, + {ERRDOS, 1373, NT_STATUS_SPECIAL_USER}, + {ERRDOS, 1374, NT_STATUS_MEMBERS_PRIMARY_GROUP}, + {ERRDOS, ERRbadfid, NT_STATUS_FILE_CLOSED}, + {ERRDOS, 1375, NT_STATUS_TOKEN_ALREADY_IN_USE}, + {ERRDOS, 1455, NT_STATUS_COMMITMENT_LIMIT}, + {ERRDOS, 193, NT_STATUS_INVALID_IMAGE_LE_FORMAT}, + {ERRDOS, 193, NT_STATUS_INVALID_IMAGE_NOT_MZ}, + {ERRDOS, 193, NT_STATUS_INVALID_IMAGE_PROTECT}, + {ERRDOS, 193, NT_STATUS_INVALID_IMAGE_WIN_16}, + {ERRDOS, 1398, NT_STATUS_TIME_DIFFERENCE_AT_DC}, + {ERRDOS, 126, NT_STATUS_DLL_NOT_FOUND}, + {ERRDOS, 182, NT_STATUS_ORDINAL_NOT_FOUND}, + {ERRDOS, 127, NT_STATUS_ENTRYPOINT_NOT_FOUND}, + {ERRSRV, ERRinvnid, NT_STATUS_LOCAL_DISCONNECT}, + {ERRSRV, ERRinvnid, NT_STATUS_REMOTE_DISCONNECT}, + {ERRDOS, 51, NT_STATUS_REMOTE_RESOURCES}, + {ERRDOS, 59, NT_STATUS_LINK_FAILED}, + {ERRDOS, 59, NT_STATUS_LINK_TIMEOUT}, + {ERRDOS, 59, NT_STATUS_INVALID_CONNECTION}, + {ERRDOS, 59, NT_STATUS_INVALID_ADDRESS}, + {ERRDOS, 1114, NT_STATUS_DLL_INIT_FAILED}, + {ERRDOS, 124, NT_STATUS_INVALID_LEVEL}, + {ERRSRV, ERRbadpw, NT_STATUS_WRONG_PASSWORD_CORE}, + {ERRDOS, 109, NT_STATUS_PIPE_BROKEN}, + {ERRDOS, 1009, NT_STATUS_REGISTRY_CORRUPT}, + {ERRDOS, 1016, NT_STATUS_REGISTRY_IO_FAILED}, + {ERRDOS, 1005, NT_STATUS_UNRECOGNIZED_VOLUME}, + {ERRDOS, 1118, NT_STATUS_SERIAL_NO_DEVICE_INITED}, + {ERRDOS, 1376, NT_STATUS_NO_SUCH_ALIAS}, + {ERRDOS, 1377, NT_STATUS_MEMBER_NOT_IN_ALIAS}, + {ERRDOS, 1378, NT_STATUS_MEMBER_IN_ALIAS}, + {ERRDOS, 1379, NT_STATUS_ALIAS_EXISTS}, + {ERRDOS, 1380, NT_STATUS_LOGON_NOT_GRANTED}, + {ERRDOS, 1381, NT_STATUS_TOO_MANY_SECRETS}, + {ERRDOS, 1382, NT_STATUS_SECRET_TOO_LONG}, + {ERRDOS, 1383, NT_STATUS_INTERNAL_DB_ERROR}, + {ERRDOS, 1007, NT_STATUS_FULLSCREEN_MODE}, + {ERRDOS, 1384, NT_STATUS_TOO_MANY_CONTEXT_IDS}, + {ERRDOS, 1385, NT_STATUS_LOGON_TYPE_NOT_GRANTED}, + {ERRDOS, 1017, NT_STATUS_NOT_REGISTRY_FILE}, + {ERRDOS, 1386, NT_STATUS_NT_CROSS_ENCRYPTION_REQUIRED}, + {ERRDOS, 1117, NT_STATUS_FT_MISSING_MEMBER}, + {ERRDOS, 1113, NT_STATUS_UNMAPPABLE_CHARACTER}, + {ERRDOS, 1122, NT_STATUS_FLOPPY_ID_MARK_NOT_FOUND}, + {ERRDOS, 1123, NT_STATUS_FLOPPY_WRONG_CYLINDER}, + {ERRDOS, 1124, NT_STATUS_FLOPPY_UNKNOWN_ERROR}, + {ERRDOS, 1125, NT_STATUS_FLOPPY_BAD_REGISTERS}, + {ERRDOS, 1126, NT_STATUS_DISK_RECALIBRATE_FAILED}, + {ERRDOS, 1127, NT_STATUS_DISK_OPERATION_FAILED}, + {ERRDOS, 1128, NT_STATUS_DISK_RESET_FAILED}, + {ERRDOS, 1119, NT_STATUS_SHARED_IRQ_BUSY}, + {ERRDOS, 1117, NT_STATUS_FT_ORPHANING}, + {ERRDOS, 1105, NT_STATUS_PARTITION_FAILURE}, + {ERRDOS, 1106, NT_STATUS_INVALID_BLOCK_LENGTH}, + {ERRDOS, 1107, NT_STATUS_DEVICE_NOT_PARTITIONED}, + {ERRDOS, 1108, NT_STATUS_UNABLE_TO_LOCK_MEDIA}, + {ERRDOS, 1109, NT_STATUS_UNABLE_TO_UNLOAD_MEDIA}, + {ERRDOS, 1129, NT_STATUS_EOM_OVERFLOW}, + {ERRDOS, 1112, NT_STATUS_NO_MEDIA}, + {ERRDOS, 1387, NT_STATUS_NO_SUCH_MEMBER}, + {ERRDOS, 1388, NT_STATUS_INVALID_MEMBER}, + {ERRDOS, 1018, NT_STATUS_KEY_DELETED}, + {ERRDOS, 1019, NT_STATUS_NO_LOG_SPACE}, + {ERRDOS, 1389, NT_STATUS_TOO_MANY_SIDS}, + {ERRDOS, 1390, NT_STATUS_LM_CROSS_ENCRYPTION_REQUIRED}, + {ERRDOS, 1020, NT_STATUS_KEY_HAS_CHILDREN}, + {ERRDOS, 1021, NT_STATUS_CHILD_MUST_BE_VOLATILE}, + {ERRDOS, ERRbadpipe, NT_STATUS_DEVICE_CONFIGURATION_ERROR}, + {ERRDOS, 1117, NT_STATUS_DRIVER_INTERNAL_ERROR}, + {ERRDOS, 22, NT_STATUS_INVALID_DEVICE_STATE}, + {ERRDOS, 1117, NT_STATUS_IO_DEVICE_ERROR}, + {ERRDOS, 1117, NT_STATUS_DEVICE_PROTOCOL_ERROR}, + {ERRDOS, 1502, NT_STATUS_LOG_FILE_FULL}, + {ERRDOS, 19, NT_STATUS_TOO_LATE}, + {ERRDOS, 1786, NT_STATUS_NO_TRUST_LSA_SECRET}, + {ERRDOS, 1787, NT_STATUS_NO_TRUST_SAM_ACCOUNT}, + {ERRDOS, 1788, NT_STATUS_TRUSTED_DOMAIN_FAILURE}, + {ERRDOS, 1789, NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE}, + {ERRDOS, 1500, NT_STATUS_EVENTLOG_FILE_CORRUPT}, + {ERRDOS, 1501, NT_STATUS_EVENTLOG_CANT_START}, + {ERRDOS, 1790, NT_STATUS_TRUST_FAILURE}, + {ERRDOS, 1792, NT_STATUS_NETLOGON_NOT_STARTED}, + {ERRDOS, 1793, NT_STATUS_ACCOUNT_EXPIRED}, + {ERRDOS, 1131, NT_STATUS_POSSIBLE_DEADLOCK}, + {ERRDOS, 1219, NT_STATUS_NETWORK_CREDENTIAL_CONFLICT}, + {ERRDOS, 1220, NT_STATUS_REMOTE_SESSION_LIMIT}, + {ERRDOS, 1503, NT_STATUS_EVENTLOG_FILE_CHANGED}, + {ERRDOS, 1807, NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT}, + {ERRDOS, 1808, NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT}, + {ERRDOS, 1809, NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT}, + {ERRDOS, 1810, NT_STATUS_DOMAIN_TRUST_INCONSISTENT}, + {ERRDOS, 1394, NT_STATUS_NO_USER_SESSION_KEY}, + {ERRDOS, 59, NT_STATUS_USER_SESSION_DELETED}, + {ERRDOS, 1815, NT_STATUS_RESOURCE_LANG_NOT_FOUND}, + {ERRDOS, 1130, NT_STATUS_INSUFF_SERVER_RESOURCES}, + {ERRDOS, 1784, NT_STATUS_INVALID_BUFFER_SIZE}, + {ERRDOS, 1214, NT_STATUS_INVALID_ADDRESS_COMPONENT}, + {ERRDOS, 1214, NT_STATUS_INVALID_ADDRESS_WILDCARD}, + {ERRDOS, 68, NT_STATUS_TOO_MANY_ADDRESSES}, + {ERRDOS, 52, NT_STATUS_ADDRESS_ALREADY_EXISTS}, + {ERRSRV, ERRinvnid, NT_STATUS_ADDRESS_CLOSED}, + {ERRSRV, ERRinvnid, NT_STATUS_CONNECTION_DISCONNECTED}, + {ERRSRV, ERRinvnid, NT_STATUS_CONNECTION_RESET}, + {ERRDOS, 68, NT_STATUS_TOO_MANY_NODES}, + {ERRDOS, 59, NT_STATUS_TRANSACTION_ABORTED}, + {ERRDOS, 59, NT_STATUS_TRANSACTION_TIMED_OUT}, + {ERRDOS, 59, NT_STATUS_TRANSACTION_NO_RELEASE}, + {ERRDOS, 59, NT_STATUS_TRANSACTION_NO_MATCH}, + {ERRDOS, 59, NT_STATUS_TRANSACTION_RESPONDED}, + {ERRDOS, 59, NT_STATUS_TRANSACTION_INVALID_ID}, + {ERRDOS, 59, NT_STATUS_TRANSACTION_INVALID_TYPE}, + {ERRDOS, ERRunsup, NT_STATUS_NOT_SERVER_SESSION}, + {ERRDOS, ERRunsup, NT_STATUS_NOT_CLIENT_SESSION}, + {ERRDOS, 6118, NT_STATUS_NO_BROWSER_SERVERS_FOUND}, + {ERRDOS, 1132, NT_STATUS_MAPPED_ALIGNMENT}, + {ERRDOS, 193, NT_STATUS_IMAGE_CHECKSUM_MISMATCH}, + {ERRDOS, 1907, NT_STATUS_PASSWORD_MUST_CHANGE}, + {ERRDOS, 1168, NT_STATUS_NOT_FOUND}, + {ERRDOS, 554, NT_STATUS_DUPLICATE_OBJECTID}, + {ERRDOS, 555, NT_STATUS_OBJECTID_EXISTS}, + {ERRDOS, 1237, NT_STATUS_RETRY}, + {ERRDOS, 1170, NT_STATUS_PROPSET_NOT_FOUND}, + {ERRDOS, 1908, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND}, + {ERRDOS, 1909, NT_STATUS_ACCOUNT_LOCKED_OUT}, + {ERRDOS, ERRbadfid, NT_STATUS_HANDLE_NOT_CLOSABLE}, + {ERRDOS, 1225, NT_STATUS_CONNECTION_REFUSED}, + {ERRDOS, 1226, NT_STATUS_GRACEFUL_DISCONNECT}, + {ERRDOS, 1227, NT_STATUS_ADDRESS_ALREADY_ASSOCIATED}, + {ERRDOS, 1228, NT_STATUS_ADDRESS_NOT_ASSOCIATED}, + {ERRDOS, 1229, NT_STATUS_CONNECTION_INVALID}, + {ERRDOS, 1230, NT_STATUS_CONNECTION_ACTIVE}, + {ERRDOS, 1231, NT_STATUS_NETWORK_UNREACHABLE}, + {ERRDOS, 1232, NT_STATUS_HOST_UNREACHABLE}, + {ERRDOS, 1233, NT_STATUS_PROTOCOL_UNREACHABLE}, + {ERRDOS, 1234, NT_STATUS_PORT_UNREACHABLE}, + {ERRDOS, 1235, NT_STATUS_REQUEST_ABORTED}, + {ERRDOS, 1236, NT_STATUS_CONNECTION_ABORTED}, + {ERRDOS, 1224, NT_STATUS_USER_MAPPED_FILE}, + {ERRDOS, 1238, NT_STATUS_CONNECTION_COUNT_LIMIT}, + {ERRDOS, 1239, NT_STATUS_LOGIN_TIME_RESTRICTION}, + {ERRDOS, 1240, NT_STATUS_LOGIN_WKSTA_RESTRICTION}, + {ERRDOS, 193, NT_STATUS_IMAGE_MP_UP_MISMATCH}, + {ERRDOS, 1359, NT_STATUS_LPC_REPLY_LOST}, + {ERRDOS, 1232, NT_STATUS_PATH_NOT_COVERED}, + {ERRDOS, 1395, NT_STATUS_LICENSE_QUOTA_EXCEEDED}, + {ERRDOS, 1058, NT_STATUS_PLUGPLAY_NO_DEVICE}, + {ERRDOS, 182, NT_STATUS_DRIVER_ORDINAL_NOT_FOUND}, + {ERRDOS, 127, NT_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND}, + {ERRDOS, 288, NT_STATUS_RESOURCE_NOT_OWNED}, + {ERRDOS, 1142, NT_STATUS_TOO_MANY_LINKS}, + {ERRDOS, 4350, NT_STATUS_FILE_IS_OFFLINE}, + {ERRDOS, 2001, NT_STATUS(0xc000026c)}, + {ERRDOS, 1201, NT_STATUS(0xc000026d)}, + {ERRDOS, 21, NT_STATUS(0xc000026e)}, + {ERRDOS, 1169, NT_STATUS(0xc0000272)}, + {ERRDOS, 4390, NT_STATUS(0xc0000275)}, + {ERRDOS, 4393, NT_STATUS(0xc0000276)}, + {ERRDOS, 4394, NT_STATUS(0xc0000277)}, + {ERRDOS, 4392, NT_STATUS(0xc0000278)}, + {ERRDOS, 1920, NT_STATUS(0xc0000279)}, + {ERRDOS, 1921, NT_STATUS(0xc0000280)}, + {ERRDOS, 161, NT_STATUS(0xc0000281)}, + {ERRDOS, 1160, NT_STATUS(0xc0000283)}, + {ERRDOS, 1161, NT_STATUS(0xc0000284)}, + {ERRDOS, 1162, NT_STATUS(0xc0000285)}, + {ERRDOS, 1163, NT_STATUS(0xc0000286)}, + {ERRDOS, 1164, NT_STATUS(0xc0000287)}, + {ERRDOS, ERRbadaccess, NT_STATUS(0xc000028a)}, + {ERRDOS, ERRbadaccess, NT_STATUS(0xc000028b)}, + {ERRDOS, ERRbadaccess, NT_STATUS(0xc000028d)}, + {ERRDOS, ERRbadaccess, NT_STATUS(0xc000028e)}, + {ERRDOS, ERRbadaccess, NT_STATUS(0xc000028f)}, + {ERRDOS, ERRbadaccess, NT_STATUS(0xc0000290)}, + {ERRDOS, 6007, NT_STATUS(0xc0000291)}, + {ERRDOS, 6008, NT_STATUS(0xc0000292)}, + {ERRDOS, 6002, NT_STATUS(0xc0000293)}, + {ERRDOS, 4200, NT_STATUS(0xc0000295)}, + {ERRDOS, 4201, NT_STATUS(0xc0000296)}, + {ERRDOS, 4202, NT_STATUS(0xc0000297)}, + {ERRDOS, 4203, NT_STATUS(0xc0000298)}, + {ERRDOS, 8218, NT_STATUS(0xc0000299)}, + {ERRDOS, 8219, NT_STATUS(0xc000029a)}, + {ERRDOS, 8220, NT_STATUS(0xc000029b)}, + {ERRSRV, ERRsmbcmd, NT_STATUS(0xc000029c)}, + {ERRDOS, 4351, NT_STATUS(0xc000029d)}, + {ERRDOS, 4352, NT_STATUS(0xc000029e)}, + {ERRDOS, 1172, NT_STATUS(0xc000029f)}, + {ERRDOS, 8202, NT_STATUS(0xc00002a1)}, + {ERRDOS, 8203, NT_STATUS(0xc00002a2)}, + {ERRDOS, 8204, NT_STATUS(0xc00002a3)}, + {ERRDOS, 8205, NT_STATUS(0xc00002a4)}, + {ERRDOS, 8206, NT_STATUS(0xc00002a5)}, + {ERRDOS, 8207, NT_STATUS(0xc00002a6)}, + {ERRDOS, 8208, NT_STATUS(0xc00002a7)}, + {ERRDOS, 8209, NT_STATUS(0xc00002a8)}, + {ERRDOS, 8210, NT_STATUS(0xc00002a9)}, + {ERRDOS, 8211, NT_STATUS(0xc00002aa)}, + {ERRDOS, 8212, NT_STATUS(0xc00002ab)}, + {ERRDOS, 8213, NT_STATUS(0xc00002ac)}, + {ERRDOS, 8214, NT_STATUS(0xc00002ad)}, + {ERRDOS, 8215, NT_STATUS(0xc00002ae)}, + {ERRDOS, 8216, NT_STATUS(0xc00002af)}, + {ERRDOS, 8217, NT_STATUS(0xc00002b0)}, + {ERRDOS, 8478, NT_STATUS(0xc00002b1)}, + {ERRDOS, 4391, NT_STATUS(0xc00002b2)}, + {ERRDOS, 1617, NT_STATUS(0xc00002b6)}, + {ERRDOS, 1178, NT_STATUS(0xc00002b7)}, + {ERRDOS, 1179, NT_STATUS(0xc00002b8)}, + {ERRDOS, 8228, NT_STATUS(0xc00002c1)}, + {ERRDOS, 1397, NT_STATUS(0xc00002c3)}, + {ERRDOS, 998, NT_STATUS(0xc00002c5)}, + {ERRDOS, 4213, NT_STATUS(0xc00002c6)}, + {ERRDOS, 4214, NT_STATUS(0xc00002c7)}, + {ERRDOS, 4328, NT_STATUS(0xc00002ca)}, + {ERRDOS, 8504, NT_STATUS(0xc00002cb)}, + {ERRDOS, 1251, NT_STATUS(0xc00002cc)}, + {ERRDOS, 8505, NT_STATUS(0xc00002cd)}, + {ERRDOS, 1181, NT_STATUS(0xc00002cf)}, + {ERRDOS, 8506, NT_STATUS(0xc00002d0)}, + {ERRDOS, 8513, NT_STATUS(0xc00002d4)}, + {ERRDOS, 8514, NT_STATUS(0xc00002d5)}, + {ERRDOS, 8515, NT_STATUS(0xc00002d6)}, + {ERRDOS, 8516, NT_STATUS(0xc00002d7)}, + {ERRDOS, 8517, NT_STATUS(0xc00002d8)}, + {ERRDOS, 8518, NT_STATUS(0xc00002d9)}, + {ERRDOS, 8519, NT_STATUS(0xc00002da)}, + {ERRDOS, 8520, NT_STATUS(0xc00002db)}, + {ERRDOS, 8521, NT_STATUS(0xc00002dc)}, + {ERRDOS, ERRunsup, NT_STATUS(0xc00002dd)}, + {ERRDOS, 8529, NT_STATUS(0xc00002df)}, + {ERRDOS, 8530, NT_STATUS(0xc00002e0)}, + {ERRDOS, 8531, NT_STATUS(0xc00002e1)}, + {ERRDOS, 8532, NT_STATUS(0xc00002e2)}, + {ERRDOS, 8541, NT_STATUS(0xc00002e3)}, + {ERRDOS, 8547, NT_STATUS(0xc00002e4)}, + {ERRDOS, 8548, NT_STATUS(0xc00002e5)}, + {ERRDOS, 8549, NT_STATUS(0xc00002e6)}, + {ERRDOS, 8557, NT_STATUS(0xc00002e7)}, + {ERRDOS, 1115, NT_STATUS(0xc00002fe)}, + {ERRDOS, 1255, NT_STATUS(0xc00002ff)}, + {ERRDOS, 1254, NT_STATUS(0xc0000300)}, + {ERRDOS, ERRbadfunc, NT_STATUS(0x80000001)}, + {ERRDOS, 998, NT_STATUS(0x80000002)}, + {ERRDOS, ERRbadpath, NT_STATUS(0x80000003)}, + {ERRDOS, ERRnofids, NT_STATUS(0x80000004)}, + {ERRDOS, 111, NT_STATUS(0x80000005)}, + {ERRDOS, ERRnofiles, NT_STATUS(0x80000006)}, + {ERRDOS, 1391, NT_STATUS(0x8000000b)}, + {ERRDOS, 299, NT_STATUS(0x8000000d)}, + {ERRDOS, 28, NT_STATUS(0x8000000e)}, + {ERRDOS, 21, NT_STATUS(0x8000000f)}, + {ERRDOS, 21, NT_STATUS(0x80000010)}, + {ERRDOS, 170, NT_STATUS(0x80000011)}, + {ERRDOS, 259, NT_STATUS(0x80000012)}, + {ERRDOS, 254, NT_STATUS(0x80000013)}, + {ERRDOS, 275, NT_STATUS(0x80000014)}, + {ERRDOS, 275, NT_STATUS(0x80000015)}, + {ERRDOS, 1110, NT_STATUS(0x80000016)}, + {ERRDOS, 259, NT_STATUS_UNABLE_TO_FREE_VM}, + {ERRDOS, 1101, NT_STATUS(0x8000001b)}, + {ERRDOS, 1110, NT_STATUS(0x8000001c)}, + {ERRDOS, 1111, NT_STATUS(0x8000001d)}, + {ERRDOS, 1100, NT_STATUS(0x8000001e)}, + {ERRDOS, 1102, NT_STATUS(0x8000001f)}, + {ERRDOS, 1103, NT_STATUS(0x80000021)}, + {ERRDOS, 1104, NT_STATUS(0x80000022)}, + {ERRDOS, 2402, NT_STATUS(0x80000025)}, + {ERRDOS, 1165, NT_STATUS(0x80000288)}, + {ERRDOS, 1166, NT_STATUS(0x80000289)}, +}; + + +/* dos -> nt status error map */ +static struct { + uint8 dos_class; + uint32 dos_code; + NTSTATUS ntstatus; +} dos_to_ntstatus_map[] = { + {ERRDOS, ERRbadfunc, NT_STATUS_NOT_IMPLEMENTED}, + {ERRDOS, ERRbadfile, NT_STATUS_NO_SUCH_FILE}, + {ERRDOS, ERRbadpath, NT_STATUS_OBJECT_PATH_NOT_FOUND}, + {ERRDOS, ERRnofids, NT_STATUS_TOO_MANY_OPENED_FILES}, + {ERRDOS, ERRnoaccess, NT_STATUS_INVALID_LOCK_SEQUENCE}, + {ERRDOS, ERRbadfid, NT_STATUS_INVALID_HANDLE}, + {ERRDOS, ERRnomem, NT_STATUS_INSUFFICIENT_RESOURCES}, + {ERRDOS, ERRbadaccess, NT_STATUS_INVALID_LOCK_SEQUENCE}, + {ERRDOS, ERRbaddata, NT_STATUS_DATA_ERROR}, + {ERRDOS, 14, NT_STATUS_SECTION_NOT_EXTENDED}, + {ERRDOS, ERRremcd, NT_STATUS_DIRECTORY_NOT_EMPTY}, + {ERRDOS, ERRdiffdevice, NT_STATUS_NOT_SAME_DEVICE}, + {ERRDOS, ERRnofiles, NT_STATUS(0x80000006)}, + {ERRDOS, 19, NT_STATUS_MEDIA_WRITE_PROTECTED}, + {ERRDOS, 21, NT_STATUS_NO_MEDIA_IN_DEVICE}, + {ERRDOS, 22, NT_STATUS_INVALID_DEVICE_STATE}, + {ERRDOS, 23, NT_STATUS_DATA_ERROR}, + {ERRDOS, 24, NT_STATUS_DATA_ERROR}, + {ERRDOS, 26, NT_STATUS_DISK_CORRUPT_ERROR}, + {ERRDOS, 27, NT_STATUS_NONEXISTENT_SECTOR}, + {ERRDOS, 28, NT_STATUS(0x8000000e)}, + {ERRDOS, 31, NT_STATUS_UNSUCCESSFUL}, + {ERRDOS, ERRbadshare, NT_STATUS_SHARING_VIOLATION}, + {ERRDOS, ERRlock, NT_STATUS_FILE_LOCK_CONFLICT}, + {ERRDOS, 34, NT_STATUS_WRONG_VOLUME}, + {ERRDOS, 38, NT_STATUS_END_OF_FILE}, + {ERRDOS, ERRunsup, NT_STATUS_CTL_FILE_NOT_SUPPORTED}, + {ERRDOS, 51, NT_STATUS_REMOTE_NOT_LISTENING}, + {ERRDOS, 52, NT_STATUS_DUPLICATE_NAME}, + {ERRDOS, 53, NT_STATUS_BAD_NETWORK_PATH}, + {ERRDOS, 54, NT_STATUS_NETWORK_BUSY}, + {ERRDOS, 55, NT_STATUS_DEVICE_DOES_NOT_EXIST}, + {ERRDOS, 56, NT_STATUS_TOO_MANY_COMMANDS}, + {ERRDOS, 57, NT_STATUS_ADAPTER_HARDWARE_ERROR}, + {ERRDOS, 58, NT_STATUS_INVALID_NETWORK_RESPONSE}, + {ERRDOS, 59, NT_STATUS_UNEXPECTED_NETWORK_ERROR}, + {ERRDOS, 60, NT_STATUS_BAD_REMOTE_ADAPTER}, + {ERRDOS, 61, NT_STATUS_PRINT_QUEUE_FULL}, + {ERRDOS, 62, NT_STATUS_NO_SPOOL_SPACE}, + {ERRDOS, 63, NT_STATUS_PRINT_CANCELLED}, + {ERRDOS, 64, NT_STATUS_NETWORK_NAME_DELETED}, + {ERRDOS, 65, NT_STATUS_NETWORK_ACCESS_DENIED}, + {ERRDOS, 66, NT_STATUS_BAD_DEVICE_TYPE}, + {ERRDOS, ERRnosuchshare, NT_STATUS_BAD_NETWORK_NAME}, + {ERRDOS, 68, NT_STATUS_TOO_MANY_GUIDS_REQUESTED}, + {ERRDOS, 69, NT_STATUS_TOO_MANY_SESSIONS}, + {ERRDOS, 70, NT_STATUS_SHARING_PAUSED}, + {ERRDOS, 71, NT_STATUS_REQUEST_NOT_ACCEPTED}, + {ERRDOS, 72, NT_STATUS_REDIRECTOR_PAUSED}, + {ERRDOS, ERRfilexists, NT_STATUS_OBJECT_NAME_COLLISION}, + {ERRDOS, 86, NT_STATUS_WRONG_PASSWORD}, + {ERRDOS, 87, NT_STATUS_INVALID_INFO_CLASS}, + {ERRDOS, 88, NT_STATUS_NET_WRITE_FAULT}, + {ERRDOS, 109, NT_STATUS_PIPE_BROKEN}, + {ERRDOS, 111, STATUS_MORE_ENTRIES}, + {ERRDOS, 112, NT_STATUS_DISK_FULL}, + {ERRDOS, 121, NT_STATUS_IO_TIMEOUT}, + {ERRDOS, 122, NT_STATUS_BUFFER_TOO_SMALL}, + {ERRDOS, ERRinvalidname, NT_STATUS_OBJECT_NAME_INVALID}, + {ERRDOS, 124, NT_STATUS_INVALID_LEVEL}, + {ERRDOS, 126, NT_STATUS_DLL_NOT_FOUND}, + {ERRDOS, 127, NT_STATUS_PROCEDURE_NOT_FOUND}, + {ERRDOS, 145, NT_STATUS_DIRECTORY_NOT_EMPTY}, + {ERRDOS, 154, NT_STATUS_INVALID_VOLUME_LABEL}, + {ERRDOS, 156, NT_STATUS_SUSPEND_COUNT_EXCEEDED}, + {ERRDOS, 158, NT_STATUS_NOT_LOCKED}, + {ERRDOS, 161, NT_STATUS_OBJECT_PATH_INVALID}, + {ERRDOS, 170, NT_STATUS(0x80000011)}, + {ERRDOS, 182, NT_STATUS_ORDINAL_NOT_FOUND}, + {ERRDOS, 183, NT_STATUS_OBJECT_NAME_COLLISION}, + {ERRDOS, 193, NT_STATUS_BAD_INITIAL_PC}, + {ERRDOS, 203, NT_STATUS(0xc0000100)}, + {ERRDOS, 206, NT_STATUS_NAME_TOO_LONG}, + {ERRDOS, ERRbadpipe, NT_STATUS_INVALID_INFO_CLASS}, + {ERRDOS, ERRpipebusy, NT_STATUS_INSTANCE_NOT_AVAILABLE}, + {ERRDOS, ERRpipeclosing, NT_STATUS_PIPE_CLOSING}, + {ERRDOS, ERRnotconnected, NT_STATUS_PIPE_DISCONNECTED}, + {ERRDOS, ERRmoredata, STATUS_MORE_ENTRIES}, + {ERRDOS, 240, NT_STATUS_VIRTUAL_CIRCUIT_CLOSED}, + {ERRDOS, 254, NT_STATUS(0x80000013)}, + {ERRDOS, 255, NT_STATUS_EA_TOO_LARGE}, + {ERRDOS, 259, NT_STATUS_GUIDS_EXHAUSTED}, + {ERRDOS, 267, NT_STATUS_NOT_A_DIRECTORY}, + {ERRDOS, 275, NT_STATUS_EA_TOO_LARGE}, + {ERRDOS, 276, NT_STATUS_NONEXISTENT_EA_ENTRY}, + {ERRDOS, 277, NT_STATUS_NONEXISTENT_EA_ENTRY}, + {ERRDOS, 278, NT_STATUS_NONEXISTENT_EA_ENTRY}, + {ERRDOS, 282, NT_STATUS_EAS_NOT_SUPPORTED}, + {ERRDOS, 288, NT_STATUS_MUTANT_NOT_OWNED}, + {ERRDOS, 298, NT_STATUS_SEMAPHORE_LIMIT_EXCEEDED}, + {ERRDOS, 299, NT_STATUS(0x8000000d)}, + {ERRDOS, 300, NT_STATUS_OPLOCK_NOT_GRANTED}, + {ERRDOS, 301, NT_STATUS_INVALID_OPLOCK_PROTOCOL}, + {ERRDOS, 487, NT_STATUS_CONFLICTING_ADDRESSES}, + {ERRDOS, 534, NT_STATUS_INTEGER_OVERFLOW}, + {ERRDOS, 535, NT_STATUS_PIPE_CONNECTED}, + {ERRDOS, 536, NT_STATUS_PIPE_LISTENING}, + {ERRDOS, 995, NT_STATUS_CANCELLED}, + {ERRDOS, 997, NT_STATUS(0x00000103)}, + {ERRDOS, 998, NT_STATUS_ACCESS_VIOLATION}, + {ERRDOS, 999, NT_STATUS_IN_PAGE_ERROR}, + {ERRDOS, 1001, NT_STATUS_BAD_INITIAL_STACK}, + {ERRDOS, 1005, NT_STATUS_UNRECOGNIZED_VOLUME}, + {ERRDOS, 1006, NT_STATUS_FILE_INVALID}, + {ERRDOS, 1007, NT_STATUS_FULLSCREEN_MODE}, + {ERRDOS, 1008, NT_STATUS_NO_TOKEN}, + {ERRDOS, 1009, NT_STATUS_REGISTRY_CORRUPT}, + {ERRDOS, 1016, NT_STATUS_REGISTRY_IO_FAILED}, + {ERRDOS, 1017, NT_STATUS_NOT_REGISTRY_FILE}, + {ERRDOS, 1018, NT_STATUS_KEY_DELETED}, + {ERRDOS, 1019, NT_STATUS_NO_LOG_SPACE}, + {ERRDOS, 1020, NT_STATUS_KEY_HAS_CHILDREN}, + {ERRDOS, 1021, NT_STATUS_CHILD_MUST_BE_VOLATILE}, + {ERRDOS, 1022, NT_STATUS(0x0000010c)}, + {ERRSRV, ERRbadpw, NT_STATUS_WRONG_PASSWORD}, + {ERRSRV, ERRbadtype, NT_STATUS_BAD_DEVICE_TYPE}, + {ERRSRV, ERRaccess, NT_STATUS_NETWORK_ACCESS_DENIED}, + {ERRSRV, ERRinvnid, NT_STATUS_NETWORK_NAME_DELETED}, + {ERRSRV, ERRinvnetname, NT_STATUS_BAD_NETWORK_NAME}, + {ERRSRV, ERRinvdevice, NT_STATUS_BAD_DEVICE_TYPE}, + {ERRSRV, ERRqfull, NT_STATUS_PRINT_QUEUE_FULL}, + {ERRSRV, ERRqtoobig, NT_STATUS_NO_SPOOL_SPACE}, + {ERRSRV, ERRinvpfid, NT_STATUS_PRINT_CANCELLED}, + {ERRSRV, ERRsmbcmd, NT_STATUS_NOT_IMPLEMENTED}, + {ERRSRV, ERRbadpermits, NT_STATUS_NETWORK_ACCESS_DENIED}, + {ERRSRV, ERRpaused, NT_STATUS_SHARING_PAUSED}, + {ERRSRV, ERRmsgoff, NT_STATUS_REQUEST_NOT_ACCEPTED}, + {ERRSRV, ERRnoroom, NT_STATUS_DISK_FULL}, + {ERRSRV, ERRnoresource, NT_STATUS_REQUEST_NOT_ACCEPTED}, + {ERRSRV, ERRtoomanyuids, NT_STATUS_TOO_MANY_SESSIONS}, + {ERRSRV, 123, NT_STATUS_OBJECT_NAME_INVALID}, + {ERRSRV, 206, NT_STATUS_OBJECT_NAME_INVALID}, + {ERRHRD, 1, NT_STATUS_NOT_IMPLEMENTED}, + {ERRHRD, 2, NT_STATUS_NO_SUCH_DEVICE}, + {ERRHRD, 3, NT_STATUS_OBJECT_PATH_NOT_FOUND}, + {ERRHRD, 4, NT_STATUS_TOO_MANY_OPENED_FILES}, + {ERRHRD, 5, NT_STATUS_INVALID_LOCK_SEQUENCE}, + {ERRHRD, 6, NT_STATUS_INVALID_HANDLE}, + {ERRHRD, 8, NT_STATUS_INSUFFICIENT_RESOURCES}, + {ERRHRD, 12, NT_STATUS_INVALID_LOCK_SEQUENCE}, + {ERRHRD, 13, NT_STATUS_DATA_ERROR}, + {ERRHRD, 14, NT_STATUS_SECTION_NOT_EXTENDED}, + {ERRHRD, 16, NT_STATUS_DIRECTORY_NOT_EMPTY}, + {ERRHRD, 17, NT_STATUS_NOT_SAME_DEVICE}, + {ERRHRD, 18, NT_STATUS(0x80000006)}, + {ERRHRD, ERRnowrite, NT_STATUS_MEDIA_WRITE_PROTECTED}, + {ERRHRD, ERRnotready, NT_STATUS_NO_MEDIA_IN_DEVICE}, + {ERRHRD, ERRbadcmd, NT_STATUS_INVALID_DEVICE_STATE}, + {ERRHRD, ERRdata, NT_STATUS_DATA_ERROR}, + {ERRHRD, ERRbadreq, NT_STATUS_DATA_ERROR}, + {ERRHRD, ERRbadmedia, NT_STATUS_DISK_CORRUPT_ERROR}, + {ERRHRD, ERRbadsector, NT_STATUS_NONEXISTENT_SECTOR}, + {ERRHRD, ERRnopaper, NT_STATUS(0x8000000e)}, + {ERRHRD, ERRgeneral, NT_STATUS_UNSUCCESSFUL}, + {ERRHRD, ERRbadshare, NT_STATUS_SHARING_VIOLATION}, + {ERRHRD, ERRlock, NT_STATUS_FILE_LOCK_CONFLICT}, + {ERRHRD, ERRwrongdisk, NT_STATUS_WRONG_VOLUME}, + {ERRHRD, 38, NT_STATUS_END_OF_FILE}, + {ERRHRD, 50, NT_STATUS_CTL_FILE_NOT_SUPPORTED}, + {ERRHRD, 51, NT_STATUS_REMOTE_NOT_LISTENING}, + {ERRHRD, 52, NT_STATUS_DUPLICATE_NAME}, + {ERRHRD, 53, NT_STATUS_BAD_NETWORK_PATH}, + {ERRHRD, 54, NT_STATUS_NETWORK_BUSY}, + {ERRHRD, 55, NT_STATUS_DEVICE_DOES_NOT_EXIST}, + {ERRHRD, 56, NT_STATUS_TOO_MANY_COMMANDS}, + {ERRHRD, 57, NT_STATUS_ADAPTER_HARDWARE_ERROR}, + {ERRHRD, 58, NT_STATUS_INVALID_NETWORK_RESPONSE}, + {ERRHRD, 59, NT_STATUS_UNEXPECTED_NETWORK_ERROR}, + {ERRHRD, 60, NT_STATUS_BAD_REMOTE_ADAPTER}, + {ERRHRD, 61, NT_STATUS_PRINT_QUEUE_FULL}, + {ERRHRD, 62, NT_STATUS_NO_SPOOL_SPACE}, + {ERRHRD, 63, NT_STATUS_PRINT_CANCELLED}, + {ERRHRD, 64, NT_STATUS_NETWORK_NAME_DELETED}, + {ERRHRD, 65, NT_STATUS_NETWORK_ACCESS_DENIED}, + {ERRHRD, 66, NT_STATUS_BAD_DEVICE_TYPE}, + {ERRHRD, 67, NT_STATUS_BAD_NETWORK_NAME}, + {ERRHRD, 68, NT_STATUS_TOO_MANY_GUIDS_REQUESTED}, + {ERRHRD, 69, NT_STATUS_TOO_MANY_SESSIONS}, + {ERRHRD, 70, NT_STATUS_SHARING_PAUSED}, + {ERRHRD, 71, NT_STATUS_REQUEST_NOT_ACCEPTED}, + {ERRHRD, 72, NT_STATUS_REDIRECTOR_PAUSED}, + {ERRHRD, 80, NT_STATUS_OBJECT_NAME_COLLISION}, + {ERRHRD, 86, NT_STATUS_WRONG_PASSWORD}, + {ERRHRD, 87, NT_STATUS_INVALID_INFO_CLASS}, + {ERRHRD, 88, NT_STATUS_NET_WRITE_FAULT}, + {ERRHRD, 109, NT_STATUS_PIPE_BROKEN}, + {ERRHRD, 111, STATUS_MORE_ENTRIES}, + {ERRHRD, 112, NT_STATUS_DISK_FULL}, + {ERRHRD, 121, NT_STATUS_IO_TIMEOUT}, + {ERRHRD, 122, NT_STATUS_BUFFER_TOO_SMALL}, + {ERRHRD, 123, NT_STATUS_OBJECT_NAME_INVALID}, + {ERRHRD, 124, NT_STATUS_INVALID_LEVEL}, + {ERRHRD, 126, NT_STATUS_DLL_NOT_FOUND}, + {ERRHRD, 127, NT_STATUS_PROCEDURE_NOT_FOUND}, + {ERRHRD, 145, NT_STATUS_DIRECTORY_NOT_EMPTY}, + {ERRHRD, 154, NT_STATUS_INVALID_VOLUME_LABEL}, + {ERRHRD, 156, NT_STATUS_SUSPEND_COUNT_EXCEEDED}, + {ERRHRD, 158, NT_STATUS_NOT_LOCKED}, + {ERRHRD, 161, NT_STATUS_OBJECT_PATH_INVALID}, + {ERRHRD, 170, NT_STATUS(0x80000011)}, + {ERRHRD, 182, NT_STATUS_ORDINAL_NOT_FOUND}, + {ERRHRD, 183, NT_STATUS_OBJECT_NAME_COLLISION}, + {ERRHRD, 193, NT_STATUS_BAD_INITIAL_PC}, + {ERRHRD, 203, NT_STATUS(0xc0000100)}, + {ERRHRD, 206, NT_STATUS_NAME_TOO_LONG}, + {ERRHRD, 230, NT_STATUS_INVALID_INFO_CLASS}, + {ERRHRD, 231, NT_STATUS_INSTANCE_NOT_AVAILABLE}, + {ERRHRD, 232, NT_STATUS_PIPE_CLOSING}, + {ERRHRD, 233, NT_STATUS_PIPE_DISCONNECTED}, + {ERRHRD, 234, STATUS_MORE_ENTRIES}, + {ERRHRD, 240, NT_STATUS_VIRTUAL_CIRCUIT_CLOSED}, + {ERRHRD, 254, NT_STATUS(0x80000013)}, + {ERRHRD, 255, NT_STATUS_EA_TOO_LARGE}, + {ERRHRD, 259, NT_STATUS_GUIDS_EXHAUSTED}, + {ERRHRD, 267, NT_STATUS_NOT_A_DIRECTORY}, + {ERRHRD, 275, NT_STATUS_EA_TOO_LARGE}, + {ERRHRD, 276, NT_STATUS_NONEXISTENT_EA_ENTRY}, + {ERRHRD, 277, NT_STATUS_NONEXISTENT_EA_ENTRY}, + {ERRHRD, 278, NT_STATUS_NONEXISTENT_EA_ENTRY}, + {ERRHRD, 282, NT_STATUS_EAS_NOT_SUPPORTED}, + {ERRHRD, 288, NT_STATUS_MUTANT_NOT_OWNED}, + {ERRHRD, 298, NT_STATUS_SEMAPHORE_LIMIT_EXCEEDED}, + {ERRHRD, 299, NT_STATUS(0x8000000d)}, + {ERRHRD, 300, NT_STATUS_OPLOCK_NOT_GRANTED}, + {ERRHRD, 301, NT_STATUS_INVALID_OPLOCK_PROTOCOL}, + {ERRHRD, 487, NT_STATUS_CONFLICTING_ADDRESSES}, + {ERRHRD, 534, NT_STATUS_INTEGER_OVERFLOW}, + {ERRHRD, 535, NT_STATUS_PIPE_CONNECTED}, + {ERRHRD, 536, NT_STATUS_PIPE_LISTENING}, + {ERRHRD, 995, NT_STATUS_CANCELLED}, + {ERRHRD, 997, NT_STATUS(0x00000103)}, + {ERRHRD, 998, NT_STATUS_ACCESS_VIOLATION}, + {ERRHRD, 999, NT_STATUS_IN_PAGE_ERROR}, + {ERRHRD, 1001, NT_STATUS_BAD_INITIAL_STACK}, + {ERRHRD, 1005, NT_STATUS_UNRECOGNIZED_VOLUME}, + {ERRHRD, 1006, NT_STATUS_FILE_INVALID}, + {ERRHRD, 1007, NT_STATUS_FULLSCREEN_MODE}, + {ERRHRD, 1008, NT_STATUS_NO_TOKEN}, + {ERRHRD, 1009, NT_STATUS_REGISTRY_CORRUPT}, + {ERRHRD, 1016, NT_STATUS_REGISTRY_IO_FAILED}, + {ERRHRD, 1017, NT_STATUS_NOT_REGISTRY_FILE}, + {ERRHRD, 1018, NT_STATUS_KEY_DELETED}, + {ERRHRD, 1019, NT_STATUS_NO_LOG_SPACE}, + {ERRHRD, 1020, NT_STATUS_KEY_HAS_CHILDREN}, + {ERRHRD, 1021, NT_STATUS_CHILD_MUST_BE_VOLATILE}, + {ERRHRD, 1022, NT_STATUS(0x0000010c)}, +}; + + +/***************************************************************************** +convert a dos eclas/ecode to a NT status32 code + *****************************************************************************/ +NTSTATUS dos_to_ntstatus(int eclass, int ecode) +{ + int i; + for (i=0; NT_STATUS_V(dos_to_ntstatus_map[i].ntstatus); i++) { + if (eclass == dos_to_ntstatus_map[i].dos_class && + ecode == dos_to_ntstatus_map[i].dos_code) { + return dos_to_ntstatus_map[i].ntstatus; + } + } + return NT_STATUS_UNSUCCESSFUL; +} + + +/***************************************************************************** +convert a NT status code to a dos class/code + *****************************************************************************/ +void ntstatus_to_dos(NTSTATUS ntstatus, uint8 *eclass, uint32 *ecode) +{ + int i; + for (i=0; NT_STATUS_V(ntstatus_to_dos_map[i].ntstatus); i++) { + if (NT_STATUS_V(ntstatus) == + NT_STATUS_V(ntstatus_to_dos_map[i].ntstatus)) { + *eclass = ntstatus_to_dos_map[i].dos_class; + *ecode = ntstatus_to_dos_map[i].dos_code; + return; + } + } + *eclass = ERRSRV; + *ecode = ERRerror; +} diff --git a/source/libsmb/nterr.c b/source/libsmb/nterr.c index 1b8e8737f7a..7fdeb4e5a7c 100644 --- a/source/libsmb/nterr.c +++ b/source/libsmb/nterr.c @@ -26,8 +26,7 @@ typedef struct { char *nt_errstr; - uint32 nt_errcode; - + NTSTATUS nt_errcode; } nt_err_code_struct; nt_err_code_struct nt_errs[] = @@ -534,22 +533,22 @@ nt_err_code_struct nt_errs[] = { "NT_STATUS_TOO_MANY_LINKS", NT_STATUS_TOO_MANY_LINKS }, { "NT_STATUS_QUOTA_LIST_INCONSISTENT", NT_STATUS_QUOTA_LIST_INCONSISTENT }, { "NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE }, - { NULL, 0 } + { NULL, NT_STATUS(0) } }; /***************************************************************************** returns an NT error message. not amazingly helpful, but better than a number. *****************************************************************************/ -char *get_nt_error_msg(uint32 nt_code) +char *get_nt_error_msg(NTSTATUS nt_code) { static pstring msg; int idx = 0; - slprintf(msg, sizeof(msg), "NT code 0x%08x", nt_code); + slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code)); while (nt_errs[idx].nt_errstr != NULL) { - if ((nt_errs[idx].nt_errcode & 0xFFFFFF) == - (nt_code & 0xFFFFFF)) { + if ((NT_STATUS_V(nt_errs[idx].nt_errcode) & 0xFFFFFF) == + (NT_STATUS_V(nt_code) & 0xFFFFFF)) { return nt_errs[idx].nt_errstr; } idx++; |