2009-12-14 23:54:42 +01:00
/*
Unix SMB / CIFS implementation .
test suite for spoolss rpc operations
Copyright ( C ) Guenther Deschner 2009
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/>.
*/
2010-05-10 11:01:54 +02:00
# include "testspoolss.h"
2009-12-14 23:54:42 +01:00
const char * errstr ( DWORD error )
{
static char tmp [ 20 ] ;
switch ( error ) {
2010-01-11 12:33:22 +01:00
case ERROR_FILE_NOT_FOUND :
return " ERROR_FILE_NOT_FOUND " ;
2009-12-14 23:54:42 +01:00
case ERROR_ACCESS_DENIED :
return " ERROR_ACCESS_DENIED " ;
case ERROR_INVALID_PARAMETER :
return " ERROR_INVALID_PARAMETER " ;
2010-01-11 15:40:16 +01:00
case ERROR_INVALID_HANDLE :
return " ERROR_INVALID_HANDLE " ;
2009-12-14 23:54:42 +01:00
case ERROR_CALL_NOT_IMPLEMENTED :
return " ERROR_CALL_NOT_IMPLEMENTED " ;
case ERROR_INSUFFICIENT_BUFFER :
return " ERROR_INSUFFICIENT_BUFFER " ;
case ERROR_INVALID_NAME :
return " ERROR_INVALID_NAME " ;
case ERROR_INVALID_LEVEL :
return " ERROR_INVALID_LEVEL " ;
2010-02-10 13:17:36 +01:00
case ERROR_INVALID_DATA :
return " ERROR_INVALID_DATA " ;
2009-12-14 23:54:42 +01:00
case ERROR_MORE_DATA :
return " ERROR_MORE_DATA " ;
2010-03-15 17:08:23 +01:00
case ERROR_NO_MORE_ITEMS :
return " ERROR_NO_MORE_ITEMS " ;
2009-12-14 23:54:42 +01:00
# ifdef ERROR_INVALID_DATATYPE
case ERROR_INVALID_DATATYPE :
return " ERROR_INVALID_DATATYPE " ;
# endif
case ERROR_INVALID_ENVIRONMENT :
return " ERROR_INVALID_ENVIRONMENT " ;
case ERROR_INVALID_PRINTER_COMMAND :
return " ERROR_INVALID_PRINTER_COMMAND " ;
case ERROR_PRINTER_ALREADY_EXISTS :
return " ERROR_PRINTER_ALREADY_EXISTS " ;
case ERROR_INVALID_PRINTER_NAME :
return " ERROR_INVALID_PRINTER_NAME " ;
case ERROR_INVALID_PRIORITY :
return " ERROR_INVALID_PRIORITY " ;
case ERROR_INVALID_SEPARATOR_FILE :
return " ERROR_INVALID_SEPARATOR_FILE " ;
case ERROR_UNKNOWN_PRINTPROCESSOR :
return " ERROR_UNKNOWN_PRINTPROCESSOR " ;
case ERROR_UNKNOWN_PRINTER_DRIVER :
return " ERROR_UNKNOWN_PRINTER_DRIVER " ;
case ERROR_UNKNOWN_PORT :
return " ERROR_UNKNOWN_PORT " ;
case ERROR_PRINTER_DRIVER_ALREADY_INSTALLED :
return " ERROR_PRINTER_DRIVER_ALREADY_INSTALLED " ;
case ERROR_UNKNOWN_PRINT_MONITOR :
return " ERROR_UNKNOWN_PRINT_MONITOR " ;
case ERROR_PRINTER_DRIVER_IN_USE :
return " ERROR_PRINTER_DRIVER_IN_USE " ;
case ERROR_SPOOL_FILE_NOT_FOUND :
return " ERROR_SPOOL_FILE_NOT_FOUND " ;
case ERROR_SPL_NO_STARTDOC :
return " ERROR_SPL_NO_STARTDOC " ;
case ERROR_SPL_NO_ADDJOB :
return " ERROR_SPL_NO_ADDJOB " ;
case ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED :
return " ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED " ;
case ERROR_PRINT_MONITOR_ALREADY_INSTALLED :
return " ERROR_PRINT_MONITOR_ALREADY_INSTALLED " ;
case ERROR_INVALID_PRINT_MONITOR :
return " ERROR_INVALID_PRINT_MONITOR " ;
case ERROR_PRINT_MONITOR_IN_USE :
return " ERROR_PRINT_MONITOR_IN_USE " ;
case ERROR_PRINTER_HAS_JOBS_QUEUED :
return " ERROR_PRINTER_HAS_JOBS_QUEUED " ;
case ERROR_PRINTER_NOT_FOUND :
return " ERROR_PRINTER_NOT_FOUND " ;
case ERROR_PRINTER_DRIVER_WARNED :
return " ERROR_PRINTER_DRIVER_WARNED " ;
case ERROR_PRINTER_DRIVER_BLOCKED :
return " ERROR_PRINTER_DRIVER_BLOCKED " ;
# ifdef ERROR_PRINTER_DRIVER_PACKAGE_IN_USE
case ERROR_PRINTER_DRIVER_PACKAGE_IN_USE :
return " ERROR_PRINTER_DRIVER_PACKAGE_IN_USE " ;
# endif
# ifdef ERROR_CORE_DRIVER_PACKAGE_NOT_FOUND
case ERROR_CORE_DRIVER_PACKAGE_NOT_FOUND :
return " ERROR_CORE_DRIVER_PACKAGE_NOT_FOUND " ;
# endif
# ifdef ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED
case ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED :
return " ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED " ;
# endif
# ifdef ERROR_PRINT_JOB_RESTART_REQUIRED
case ERROR_PRINT_JOB_RESTART_REQUIRED :
return " ERROR_PRINT_JOB_RESTART_REQUIRED " ;
# endif
2010-01-11 12:33:22 +01:00
case ERROR_CANCELLED :
return " ERROR_CANCELLED " ;
2010-02-19 10:11:19 +01:00
case ERROR_NOACCESS :
return " ERROR_NOACCESS " ;
2010-03-01 18:01:42 +01:00
case RPC_X_NULL_REF_POINTER :
return " RPC_X_NULL_REF_POINTER " ;
2010-02-18 14:48:57 +01:00
case RPC_S_PROCNUM_OUT_OF_RANGE :
return " RPC_S_PROCNUM_OUT_OF_RANGE " ;
2010-01-11 15:40:16 +01:00
case RPC_S_SERVER_UNAVAILABLE :
return " RPC_S_SERVER_UNAVAILABLE " ;
2010-01-15 16:36:25 +01:00
case RPC_S_INVALID_NET_ADDR :
return " RPC_S_INVALID_NET_ADDR " ;
2010-02-11 01:24:12 +01:00
case RPC_S_CALL_FAILED :
return " RPC_S_CALL_FAILED " ;
2009-12-14 23:54:42 +01:00
default :
break ;
}
sprintf ( tmp , " 0x%08x " , error ) ;
return tmp ;
}