2003-08-13 05:53:07 +04:00
/*
* Unix SMB / CIFS implementation .
* DOS error routines
* Copyright ( C ) Tim Potter 2002.
*
* 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 06:46:15 +04:00
* the Free Software Foundation ; either version 3 of the License , or
2003-08-13 05:53:07 +04:00
* ( 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
2007-07-10 09:23:25 +04:00
* along with this program ; if not , see < http : //www.gnu.org/licenses/>.
2003-08-13 05:53:07 +04:00
*/
/* DOS error codes. please read doserr.h */
# include "includes.h"
2004-08-30 09:33:49 +04:00
struct werror_code_struct {
2003-08-13 05:53:07 +04:00
const char * dos_errstr ;
WERROR werror ;
2004-08-30 09:33:49 +04:00
} ;
2003-08-13 05:53:07 +04:00
2004-08-30 09:33:49 +04:00
static const struct werror_code_struct dos_errs [ ] =
2003-08-13 05:53:07 +04:00
{
{ " WERR_OK " , WERR_OK } ,
{ " WERR_BADFILE " , WERR_BADFILE } ,
{ " WERR_ACCESS_DENIED " , WERR_ACCESS_DENIED } ,
{ " WERR_BADFID " , WERR_BADFID } ,
{ " WERR_BADFUNC " , WERR_BADFUNC } ,
2003-11-17 14:55:56 +03:00
{ " WERR_BAD_NETPATH " , WERR_BAD_NETPATH } ,
2006-12-08 21:01:30 +03:00
{ " WERR_BAD_NET_RESP " , WERR_BAD_NET_RESP } ,
2006-09-19 00:44:54 +04:00
{ " WERR_UNEXP_NET_ERR " , WERR_UNEXP_NET_ERR } ,
2003-08-13 05:53:07 +04:00
{ " WERR_INSUFFICIENT_BUFFER " , WERR_INSUFFICIENT_BUFFER } ,
2008-11-01 19:28:16 +03:00
{ " WERR_SEM_TIMEOUT " , WERR_SEM_TIMEOUT } ,
2003-08-13 05:53:07 +04:00
{ " WERR_NO_SUCH_SHARE " , WERR_NO_SUCH_SHARE } ,
2006-09-19 00:44:54 +04:00
{ " WERR_FILE_EXISTS " , WERR_FILE_EXISTS } ,
2003-08-13 05:53:07 +04:00
{ " WERR_INVALID_PARAM " , WERR_INVALID_PARAM } ,
{ " WERR_NOT_SUPPORTED " , WERR_NOT_SUPPORTED } ,
2007-11-27 01:58:39 +03:00
{ " WERR_DUP_NAME " , WERR_DUP_NAME } ,
2003-08-13 05:53:07 +04:00
{ " WERR_BAD_PASSWORD " , WERR_BAD_PASSWORD } ,
{ " WERR_NOMEM " , WERR_NOMEM } ,
{ " WERR_INVALID_NAME " , WERR_INVALID_NAME } ,
{ " WERR_UNKNOWN_LEVEL " , WERR_UNKNOWN_LEVEL } ,
{ " WERR_OBJECT_PATH_INVALID " , WERR_OBJECT_PATH_INVALID } ,
2006-09-19 00:44:54 +04:00
{ " WERR_ALREADY_EXISTS " , WERR_ALREADY_EXISTS } ,
2003-08-13 05:53:07 +04:00
{ " WERR_NO_MORE_ITEMS " , WERR_NO_MORE_ITEMS } ,
{ " WERR_MORE_DATA " , WERR_MORE_DATA } ,
{ " WERR_UNKNOWN_PRINTER_DRIVER " , WERR_UNKNOWN_PRINTER_DRIVER } ,
2009-07-02 00:52:05 +04:00
{ " WERR_UNKNOWN_PRINTPROCESSOR " , WERR_UNKNOWN_PRINTPROCESSOR } ,
{ " WERR_INVALID_SEPARATOR_FILE " , WERR_INVALID_SEPARATOR_FILE } ,
{ " WERR_INVALID_PRIORITY " , WERR_INVALID_PRIORITY } ,
{ " WERR_UNKNOWN_PORT " , WERR_UNKNOWN_PORT } ,
2003-08-13 05:53:07 +04:00
{ " WERR_INVALID_PRINTER_NAME " , WERR_INVALID_PRINTER_NAME } ,
{ " WERR_PRINTER_ALREADY_EXISTS " , WERR_PRINTER_ALREADY_EXISTS } ,
{ " WERR_INVALID_DATATYPE " , WERR_INVALID_DATATYPE } ,
{ " WERR_INVALID_ENVIRONMENT " , WERR_INVALID_ENVIRONMENT } ,
{ " WERR_INVALID_FORM_NAME " , WERR_INVALID_FORM_NAME } ,
{ " WERR_INVALID_FORM_SIZE " , WERR_INVALID_FORM_SIZE } ,
2006-09-19 00:44:54 +04:00
{ " WERR_ALREADY_SHARED " , WERR_ALREADY_SHARED } ,
2003-08-13 05:53:07 +04:00
{ " WERR_BUF_TOO_SMALL " , WERR_BUF_TOO_SMALL } ,
{ " WERR_JOB_NOT_FOUND " , WERR_JOB_NOT_FOUND } ,
{ " WERR_DEST_NOT_FOUND " , WERR_DEST_NOT_FOUND } ,
2009-09-18 01:20:23 +04:00
{ " WERR_GROUPNOTFOUND " , WERR_GROUPNOTFOUND } ,
2008-11-01 19:28:16 +03:00
{ " WERR_USER_NOT_FOUND " , WERR_USER_NOT_FOUND } ,
2003-08-13 05:53:07 +04:00
{ " WERR_NOT_LOCAL_DOMAIN " , WERR_NOT_LOCAL_DOMAIN } ,
2007-06-08 14:32:29 +04:00
{ " WERR_DOMAIN_CONTROLLER_NOT_FOUND " , WERR_DOMAIN_CONTROLLER_NOT_FOUND } ,
2007-11-27 01:58:39 +03:00
{ " WERR_TIME_DIFF_AT_DC " , WERR_TIME_DIFF_AT_DC } ,
2007-11-20 14:43:11 +03:00
{ " WERR_SETUP_NOT_JOINED " , WERR_SETUP_NOT_JOINED } ,
{ " WERR_SETUP_ALREADY_JOINED " , WERR_SETUP_ALREADY_JOINED } ,
{ " WERR_SETUP_DOMAIN_CONTROLLER " , WERR_SETUP_DOMAIN_CONTROLLER } ,
2006-09-19 00:44:54 +04:00
{ " WERR_DEVICE_NOT_AVAILABLE " , WERR_DEVICE_NOT_AVAILABLE } ,
2008-11-01 19:28:16 +03:00
{ " WERR_DEFAULT_JOIN_REQUIRED " , WERR_DEFAULT_JOIN_REQUIRED } ,
2009-09-18 01:00:21 +04:00
{ " WERR_USEREXISTS " , WERR_USEREXISTS } ,
2008-11-01 19:28:16 +03:00
{ " WERR_REVISION_MISMATCH " , WERR_REVISION_MISMATCH } ,
{ " WERR_NO_LOGON_SERVERS " , WERR_NO_LOGON_SERVERS } ,
{ " WERR_NO_SUCH_LOGON_SESSION " , WERR_NO_SUCH_LOGON_SESSION } ,
{ " WERR_USER_ALREADY_EXISTS " , WERR_USER_ALREADY_EXISTS } ,
{ " WERR_NO_SUCH_USER " , WERR_NO_SUCH_USER } ,
{ " WERR_GROUP_EXISTS " , WERR_GROUP_EXISTS } ,
2009-05-05 21:38:58 +04:00
{ " WERR_NO_SUCH_GROUP " , WERR_NO_SUCH_GROUP } ,
2008-11-01 19:28:16 +03:00
{ " WERR_MEMBER_IN_GROUP " , WERR_MEMBER_IN_GROUP } ,
{ " WERR_USER_NOT_IN_GROUP " , WERR_USER_NOT_IN_GROUP } ,
2003-08-13 05:53:07 +04:00
{ " WERR_PRINTER_DRIVER_IN_USE " , WERR_PRINTER_DRIVER_IN_USE } ,
2004-12-31 07:45:13 +03:00
{ " WERR_STATUS_MORE_ENTRIES " , WERR_STATUS_MORE_ENTRIES } ,
{ " WERR_NET_NAME_NOT_FOUND " , WERR_NET_NAME_NOT_FOUND } ,
2004-12-31 10:21:31 +03:00
{ " WERR_DEVICE_NOT_SHARED " , WERR_DEVICE_NOT_SHARED } ,
2003-08-13 05:53:07 +04:00
{ " WERR_DFS_NO_SUCH_VOL " , WERR_DFS_NO_SUCH_VOL } ,
{ " WERR_DFS_NO_SUCH_SHARE " , WERR_DFS_NO_SUCH_SHARE } ,
{ " WERR_DFS_NO_SUCH_SERVER " , WERR_DFS_NO_SUCH_SERVER } ,
{ " WERR_DFS_INTERNAL_ERROR " , WERR_DFS_INTERNAL_ERROR } ,
{ " WERR_DFS_CANT_CREATE_JUNCT " , WERR_DFS_CANT_CREATE_JUNCT } ,
2007-02-28 20:19:35 +03:00
{ " WERR_LOGON_FAILURE " , WERR_LOGON_FAILURE } ,
2003-08-13 05:53:07 +04:00
{ " WERR_INVALID_SECURITY_DESCRIPTOR " , WERR_INVALID_SECURITY_DESCRIPTOR } ,
2007-08-03 12:25:15 +04:00
{ " WERR_INVALID_DOMAIN_ROLE " , WERR_INVALID_DOMAIN_ROLE } ,
2005-10-10 15:21:02 +04:00
{ " WERR_UNKNOWN_REVISION " , WERR_UNKNOWN_REVISION } ,
2005-08-23 15:40:26 +04:00
{ " WERR_REVISION_MISMATCH " , WERR_REVISION_MISMATCH } ,
2003-08-13 05:53:07 +04:00
{ " WERR_INVALID_OWNER " , WERR_INVALID_OWNER } ,
2009-05-05 21:38:58 +04:00
{ " WERR_INVALID_PRIMARY_GROUP " , WERR_INVALID_PRIMARY_GROUP } ,
2005-10-31 05:46:15 +03:00
{ " WERR_INVALID_COMPUTERNAME " , WERR_INVALID_COMPUTERNAME } ,
2004-11-22 17:28:09 +03:00
{ " WERR_INVALID_DOMAINNAME " , WERR_INVALID_DOMAINNAME } ,
2008-11-01 19:28:16 +03:00
{ " WERR_MACHINE_LOCKED " , WERR_MACHINE_LOCKED } ,
2009-09-18 01:46:52 +04:00
{ " WERR_DCNOTFOUND " , WERR_DCNOTFOUND } ,
2006-10-07 09:28:14 +04:00
{ " WERR_NO_LOGON_SERVERS " , WERR_NO_LOGON_SERVERS } ,
2007-11-27 01:58:39 +03:00
{ " WERR_NO_SUCH_LOGON_SESSION " , WERR_NO_SUCH_LOGON_SESSION } ,
2006-05-21 16:57:36 +04:00
{ " WERR_NO_SUCH_PRIVILEGE " , WERR_NO_SUCH_PRIVILEGE } ,
{ " WERR_PRIVILEGE_NOT_HELD " , WERR_PRIVILEGE_NOT_HELD } ,
2004-11-22 17:28:09 +03:00
{ " WERR_NO_SUCH_USER " , WERR_NO_SUCH_USER } ,
{ " WERR_NO_SUCH_DOMAIN " , WERR_NO_SUCH_DOMAIN } ,
2006-09-23 23:04:39 +04:00
{ " WERR_NO_SYSTEM_RESOURCES " , WERR_NO_SYSTEM_RESOURCES } ,
2009-07-30 14:40:14 +04:00
{ " WERR_DS_NO_ATTRIBUTE_OR_VALUE " , WERR_DS_NO_ATTRIBUTE_OR_VALUE } ,
{ " WERR_DS_INVALID_ATTRIBUTE_SYNTAX " , WERR_DS_INVALID_ATTRIBUTE_SYNTAX } ,
{ " WERR_DS_ATTRIBUTE_TYPE_UNDEFINED " , WERR_DS_ATTRIBUTE_TYPE_UNDEFINED } ,
{ " WERR_DS_ATTRIBUTE_OR_VALUE_EXISTS " , WERR_DS_ATTRIBUTE_OR_VALUE_EXISTS } ,
{ " WERR_DS_BUSY " , WERR_DS_BUSY } ,
{ " WERR_DS_UNAVAILABLE " , WERR_DS_UNAVAILABLE } ,
{ " WERR_DS_OBJ_CLASS_VIOLATION " , WERR_DS_OBJ_CLASS_VIOLATION } ,
{ " WERR_DS_CANT_ON_NON_LEAF " , WERR_DS_CANT_ON_NON_LEAF } ,
{ " WERR_DS_CANT_ON_RDN " , WERR_DS_CANT_ON_RDN } ,
{ " WERR_DS_CANT_MOD_OBJ_CLASS " , WERR_DS_CANT_MOD_OBJ_CLASS } ,
{ " WERR_DS_OPERATIONS_ERROR " , WERR_DS_OPERATIONS_ERROR } ,
{ " WERR_DS_PROTOCOL_ERROR " , WERR_DS_PROTOCOL_ERROR } ,
{ " WERR_DS_TIMELIMIT_EXCEEEDED " , WERR_DS_TIMELIMIT_EXCEEDED } ,
{ " WERR_DS_SIZE_LIMIT_EXCEEDED " , WERR_DS_SIZE_LIMIT_EXCEEDED } ,
{ " WERR_DS_ADMIN_LIMIT_EXCEEEDED " , WERR_DS_ADMIN_LIMIT_EXCEEDED } ,
{ " WERR_DS_COMPARE_FALSE " , WERR_DS_COMPARE_FALSE } ,
{ " WERR_DS_COMPARE_TRUE " , WERR_DS_COMPARE_TRUE } ,
{ " WERR_DS_AUTH_METHOD_NOT_SUPPORTED " , WERR_DS_AUTH_METHOD_NOT_SUPPORTED } ,
{ " WERR_DS_STRONG_AUTH_REQUIRED " , WERR_DS_STRONG_AUTH_REQUIRED } ,
{ " WERR_DS_INAPPROPRIATE_AUTH " , WERR_DS_INAPPROPRIATE_AUTH } ,
{ " WERR_DS_REFERRAL " , WERR_DS_REFERRAL } ,
{ " WERR_DS_UNAVAILABLE_CRIT_EXTENSION " , WERR_DS_UNAVAILABLE_CRIT_EXTENSION } ,
{ " WERR_DS_CONFIDENTIALITY_REQUIRED " , WERR_DS_CONFIDENTIALITY_REQUIRED } ,
{ " WERR_DS_INAPPROPRIATE_MATCHING " , WERR_DS_INAPPROPRIATE_MATCHING } ,
{ " WERR_DS_CONSTRAINT_VIOLATION " , WERR_DS_CONSTRAINT_VIOLATION } ,
2004-11-22 17:28:09 +03:00
{ " WERR_DS_NO_SUCH_OBJECT " , WERR_DS_NO_SUCH_OBJECT } ,
2009-07-30 14:40:14 +04:00
{ " WERR_DS_ALIAS_PROBLEM " , WERR_DS_ALIAS_PROBLEM } ,
{ " WERR_DS_INVALID_DN_SYNTAX " , WERR_DS_INVALID_DN_SYNTAX } ,
{ " WERR_DS_ALIAS_DEREF_PROBLEM " , WERR_DS_ALIAS_DEREF_PROBLEM } ,
{ " WERR_DS_UNWILLING_TO_PERFORM " , WERR_DS_UNWILLING_TO_PERFORM } ,
{ " WERR_DS_LOOP_DETECT " , WERR_DS_LOOP_DETECT } ,
{ " WERR_DS_NAMING_VIOLATION " , WERR_DS_NAMING_VIOLATION } ,
{ " WERR_DS_AFFECTS_MULTIPLE_DSAS " , WERR_DS_AFFECTS_MULTIPLE_DSAS } ,
{ " WERR_DS_OBJ_STRING_NAME_EXISTS " , WERR_DS_OBJ_STRING_NAME_EXISTS } ,
2004-10-18 19:26:16 +04:00
{ " WERR_DS_OBJ_NOT_FOUND " , WERR_DS_OBJ_NOT_FOUND } ,
2009-07-30 14:40:14 +04:00
{ " WERR_DS_GENERIC_ERROR " , WERR_DS_GENERIC_ERROR } ,
{ " WERR_DS_INSUFF_ACCESS_RIGHTS " , WERR_DS_INSUFF_ACCESS_RIGHTS } ,
2007-01-14 18:17:48 +03:00
{ " WERR_DS_SCHEMA_NOT_LOADED " , WERR_DS_SCHEMA_NOT_LOADED } ,
{ " WERR_DS_SCHEMA_ALLOC_FAILED " , WERR_DS_SCHEMA_ALLOC_FAILED } ,
2006-12-29 13:34:15 +03:00
{ " WERR_DS_ATT_SCHEMA_REQ_SYNTAX " , WERR_DS_ATT_SCHEMA_REQ_SYNTAX } ,
2006-12-28 15:17:01 +03:00
{ " WERR_DS_DRA_SCHEMA_MISMATCH " , WERR_DS_DRA_SCHEMA_MISMATCH } ,
2005-03-11 13:33:01 +03:00
{ " WERR_DS_DRA_INVALID_PARAMETER " , WERR_DS_DRA_INVALID_PARAMETER } ,
2004-12-13 14:37:47 +03:00
{ " WERR_DS_DRA_BAD_DN " , WERR_DS_DRA_BAD_DN } ,
{ " WERR_DS_DRA_BAD_NC " , WERR_DS_DRA_BAD_NC } ,
2005-08-26 12:42:29 +04:00
{ " WERR_DS_DRA_INTERNAL_ERROR " , WERR_DS_DRA_INTERNAL_ERROR } ,
2006-08-05 10:20:55 +04:00
{ " WERR_DS_DRA_OUT_OF_MEM " , WERR_DS_DRA_OUT_OF_MEM } ,
2005-08-23 15:40:26 +04:00
{ " WERR_DS_SINGLE_VALUE_CONSTRAINT " , WERR_DS_SINGLE_VALUE_CONSTRAINT } ,
2004-12-07 12:18:56 +03:00
{ " WERR_DS_DRA_DB_ERROR " , WERR_DS_DRA_DB_ERROR } ,
2004-12-13 14:37:47 +03:00
{ " WERR_DS_DRA_NO_REPLICA " , WERR_DS_DRA_NO_REPLICA } ,
2006-07-04 20:42:09 +04:00
{ " WERR_DS_DRA_ACCESS_DENIED " , WERR_DS_DRA_ACCESS_DENIED } ,
2009-03-26 16:51:04 +03:00
{ " WERR_DS_DRA_SOURCE_DISABLED " , WERR_DS_DRA_SOURCE_DISABLED } ,
2005-03-11 13:33:01 +03:00
{ " WERR_DS_DNS_LOOKUP_FAILURE " , WERR_DS_DNS_LOOKUP_FAILURE } ,
2004-12-07 12:18:56 +03:00
{ " WERR_DS_WRONG_LINKED_ATTRIBUTE_SYNTAX " , WERR_DS_WRONG_LINKED_ATTRIBUTE_SYNTAX } ,
2006-12-16 20:21:53 +03:00
{ " WERR_DS_NO_MSDS_INTID " , WERR_DS_NO_MSDS_INTID } ,
{ " WERR_DS_DUP_MSDS_INTID " , WERR_DS_DUP_MSDS_INTID } ,
2004-10-29 01:00:38 +04:00
{ " WERR_GENERAL_FAILURE " , WERR_GENERAL_FAILURE } ,
{ " WERR_PRINTQ_FULL " , WERR_PRINTQ_FULL } ,
{ " WERR_NO_SPOOL_SPACE " , WERR_NO_SPOOL_SPACE } ,
{ " WERR_CAN_NOT_COMPLETE " , WERR_CAN_NOT_COMPLETE } ,
2007-11-07 22:45:04 +03:00
{ " WERR_INVALID_FLAGS " , WERR_INVALID_FLAGS } ,
2009-03-02 15:07:46 +03:00
{ " WERR_DEVICE_NOT_CONNECTED " , WERR_DEVICE_NOT_CONNECTED } ,
2006-09-19 00:44:54 +04:00
{ " WERR_NOT_FOUND " , WERR_NOT_FOUND } ,
2004-10-29 01:00:38 +04:00
{ " WERR_SERVER_UNAVAILABLE " , WERR_SERVER_UNAVAILABLE } ,
2009-02-24 00:59:42 +03:00
{ " WERR_INVALID_USER_BUFFER " , WERR_INVALID_USER_BUFFER } ,
2008-11-06 15:31:27 +03:00
{ " WERR_NO_TRUST_SAM_ACCOUNT " , WERR_NO_TRUST_SAM_ACCOUNT } ,
2009-07-02 00:52:05 +04:00
{ " WERR_INVALID_PRINTER_COMMAND " , WERR_INVALID_PRINTER_COMMAND } ,
2005-03-17 23:28:01 +03:00
{ " WERR_NO_SHUTDOWN_IN_PROGRESS " , WERR_NO_SHUTDOWN_IN_PROGRESS } ,
{ " WERR_SHUTDOWN_ALREADY_IN_PROGRESS " , WERR_SHUTDOWN_ALREADY_IN_PROGRESS } ,
2007-02-12 12:36:53 +03:00
{ " WERR_SEC_E_ENCRYPT_FAILURE " , WERR_SEC_E_ENCRYPT_FAILURE } ,
{ " WERR_SEC_E_DECRYPT_FAILURE " , WERR_SEC_E_DECRYPT_FAILURE } ,
2006-08-16 12:53:25 +04:00
{ " WERR_SEC_E_ALGORITHM_MISMATCH " , WERR_SEC_E_ALGORITHM_MISMATCH } ,
2007-10-16 13:39:40 +04:00
{ " WERR_NOT_AUTHENTICATED " , WERR_NOT_AUTHENTICATED } ,
{ " WERR_CALL_NOT_IMPLEMENTED " , WERR_CALL_NOT_IMPLEMENTED } ,
{ " WERR_FRS_INVALID_SERVICE_PARAMETER " , WERR_FRS_INVALID_SERVICE_PARAMETER } ,
2007-10-16 19:22:03 +04:00
{ " WERR_FRS_SYSVOL_IS_BUSY " , WERR_FRS_SYSVOL_IS_BUSY } ,
{ " WERR_FRS_INSUFFICIENT_PRIV " , WERR_FRS_INSUFFICIENT_PRIV } ,
2007-11-27 01:58:39 +03:00
{ " WERR_RPC_E_REMOTE_DISABLED " , WERR_RPC_E_REMOTE_DISABLED } ,
{ " WERR_NOT_CONNECTED " , WERR_NOT_CONNECTED } ,
2007-11-27 13:58:33 +03:00
{ " WERR_NAME_NOT_FOUND " , WERR_NAME_NOT_FOUND } ,
2008-11-01 19:28:16 +03:00
{ " WERR_NONE_MAPPED " , WERR_NONE_MAPPED } ,
{ " WERR_INVALID_DOMAIN_STATE " , WERR_INVALID_DOMAIN_STATE } ,
{ " WERR_SPECIAL_ACCOUNT " , WERR_SPECIAL_ACCOUNT } ,
{ " WERR_ALIAS_EXISTS " , WERR_ALIAS_EXISTS } ,
{ " WERR_NO_SUCH_ALIAS " , WERR_NO_SUCH_ALIAS } ,
{ " WERR_MEMBER_IN_ALIAS " , WERR_MEMBER_IN_ALIAS } ,
{ " WERR_TIME_SKEW " , WERR_TIME_SKEW } ,
{ " WERR_IO_PENDING " , WERR_IO_PENDING } ,
{ " WERR_INVALID_SERVICE_CONTROL " , WERR_INVALID_SERVICE_CONTROL } ,
{ " WERR_SERVICE_ALREADY_RUNNING " , WERR_SERVICE_ALREADY_RUNNING } ,
{ " WERR_REG_CORRUPT " , WERR_REG_CORRUPT } ,
{ " WERR_REG_IO_FAILURE " , WERR_REG_IO_FAILURE } ,
{ " WERR_REG_FILE_INVALID " , WERR_REG_FILE_INVALID } ,
{ " WERR_NO_SUCH_SERVICE " , WERR_NO_SUCH_SERVICE } ,
{ " WERR_SERVICE_DISABLED " , WERR_SERVICE_DISABLED } ,
2009-04-08 23:43:57 +04:00
{ " WERR_SERVICE_MARKED_FOR_DELETE " , WERR_SERVICE_MARKED_FOR_DELETE } ,
{ " WERR_SERVICE_EXISTS " , WERR_SERVICE_EXISTS } ,
2008-11-01 19:28:16 +03:00
{ " WERR_SERVICE_NEVER_STARTED " , WERR_SERVICE_NEVER_STARTED } ,
2009-04-08 23:43:57 +04:00
{ " WERR_DUPLICATE_SERVICE_NAME " , WERR_DUPLICATE_SERVICE_NAME } ,
2008-11-01 19:28:16 +03:00
{ " WERR_PASSWORD_MUST_CHANGE " , WERR_PASSWORD_MUST_CHANGE } ,
{ " WERR_ACCOUNT_LOCKED_OUT " , WERR_ACCOUNT_LOCKED_OUT } ,
2009-02-25 01:45:14 +03:00
{ " WERR_UNKNOWN_PRINT_MONITOR " , WERR_UNKNOWN_PRINT_MONITOR } ,
2009-05-13 01:50:37 +04:00
{ " WERR_PASSWORD_RESTRICTION " , WERR_PASSWORD_RESTRICTION } ,
{ " WERR_WRONG_PASSWORD " , WERR_WRONG_PASSWORD } ,
2009-09-17 05:28:28 +04:00
{ " WERR_CLASS_NOT_REGISTERED " , WERR_CLASS_NOT_REGISTERED } ,
2003-08-13 05:53:07 +04:00
{ NULL , W_ERROR ( 0 ) }
} ;
2004-10-29 01:00:38 +04:00
/* DFS errors */
2003-08-13 05:53:07 +04:00
/*****************************************************************************
returns a windows error message . not amazingly helpful , but better than a number .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
const char * win_errstr ( WERROR werror )
{
2007-09-08 02:01:15 +04:00
static char msg [ 40 ] ;
2003-08-13 05:53:07 +04:00
int idx = 0 ;
while ( dos_errs [ idx ] . dos_errstr ! = NULL ) {
if ( W_ERROR_V ( dos_errs [ idx ] . werror ) = =
W_ERROR_V ( werror ) )
return dos_errs [ idx ] . dos_errstr ;
idx + + ;
}
2004-08-30 09:33:49 +04:00
slprintf ( msg , sizeof ( msg ) , " DOS code 0x%08x " , W_ERROR_V ( werror ) ) ;
2003-08-13 05:53:07 +04:00
return msg ;
}
2008-11-01 19:28:16 +03:00
struct werror_str_struct {
WERROR werror ;
const char * friendly_errstr ;
} ;
const struct werror_str_struct dos_err_strs [ ] = {
{ WERR_OK , " Success " } ,
{ WERR_ACCESS_DENIED , " Access is denied " } ,
{ WERR_INVALID_PARAM , " Invalid parameter " } ,
{ WERR_NOT_SUPPORTED , " Not supported " } ,
{ WERR_BAD_PASSWORD , " A bad password was supplied " } ,
{ WERR_NOMEM , " Out of memory " } ,
{ WERR_NO_LOGON_SERVERS , " No logon servers found " } ,
{ WERR_NO_SUCH_LOGON_SESSION , " No such logon session " } ,
{ WERR_DOMAIN_CONTROLLER_NOT_FOUND , " A domain controller could not be found " } ,
2009-09-18 01:46:52 +04:00
{ WERR_DCNOTFOUND , " A domain controller could not be found " } ,
2008-11-01 19:28:16 +03:00
{ WERR_SETUP_NOT_JOINED , " Join failed " } ,
{ WERR_SETUP_ALREADY_JOINED , " Machine is already joined " } ,
{ WERR_SETUP_DOMAIN_CONTROLLER , " Machine is a Domain Controller " } ,
{ WERR_LOGON_FAILURE , " Invalid logon credentials " } ,
2009-09-18 01:00:21 +04:00
{ WERR_USEREXISTS , " The user account already exists. " } ,
2008-11-01 19:28:16 +03:00
{ WERR_PASSWORD_MUST_CHANGE , " The password must be changed " } ,
{ WERR_ACCOUNT_LOCKED_OUT , " Account locked out " } ,
{ WERR_TIME_SKEW , " Time difference between client and server " } ,
{ WERR_USER_ALREADY_EXISTS , " User already exists " } ,
{ WERR_PASSWORD_RESTRICTION , " Password does not meet restrictions " } ,
{ WERR_NONE_MAPPED , " Could not map names to SIDs " } ,
{ WERR_NO_SUCH_USER , " No such User " } ,
{ WERR_GROUP_EXISTS , " Group already exists " } ,
2009-05-05 21:38:58 +04:00
{ WERR_NO_SUCH_GROUP , " No such Group " } ,
{ WERR_INVALID_PRIMARY_GROUP , " The account's primary group is invalid " } ,
2008-11-01 19:28:16 +03:00
{ WERR_DS_DRA_BAD_DN , " An invalid distinguished name was specified for this replication " } ,
{ WERR_DS_DRA_BAD_NC , " An invalid naming context was specified for this replication operation " } ,
{ WERR_WRONG_PASSWORD , " The current password is incorrect " }
} ;
/*****************************************************************************
Get friendly error string for WERRORs
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
const char * get_friendly_werror_msg ( WERROR werror )
{
int i = 0 ;
for ( i = 0 ; i < ARRAY_SIZE ( dos_err_strs ) ; i + + ) {
if ( W_ERROR_V ( dos_err_strs [ i ] . werror ) = =
W_ERROR_V ( werror ) ) {
return dos_err_strs [ i ] . friendly_errstr ;
}
}
return win_errstr ( werror ) ;
}