From 487a03a1586e478baaadada184836be98c609aa0 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 14 Dec 2009 23:54:42 +0100 Subject: testprogs: add win32 spoolss testsuite. Guenther --- testprogs/win32/spoolss/error.c | 115 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 testprogs/win32/spoolss/error.c (limited to 'testprogs/win32/spoolss/error.c') diff --git a/testprogs/win32/spoolss/error.c b/testprogs/win32/spoolss/error.c new file mode 100644 index 0000000000..e523c15864 --- /dev/null +++ b/testprogs/win32/spoolss/error.c @@ -0,0 +1,115 @@ +/* + 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 . +*/ + +#include "spoolss.h" + +const char *errstr(DWORD error) +{ + static char tmp[20]; + + switch (error) { + case ERROR_ACCESS_DENIED: + return "ERROR_ACCESS_DENIED"; + case ERROR_INVALID_PARAMETER: + return "ERROR_INVALID_PARAMETER"; + 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"; + case ERROR_MORE_DATA: + return "ERROR_MORE_DATA"; +#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 + default: + break; + } + + sprintf(tmp, "0x%08x", error); + + return tmp; +} -- cgit