summaryrefslogtreecommitdiff
path: root/testprogs/win32/spoolss/error.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-12-14 23:54:42 +0100
committerGünther Deschner <gd@samba.org>2010-01-08 01:03:34 +0100
commit487a03a1586e478baaadada184836be98c609aa0 (patch)
tree15c26cd7ff3bbc64d3346cb6af31550311db97ca /testprogs/win32/spoolss/error.c
parent57be1d07afc2a0725b79327636204a9238ab94aa (diff)
downloadsamba-487a03a1586e478baaadada184836be98c609aa0.tar.gz
samba-487a03a1586e478baaadada184836be98c609aa0.tar.bz2
samba-487a03a1586e478baaadada184836be98c609aa0.zip
testprogs: add win32 spoolss testsuite.
Guenther
Diffstat (limited to 'testprogs/win32/spoolss/error.c')
-rw-r--r--testprogs/win32/spoolss/error.c115
1 files changed, 115 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>.
+*/
+
+#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;
+}