libsmb/doserr.c

説明を見る。
00001 /* 
00002  *  Unix SMB/CIFS implementation.
00003  *  DOS error routines
00004  *  Copyright (C) Tim Potter 2002.
00005  *  
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *  
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *  
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 /* DOS error codes.  please read doserr.h */
00022 
00023 #include "includes.h"
00024 
00025 typedef const struct
00026 {
00027         const char *dos_errstr;
00028         WERROR werror;
00029 } werror_code_struct;
00030 
00031 werror_code_struct dos_errs[] =
00032 {
00033         { "WERR_OK", WERR_OK },
00034         { "WERR_GENERAL_FAILURE", WERR_GENERAL_FAILURE },
00035         { "WERR_BADFILE", WERR_BADFILE },
00036         { "WERR_ACCESS_DENIED", WERR_ACCESS_DENIED },
00037         { "WERR_BADFID", WERR_BADFID },
00038         { "WERR_BADFUNC", WERR_BADFUNC },
00039         { "WERR_INSUFFICIENT_BUFFER", WERR_INSUFFICIENT_BUFFER },
00040         { "WERR_SEM_TIMEOUT", WERR_SEM_TIMEOUT },
00041         { "WERR_NO_SUCH_SHARE", WERR_NO_SUCH_SHARE },
00042         { "WERR_ALREADY_EXISTS", WERR_ALREADY_EXISTS },
00043         { "WERR_INVALID_PARAM", WERR_INVALID_PARAM },
00044         { "WERR_NOT_SUPPORTED", WERR_NOT_SUPPORTED },
00045         { "WERR_BAD_PASSWORD", WERR_BAD_PASSWORD },
00046         { "WERR_NOMEM", WERR_NOMEM },
00047         { "WERR_INVALID_NAME", WERR_INVALID_NAME },
00048         { "WERR_UNKNOWN_LEVEL", WERR_UNKNOWN_LEVEL },
00049         { "WERR_OBJECT_PATH_INVALID", WERR_OBJECT_PATH_INVALID },
00050         { "WERR_NO_MORE_ITEMS", WERR_NO_MORE_ITEMS },
00051         { "WERR_MORE_DATA", WERR_MORE_DATA },
00052         { "WERR_UNKNOWN_PRINTER_DRIVER", WERR_UNKNOWN_PRINTER_DRIVER },
00053         { "WERR_INVALID_PRINTER_NAME", WERR_INVALID_PRINTER_NAME },
00054         { "WERR_PRINTER_ALREADY_EXISTS", WERR_PRINTER_ALREADY_EXISTS },
00055         { "WERR_INVALID_DATATYPE", WERR_INVALID_DATATYPE },
00056         { "WERR_INVALID_ENVIRONMENT", WERR_INVALID_ENVIRONMENT },
00057         { "WERR_INVALID_FORM_NAME", WERR_INVALID_FORM_NAME },
00058         { "WERR_INVALID_FORM_SIZE", WERR_INVALID_FORM_SIZE },
00059         { "WERR_BUF_TOO_SMALL", WERR_BUF_TOO_SMALL },
00060         { "WERR_JOB_NOT_FOUND", WERR_JOB_NOT_FOUND },
00061         { "WERR_DEST_NOT_FOUND", WERR_DEST_NOT_FOUND },
00062         { "WERR_NOT_LOCAL_DOMAIN", WERR_NOT_LOCAL_DOMAIN },
00063         { "WERR_NO_LOGON_SERVERS", WERR_NO_LOGON_SERVERS },
00064         { "WERR_PRINTER_DRIVER_IN_USE", WERR_PRINTER_DRIVER_IN_USE },
00065         { "WERR_STATUS_MORE_ENTRIES  ", WERR_STATUS_MORE_ENTRIES },
00066         { "WERR_DFS_NO_SUCH_VOL", WERR_DFS_NO_SUCH_VOL },
00067         { "WERR_DFS_NO_SUCH_SHARE", WERR_DFS_NO_SUCH_SHARE },
00068         { "WERR_DFS_NO_SUCH_SERVER", WERR_DFS_NO_SUCH_SERVER },
00069         { "WERR_DFS_INTERNAL_ERROR", WERR_DFS_INTERNAL_ERROR },
00070         { "WERR_DFS_CANT_CREATE_JUNCT", WERR_DFS_CANT_CREATE_JUNCT },
00071         { "WERR_MACHINE_LOCKED", WERR_MACHINE_LOCKED },
00072         { "WERR_DOMAIN_CONTROLLER_NOT_FOUND", WERR_DOMAIN_CONTROLLER_NOT_FOUND },
00073         { "WERR_LOGON_FAILURE", WERR_LOGON_FAILURE },
00074         { "WERR_NO_SUCH_DOMAIN", WERR_NO_SUCH_DOMAIN },
00075         { "WERR_INVALID_SECURITY_DESCRIPTOR", WERR_INVALID_SECURITY_DESCRIPTOR },
00076         { "WERR_INVALID_OWNER", WERR_INVALID_OWNER },
00077         { "WERR_SERVER_UNAVAILABLE", WERR_SERVER_UNAVAILABLE },
00078         { "WERR_IO_PENDING", WERR_IO_PENDING },
00079         { "WERR_INVALID_SERVICE_CONTROL", WERR_INVALID_SERVICE_CONTROL },
00080         { "WERR_NET_NAME_NOT_FOUND", WERR_NET_NAME_NOT_FOUND },
00081         { "WERR_REG_CORRUPT", WERR_REG_CORRUPT },
00082         { "WERR_REG_IO_FAILURE", WERR_REG_IO_FAILURE },
00083         { "WERR_REG_FILE_INVALID", WERR_REG_FILE_INVALID },
00084         { "WERR_SERVICE_DISABLED", WERR_SERVICE_DISABLED },
00085         { "WERR_CAN_NOT_COMPLETE", WERR_CAN_NOT_COMPLETE},
00086         { "WERR_INVALID_FLAGS", WERR_INVALID_FLAGS},
00087         { NULL, W_ERROR(0) }
00088 };
00089 
00090 /*****************************************************************************
00091  Returns a DOS error message.  not amazingly helpful, but better than a number.
00092  *****************************************************************************/
00093 
00094 const char *dos_errstr(WERROR werror)
00095 {
00096         static pstring msg;
00097         int idx = 0;
00098 
00099         slprintf(msg, sizeof(msg), "DOS code 0x%08x", W_ERROR_V(werror));
00100 
00101         while (dos_errs[idx].dos_errstr != NULL) {
00102                 if (W_ERROR_V(dos_errs[idx].werror) == 
00103                     W_ERROR_V(werror))
00104                         return dos_errs[idx].dos_errstr;
00105                 idx++;
00106         }
00107 
00108         return msg;
00109 }

Sambaに対してSat Aug 29 21:23:05 2009に生成されました。  doxygen 1.4.7