dos2unix everything
authorGünther Deschner <gd@samba.org>
Thu, 7 Jan 2010 13:45:15 +0000 (14:45 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 7 Jan 2010 13:57:11 +0000 (14:57 +0100)
Guenther

47 files changed:
AbortPrinter.c
AddForm.c
AddJob.c
AddPrinter.c
AddPrinterConnection.c
AddPrinterDriver.c
AddPrinterDriverEx.c
AddPrinterEx.c
DeleteForm.c
DeletePrinter.c
DeletePrinterConnection.c
DeletePrinterData.c
DeletePrinterDataEx.c
DeletePrinterDriver.c
DeletePrinterDriverEx.c
DeletePrinterKey.c
DocPrinter.c
EnumForms.c
EnumJobs.c
EnumMonitors.c
EnumPorts.c
EnumPrintProcessorDatatypes.c
EnumPrintProcessors.c
EnumPrinterData.c
EnumPrinterDataEx.c
EnumPrinterDrivers.c
EnumPrinterKey.c
EnumPrinters.c
GetForm.c
GetJob.c
GetPrintProcessorDirectory.c
GetPrinter.c
GetPrinterData.c
GetPrinterDataEx.c
GetPrinterDriver.c
GetPrinterDriverDirectory.c
OpenPrinter.c
PagePrinter.c
PrinterChangeNotification.c
PrinterChangeNotify.c
ResetPrinter.c
SetForm.c
SetJob.c
SetPrinter.c
SetPrinterData.c
SetPrinterDataEx.c
printlib.c

index 33c6704..6458195 100644 (file)
@@ -1,66 +1,66 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE  printer;\r
-       LPVOID lpMsgBuf;\r
-\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-       if (strcmp(argv[1], "NULL") == 0)\r
-       {\r
-               argv[1] = NULL;\r
-               printf ("Calling AbortPrinter() on local machine\n");\r
-       }\r
-\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-       }\r
-\r
-\r
-       if (!AbortPrinter (printer))\r
-       {\r
-               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | \r
-                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),\r
-                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language\r
-                       (LPTSTR) &lpMsgBuf, 0, NULL);\r
-               printf ("ERROR : %s\n", (char*)lpMsgBuf);\r
-               LocalFree (lpMsgBuf);\r
-       }\r
-       else\r
-       {\r
-               printf ("AbortPrinter called successfully for [%s]\n", argv[1]);\r
-       }\r
-\r
-\r
-       if (!ClosePrinter(printer))\r
-       {\r
-               fprintf (stderr, "Error closing printer!\n");\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE  printer;
+       LPVOID lpMsgBuf;
+
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+       if (strcmp(argv[1], "NULL") == 0)
+       {
+               argv[1] = NULL;
+               printf ("Calling AbortPrinter() on local machine\n");
+       }
+
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+       }
+
+
+       if (!AbortPrinter (printer))
+       {
+               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
+                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
+                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+                       (LPTSTR) &lpMsgBuf, 0, NULL);
+               printf ("ERROR : %s\n", (char*)lpMsgBuf);
+               LocalFree (lpMsgBuf);
+       }
+       else
+       {
+               printf ("AbortPrinter called successfully for [%s]\n", argv[1]);
+       }
+
+
+       if (!ClosePrinter(printer))
+       {
+               fprintf (stderr, "Error closing printer!\n");
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+       }
+
+       return 0;
+
 }
\ No newline at end of file
index aa3dc0e..fb22324 100644 (file)
--- a/AddForm.c
+++ b/AddForm.c
@@ -1,92 +1,92 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                          printer;\r
-       PRINTER_DEFAULTS        defaults;\r
-       DWORD                           returned, needed, i;\r
-       PFORM_INFO_1            buffer1 = NULL;\r
-\r
-       if ( argc < 3) {\r
-               fprintf (stderr, "useage: %s <localprinter> <networkprinter>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       defaults.DesiredAccess = PRINTER_ACCESS_ADMINISTER;\r
-       defaults.pDatatype = NULL;\r
-       defaults.pDevMode = NULL;\r
-\r
-       /* open the printer */\r
-       if (!OpenPrinter (argv[1], &printer, &defaults))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               PrintLastError();\r
-               exit (-1);\r
-       }\r
-\r
-       /* INFO LEVEL 1 */\r
-\r
-       EnumForms(printer, 1, (LPBYTE)buffer1, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {\r
-               fprintf (stderr, "Error getting form information for [%s] using NULL buffer.\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-\r
-       if ( (buffer1 = (FORM_INFO_1*)malloc(needed)) == NULL ) {\r
-               fprintf (stderr, "Unable to malloc memory for FORM_INFO_1 buffer!\n");\r
-               exit (-1);\r
-       }\r
-\r
-       if (!EnumForms(printer, 1, (LPBYTE)buffer1, needed, &needed, &returned))\r
-       {\r
-               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n", \r
-                            argv[1], needed);\r
-               exit (-1);\r
-       }\r
-\r
-       /* close the printer */\r
-       if ( !ClosePrinter(printer) ) {\r
-               PrintLastError();\r
-               exit (-1);\r
-       }\r
-\r
-\r
-       /* open the printer */\r
-       if (!OpenPrinter (argv[2], &printer, &defaults))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               PrintLastError();\r
-               exit (-1);\r
-       }\r
-\r
-       for (i=0; i<returned; i++)\r
-       {\r
-               if ( buffer1[i].Flags == FORM_PRINTER ) {\r
-                       printf("Adding form \"%s\"\n", buffer1[i].pName );\r
-                       if ( !AddForm( printer, 1, (LPBYTE)&buffer1[i] ) )\r
-                               PrintLastError();\r
-               }\r
-       }       \r
-\r
-\r
-       free (buffer1);\r
-\r
-\r
-       /* close the printer */\r
-       if ( !ClosePrinter(printer) ) {\r
-               PrintLastError();\r
-               exit (-1);\r
-       }\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                          printer;
+       PRINTER_DEFAULTS        defaults;
+       DWORD                           returned, needed, i;
+       PFORM_INFO_1            buffer1 = NULL;
+
+       if ( argc < 3) {
+               fprintf (stderr, "useage: %s <localprinter> <networkprinter>\n", argv[0]);
+               exit (-1);
+       }
+
+       defaults.DesiredAccess = PRINTER_ACCESS_ADMINISTER;
+       defaults.pDatatype = NULL;
+       defaults.pDevMode = NULL;
+
+       /* open the printer */
+       if (!OpenPrinter (argv[1], &printer, &defaults))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               PrintLastError();
+               exit (-1);
+       }
+
+       /* INFO LEVEL 1 */
+
+       EnumForms(printer, 1, (LPBYTE)buffer1, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
+               fprintf (stderr, "Error getting form information for [%s] using NULL buffer.\n", argv[1]);
+               exit (-1);
+       }
+
+       if ( (buffer1 = (FORM_INFO_1*)malloc(needed)) == NULL ) {
+               fprintf (stderr, "Unable to malloc memory for FORM_INFO_1 buffer!\n");
+               exit (-1);
+       }
+
+       if (!EnumForms(printer, 1, (LPBYTE)buffer1, needed, &needed, &returned))
+       {
+               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n",
+                            argv[1], needed);
+               exit (-1);
+       }
+
+       /* close the printer */
+       if ( !ClosePrinter(printer) ) {
+               PrintLastError();
+               exit (-1);
+       }
+
+
+       /* open the printer */
+       if (!OpenPrinter (argv[2], &printer, &defaults))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               PrintLastError();
+               exit (-1);
+       }
+
+       for (i=0; i<returned; i++)
+       {
+               if ( buffer1[i].Flags == FORM_PRINTER ) {
+                       printf("Adding form \"%s\"\n", buffer1[i].pName );
+                       if ( !AddForm( printer, 1, (LPBYTE)&buffer1[i] ) )
+                               PrintLastError();
+               }
+       }
+
+
+       free (buffer1);
+
+
+       /* close the printer */
+       if ( !ClosePrinter(printer) ) {
+               PrintLastError();
+               exit (-1);
+       }
+
+       return 0;
+
 }
\ No newline at end of file
index c3e36d1..dbcaaa1 100644 (file)
--- a/AddJob.c
+++ b/AddJob.c
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-#define START_JOB      0\r
-#define MAX_JOBS       100\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                  printer;\r
-       DWORD                   returned, needed, i;\r
-       PJOB_INFO_1             buffer1 = NULL;\r
-       PJOB_INFO_2             buffer2 = NULL;\r
-\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* open the printer */\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-       }\r
-\r
-       /* INFO LEVEL 1 */\r
-       EnumJobs(printer, START_JOB, MAX_JOBS, 1, (LPBYTE)buffer1, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               if (needed != 0)\r
-               {\r
-                       fprintf (stderr, "Error getting job information for [%s] using NULL buffer.\n", argv[2]);\r
-                       exit (-1);\r
-               }\r
-               else\r
-               {\r
-                       printf ("No jobs returned for [%s]\n", argv[1]);\r
-                       ClosePrinter (printer);\r
-                       exit (0);\r
-               }\r
-       }\r
-\r
-       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for JOB_INFO_1 buffer!\n");\r
-               exit (-1);\r
-       }\r
-       if (!EnumJobs(printer, START_JOB, MAX_JOBS, 1, (LPBYTE)buffer1, needed, &needed, &returned))\r
-       {\r
-               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n", \r
-                            argv[2], needed);\r
-               exit (-1);\r
-       }\r
-\r
-       printf ("Job Info Level 1:\n");\r
-       for (i=0; i<returned; i++)\r
-       {\r
-               print_job_info_1 (&buffer1[i]);\r
-       }\r
-       printf ("\n");\r
-       free (buffer1);\r
-\r
-\r
-       /* INFO LEVEL 2 */\r
-       EnumJobs(printer, START_JOB, MAX_JOBS, 2, (LPBYTE)buffer2, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               if (needed != 0)\r
-               {\r
-                       fprintf (stderr, "Error getting job information for [%s] using NULL buffer.\n", argv[2]);\r
-                       exit (-1);\r
-               }\r
-               else\r
-               {\r
-                       printf ("No jobs returned for [%s]\n", argv[1]);\r
-                       ClosePrinter (printer);\r
-                       exit (0);\r
-               }\r
-       }\r
-\r
-       if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for JOB_INFO_2 buffer!\n");\r
-               exit (-1);\r
-       }\r
-       if (!EnumJobs(printer, START_JOB, MAX_JOBS, 2, (LPBYTE)buffer2, needed, &needed, &returned))\r
-       {\r
-               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n", \r
-                            argv[2], needed);\r
-               exit (-1);\r
-       }\r
-\r
-       printf ("Job Info Level 2:\n");\r
-       for (i=0; i<returned; i++)\r
-       {\r
-               print_job_info_2 (&buffer2[i]);\r
-       }\r
-       printf ("\n");\r
-       free (buffer2);\r
-\r
-\r
-       /* close the printer */\r
-       if (!ClosePrinter(printer))\r
-       {\r
-               fprintf (stderr, "Error closing printer!\n");\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
-}\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+#define START_JOB      0
+#define MAX_JOBS       100
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                  printer;
+       DWORD                   returned, needed, i;
+       PJOB_INFO_1             buffer1 = NULL;
+       PJOB_INFO_2             buffer2 = NULL;
+
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* open the printer */
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+       }
+
+       /* INFO LEVEL 1 */
+       EnumJobs(printer, START_JOB, MAX_JOBS, 1, (LPBYTE)buffer1, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               if (needed != 0)
+               {
+                       fprintf (stderr, "Error getting job information for [%s] using NULL buffer.\n", argv[2]);
+                       exit (-1);
+               }
+               else
+               {
+                       printf ("No jobs returned for [%s]\n", argv[1]);
+                       ClosePrinter (printer);
+                       exit (0);
+               }
+       }
+
+       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for JOB_INFO_1 buffer!\n");
+               exit (-1);
+       }
+       if (!EnumJobs(printer, START_JOB, MAX_JOBS, 1, (LPBYTE)buffer1, needed, &needed, &returned))
+       {
+               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n",
+                            argv[2], needed);
+               exit (-1);
+       }
+
+       printf ("Job Info Level 1:\n");
+       for (i=0; i<returned; i++)
+       {
+               print_job_info_1 (&buffer1[i]);
+       }
+       printf ("\n");
+       free (buffer1);
+
+
+       /* INFO LEVEL 2 */
+       EnumJobs(printer, START_JOB, MAX_JOBS, 2, (LPBYTE)buffer2, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               if (needed != 0)
+               {
+                       fprintf (stderr, "Error getting job information for [%s] using NULL buffer.\n", argv[2]);
+                       exit (-1);
+               }
+               else
+               {
+                       printf ("No jobs returned for [%s]\n", argv[1]);
+                       ClosePrinter (printer);
+                       exit (0);
+               }
+       }
+
+       if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for JOB_INFO_2 buffer!\n");
+               exit (-1);
+       }
+       if (!EnumJobs(printer, START_JOB, MAX_JOBS, 2, (LPBYTE)buffer2, needed, &needed, &returned))
+       {
+               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n",
+                            argv[2], needed);
+               exit (-1);
+       }
+
+       printf ("Job Info Level 2:\n");
+       for (i=0; i<returned; i++)
+       {
+               print_job_info_2 (&buffer2[i]);
+       }
+       printf ("\n");
+       free (buffer2);
+
+
+       /* close the printer */
+       if (!ClosePrinter(printer))
+       {
+               fprintf (stderr, "Error closing printer!\n");
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+       }
+
+       return 0;
+
+}
index 52c1ee2..2df4b65 100644 (file)
@@ -1,67 +1,66 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include <string.h>\r
-#include "printlib.h"\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       PRINTER_INFO_2          buffer;\r
-       HANDLE                          printer;\r
-       LPVOID                          lpMsgBuf;\r
-       \r
-       if (argc < 5)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername> <printername> <sharename> <port name>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       memset(&buffer, 0 , sizeof(buffer));\r
-\r
-       buffer.pServerName      = strdup (argv[1]);\r
-       buffer.pPrinterName = strdup (argv[2]);\r
-       buffer.pShareName       = strdup (argv[3]);\r
-       buffer.pPortName        = strdup (argv[4]);\r
-       buffer.pDriverName      = strdup ("Apple LaserWriter II NTX v51.8");\r
-       buffer.pPrintProcessor  = strdup ("winprint");\r
-       buffer.pDatatype        = strdup ("RAW");\r
-       buffer.Attributes       = PRINTER_ATTRIBUTE_SHARED;\r
-       buffer.pSecurityDescriptor = NULL;\r
-\r
-\r
-       printf ("Attempting to add printer [%s] on server [%s]\n", \r
-               buffer.pPrinterName, buffer.pServerName);\r
-       printf ("\nPrinter Info 1:\n");\r
-       print_printer_info_2 (&buffer);\r
-       printf ("\n");\r
-\r
-       printer = AddPrinter (buffer.pServerName, 2, (LPBYTE)(&buffer));\r
-       if ( printer == NULL)\r
-       {\r
-               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | \r
-                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),\r
-                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language\r
-                       (LPTSTR) &lpMsgBuf, 0, NULL);\r
-               printf ("ERROR : %s\n", (char*)lpMsgBuf);\r
-               LocalFree (lpMsgBuf);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] added successfully on server [%s]!\n",\r
-                       buffer.pPrinterName, buffer.pServerName);\r
-               if (!ClosePrinter (printer))\r
-                       fprintf (stderr, "Error closing printer handle!\n");\r
-               else\r
-                       printf ("Printer handle closed successfully.\n");\r
-       }\r
-\r
-       return 0;\r
-\r
-}\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "printlib.h"
+
+
+int main (int argc, char* argv[])
+{
+       PRINTER_INFO_2          buffer;
+       HANDLE                          printer;
+       LPVOID                          lpMsgBuf;
+
+       if (argc < 5)
+       {
+               fprintf (stderr, "useage: %s <servername> <printername> <sharename> <port name>\n", argv[0]);
+               exit (-1);
+       }
+
+       memset(&buffer, 0 , sizeof(buffer));
+
+       buffer.pServerName      = strdup (argv[1]);
+       buffer.pPrinterName = strdup (argv[2]);
+       buffer.pShareName       = strdup (argv[3]);
+       buffer.pPortName        = strdup (argv[4]);
+       buffer.pDriverName      = strdup ("Apple LaserWriter II NTX v51.8");
+       buffer.pPrintProcessor  = strdup ("winprint");
+       buffer.pDatatype        = strdup ("RAW");
+       buffer.Attributes       = PRINTER_ATTRIBUTE_SHARED;
+       buffer.pSecurityDescriptor = NULL;
+
+
+       printf ("Attempting to add printer [%s] on server [%s]\n",
+               buffer.pPrinterName, buffer.pServerName);
+       printf ("\nPrinter Info 1:\n");
+       print_printer_info_2 (&buffer);
+       printf ("\n");
+
+       printer = AddPrinter (buffer.pServerName, 2, (LPBYTE)(&buffer));
+       if ( printer == NULL)
+       {
+               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
+                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
+                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+                       (LPTSTR) &lpMsgBuf, 0, NULL);
+               printf ("ERROR : %s\n", (char*)lpMsgBuf);
+               LocalFree (lpMsgBuf);
+       }
+       else
+       {
+               printf ("Printer [%s] added successfully on server [%s]!\n",
+                       buffer.pPrinterName, buffer.pServerName);
+               if (!ClosePrinter (printer))
+                       fprintf (stderr, "Error closing printer handle!\n");
+               else
+                       printf ("Printer handle closed successfully.\n");
+       }
+
+       return 0;
+
+}
index 32e0cfd..67ed17b 100644 (file)
@@ -1,38 +1,38 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       LPVOID  lpMsgBuf;\r
-\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       if (!AddPrinterConnection(argv[1]))\r
-       {\r
-               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | \r
-                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),\r
-                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language\r
-                       (LPTSTR) &lpMsgBuf, 0, NULL);\r
-               printf ("ERROR : %s\n", (char*)lpMsgBuf);\r
-               LocalFree (lpMsgBuf);\r
-       }\r
-       else\r
-       {\r
-               printf ("Successfully established connection to [%s].\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+
+
+int main (int argc, char* argv[])
+{
+
+       LPVOID  lpMsgBuf;
+
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+
+       if (!AddPrinterConnection(argv[1]))
+       {
+               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
+                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
+                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+                       (LPTSTR) &lpMsgBuf, 0, NULL);
+               printf ("ERROR : %s\n", (char*)lpMsgBuf);
+               LocalFree (lpMsgBuf);
+       }
+       else
+       {
+               printf ("Successfully established connection to [%s].\n", argv[1]);
+       }
+
+       return 0;
+
 }
\ No newline at end of file
index 88d74f2..787a626 100644 (file)
@@ -1,60 +1,60 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-/* we assume the necessary driver files are already uploaded\r
-   on the server.  We also only exercise The info level 3\r
-   since that is the one used by the NT Add Printer Wizard */\r
-int main (int argc, char* argv[])\r
-{\r
-       DRIVER_INFO_3   buffer3;\r
-       BYTE                    pDependentFiles[] = { "PSCRIPT.HLP\0PSCRPTUI.DLL\0PSCRIPT.DLL\0LWNTX518.PPD\0\0" };\r
-       LPVOID                  lpMsgBuf;\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* we'll use the Apple LaserWriter II NTX v51.8 driver\r
-          for simplcity */\r
-       buffer3.cVersion                = 2;\r
-       buffer3.pEnvironment    = strdup("Windows NT x86");\r
-       buffer3.pName                   = strdup("Apple LaserWriter II NTX v51.8");\r
-       buffer3.pDriverPath             = strdup("pscript.dll");\r
-       buffer3.pDataFile               = strdup("lwntx518.ppd");\r
-       buffer3.pConfigFile             = strdup("pscriptui.dll");\r
-       buffer3.pDependentFiles = pDependentFiles;\r
-       buffer3.pHelpFile               = strdup("pscript.hlp");\r
-       buffer3.pMonitorName    = NULL;\r
-       buffer3.pDefaultDataType = strdup("RAW");\r
-\r
-       printf ("Attempting to add Driver Info Level 3 :\n");\r
-       print_driver_info_3 (&buffer3);\r
-       printf ("\n");\r
-\r
-\r
-       if (!AddPrinterDriver(argv[1], 3, (LPBYTE)&buffer3))\r
-       {\r
-               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | \r
-                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),\r
-                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language\r
-                       (LPTSTR) &lpMsgBuf, 0, NULL);\r
-               printf ("ERROR : %s\n", (char*)lpMsgBuf);\r
-               LocalFree (lpMsgBuf);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer Driver installed successfully\n");\r
-       }\r
-\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+/* we assume the necessary driver files are already uploaded
+   on the server.  We also only exercise The info level 3
+   since that is the one used by the NT Add Printer Wizard */
+int main (int argc, char* argv[])
+{
+       DRIVER_INFO_3   buffer3;
+       BYTE                    pDependentFiles[] = { "PSCRIPT.HLP\0PSCRPTUI.DLL\0PSCRIPT.DLL\0LWNTX518.PPD\0\0" };
+       LPVOID                  lpMsgBuf;
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <servername>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* we'll use the Apple LaserWriter II NTX v51.8 driver
+          for simplcity */
+       buffer3.cVersion                = 2;
+       buffer3.pEnvironment    = strdup("Windows NT x86");
+       buffer3.pName                   = strdup("Apple LaserWriter II NTX v51.8");
+       buffer3.pDriverPath             = strdup("pscript.dll");
+       buffer3.pDataFile               = strdup("lwntx518.ppd");
+       buffer3.pConfigFile             = strdup("pscriptui.dll");
+       buffer3.pDependentFiles = pDependentFiles;
+       buffer3.pHelpFile               = strdup("pscript.hlp");
+       buffer3.pMonitorName    = NULL;
+       buffer3.pDefaultDataType = strdup("RAW");
+
+       printf ("Attempting to add Driver Info Level 3 :\n");
+       print_driver_info_3 (&buffer3);
+       printf ("\n");
+
+
+       if (!AddPrinterDriver(argv[1], 3, (LPBYTE)&buffer3))
+       {
+               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
+                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
+                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+                       (LPTSTR) &lpMsgBuf, 0, NULL);
+               printf ("ERROR : %s\n", (char*)lpMsgBuf);
+               LocalFree (lpMsgBuf);
+       }
+       else
+       {
+               printf ("Printer Driver installed successfully\n");
+       }
+
+
+       return 0;
+
 }
\ No newline at end of file
index 1377855..fc375be 100644 (file)
@@ -1,57 +1,57 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-/* we assume the necessary driver files are already uploaded\r
-   on the server.  We also only exercise The info level 6\r
-   since that is the one used by the Win2k Add Printer Wizard */\r
-int main (int argc, char* argv[])\r
-{\r
-       DRIVER_INFO_6   buffer;\r
-       BYTE                    pDependentFiles[] = { "PSCRIPT.HLP\0PSCRPTUI.DLL\0PSCRIPT.DLL\0LWNTX518.PPD\0\0" };\r
-       LPVOID                  lpMsgBuf;\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* we'll use the Apple LaserWriter II NTX v51.8 driver\r
-          for simplcity */\r
-       memset( &buffer, 0, sizeof(DRIVER_INFO_6) );\r
-\r
-       buffer.cVersion                 = 0;\r
-       buffer.pEnvironment             = strdup("Windows NT x86");\r
-       buffer.pName                    = strdup("Apple LaserWriter II NTX v51.8");\r
-       buffer.pDriverPath              = strdup("pscript.dll");\r
-       buffer.pDataFile                = strdup("lwntx518.ppd");\r
-       buffer.pConfigFile              = strdup("pscriptui.dll");\r
-       buffer.pDependentFiles  = pDependentFiles;\r
-       buffer.pHelpFile                = strdup("pscript.hlp");\r
-       buffer.pDefaultDataType = strdup("RAW");\r
-\r
-       printf ("Attempting to add Driver Info Level 6 :\n");\r
-       print_driver_info_6 (&buffer);\r
-       printf ("\n");\r
-\r
-\r
-       if (!AddPrinterDriverEx(argv[1], 6, (LPBYTE)&buffer, APD_COPY_ALL_FILES))\r
-               PrintLastError();\r
-       else\r
-               printf ("Printer Driver installed successfully\n");\r
-\r
-       if (!AddPrinterDriver(argv[1], 6, (LPBYTE)&buffer))\r
-               PrintLastError();\r
-       else\r
-               printf ("Printer Driver installed successfully\n");\r
-\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+/* we assume the necessary driver files are already uploaded
+   on the server.  We also only exercise The info level 6
+   since that is the one used by the Win2k Add Printer Wizard */
+int main (int argc, char* argv[])
+{
+       DRIVER_INFO_6   buffer;
+       BYTE                    pDependentFiles[] = { "PSCRIPT.HLP\0PSCRPTUI.DLL\0PSCRIPT.DLL\0LWNTX518.PPD\0\0" };
+       LPVOID                  lpMsgBuf;
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <servername>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* we'll use the Apple LaserWriter II NTX v51.8 driver
+          for simplcity */
+       memset( &buffer, 0, sizeof(DRIVER_INFO_6) );
+
+       buffer.cVersion                 = 0;
+       buffer.pEnvironment             = strdup("Windows NT x86");
+       buffer.pName                    = strdup("Apple LaserWriter II NTX v51.8");
+       buffer.pDriverPath              = strdup("pscript.dll");
+       buffer.pDataFile                = strdup("lwntx518.ppd");
+       buffer.pConfigFile              = strdup("pscriptui.dll");
+       buffer.pDependentFiles  = pDependentFiles;
+       buffer.pHelpFile                = strdup("pscript.hlp");
+       buffer.pDefaultDataType = strdup("RAW");
+
+       printf ("Attempting to add Driver Info Level 6 :\n");
+       print_driver_info_6 (&buffer);
+       printf ("\n");
+
+
+       if (!AddPrinterDriverEx(argv[1], 6, (LPBYTE)&buffer, APD_COPY_ALL_FILES))
+               PrintLastError();
+       else
+               printf ("Printer Driver installed successfully\n");
+
+       if (!AddPrinterDriver(argv[1], 6, (LPBYTE)&buffer))
+               PrintLastError();
+       else
+               printf ("Printer Driver installed successfully\n");
+
+
+       return 0;
+
 }
\ No newline at end of file
index 52c1ee2..2df4b65 100644 (file)
@@ -1,67 +1,66 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include <string.h>\r
-#include "printlib.h"\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       PRINTER_INFO_2          buffer;\r
-       HANDLE                          printer;\r
-       LPVOID                          lpMsgBuf;\r
-       \r
-       if (argc < 5)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername> <printername> <sharename> <port name>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       memset(&buffer, 0 , sizeof(buffer));\r
-\r
-       buffer.pServerName      = strdup (argv[1]);\r
-       buffer.pPrinterName = strdup (argv[2]);\r
-       buffer.pShareName       = strdup (argv[3]);\r
-       buffer.pPortName        = strdup (argv[4]);\r
-       buffer.pDriverName      = strdup ("Apple LaserWriter II NTX v51.8");\r
-       buffer.pPrintProcessor  = strdup ("winprint");\r
-       buffer.pDatatype        = strdup ("RAW");\r
-       buffer.Attributes       = PRINTER_ATTRIBUTE_SHARED;\r
-       buffer.pSecurityDescriptor = NULL;\r
-\r
-\r
-       printf ("Attempting to add printer [%s] on server [%s]\n", \r
-               buffer.pPrinterName, buffer.pServerName);\r
-       printf ("\nPrinter Info 1:\n");\r
-       print_printer_info_2 (&buffer);\r
-       printf ("\n");\r
-\r
-       printer = AddPrinter (buffer.pServerName, 2, (LPBYTE)(&buffer));\r
-       if ( printer == NULL)\r
-       {\r
-               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | \r
-                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),\r
-                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language\r
-                       (LPTSTR) &lpMsgBuf, 0, NULL);\r
-               printf ("ERROR : %s\n", (char*)lpMsgBuf);\r
-               LocalFree (lpMsgBuf);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] added successfully on server [%s]!\n",\r
-                       buffer.pPrinterName, buffer.pServerName);\r
-               if (!ClosePrinter (printer))\r
-                       fprintf (stderr, "Error closing printer handle!\n");\r
-               else\r
-                       printf ("Printer handle closed successfully.\n");\r
-       }\r
-\r
-       return 0;\r
-\r
-}\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "printlib.h"
+
+
+int main (int argc, char* argv[])
+{
+       PRINTER_INFO_2          buffer;
+       HANDLE                          printer;
+       LPVOID                          lpMsgBuf;
+
+       if (argc < 5)
+       {
+               fprintf (stderr, "useage: %s <servername> <printername> <sharename> <port name>\n", argv[0]);
+               exit (-1);
+       }
+
+       memset(&buffer, 0 , sizeof(buffer));
+
+       buffer.pServerName      = strdup (argv[1]);
+       buffer.pPrinterName = strdup (argv[2]);
+       buffer.pShareName       = strdup (argv[3]);
+       buffer.pPortName        = strdup (argv[4]);
+       buffer.pDriverName      = strdup ("Apple LaserWriter II NTX v51.8");
+       buffer.pPrintProcessor  = strdup ("winprint");
+       buffer.pDatatype        = strdup ("RAW");
+       buffer.Attributes       = PRINTER_ATTRIBUTE_SHARED;
+       buffer.pSecurityDescriptor = NULL;
+
+
+       printf ("Attempting to add printer [%s] on server [%s]\n",
+               buffer.pPrinterName, buffer.pServerName);
+       printf ("\nPrinter Info 1:\n");
+       print_printer_info_2 (&buffer);
+       printf ("\n");
+
+       printer = AddPrinter (buffer.pServerName, 2, (LPBYTE)(&buffer));
+       if ( printer == NULL)
+       {
+               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
+                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
+                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+                       (LPTSTR) &lpMsgBuf, 0, NULL);
+               printf ("ERROR : %s\n", (char*)lpMsgBuf);
+               LocalFree (lpMsgBuf);
+       }
+       else
+       {
+               printf ("Printer [%s] added successfully on server [%s]!\n",
+                       buffer.pPrinterName, buffer.pServerName);
+               if (!ClosePrinter (printer))
+                       fprintf (stderr, "Error closing printer handle!\n");
+               else
+                       printf ("Printer handle closed successfully.\n");
+       }
+
+       return 0;
+
+}
index 5adea0c..0e78e50 100644 (file)
@@ -1,64 +1,64 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                  printer;\r
-       LPVOID                  lpMsgBuf;\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername> <form name>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* open the printer */\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-       }\r
-\r
-       printf ("Attempting to remove %s...\n", argv[2]);\r
-       if (!DeleteForm(printer, (LPTSTR)argv[2]))\r
-       {\r
-               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | \r
-                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),\r
-                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language\r
-                       (LPTSTR) &lpMsgBuf, 0, NULL);\r
-               printf ("ERROR : %s\n", (char*)lpMsgBuf);\r
-               LocalFree (lpMsgBuf);\r
-       }\r
-       else\r
-       {\r
-               printf ("Form removed successfully!\n");\r
-       }\r
-       printf ("\n");\r
-\r
-\r
-       /* close the printer */\r
-       if (!ClosePrinter(printer))\r
-       {\r
-               fprintf (stderr, "Error closing printer!\n");\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                  printer;
+       LPVOID                  lpMsgBuf;
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername> <form name>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* open the printer */
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+       }
+
+       printf ("Attempting to remove %s...\n", argv[2]);
+       if (!DeleteForm(printer, (LPTSTR)argv[2]))
+       {
+               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
+                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
+                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+                       (LPTSTR) &lpMsgBuf, 0, NULL);
+               printf ("ERROR : %s\n", (char*)lpMsgBuf);
+               LocalFree (lpMsgBuf);
+       }
+       else
+       {
+               printf ("Form removed successfully!\n");
+       }
+       printf ("\n");
+
+
+       /* close the printer */
+       if (!ClosePrinter(printer))
+       {
+               fprintf (stderr, "Error closing printer!\n");
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+       }
+
+       return 0;
+
 }
\ No newline at end of file
index 8b8348c..4a298ba 100644 (file)
@@ -1,60 +1,60 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE  printer;\r
-       LPVOID  lpMsgBuf;\r
-\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-       }\r
-\r
-       if (!DeletePrinter(printer))\r
-       {\r
-               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | \r
-                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),\r
-                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language\r
-                       (LPTSTR) &lpMsgBuf, 0, NULL);\r
-               printf ("ERROR : %s\n", (char*)lpMsgBuf);\r
-               LocalFree (lpMsgBuf);\r
-\r
-               if (!ClosePrinter(printer))\r
-               {\r
-                       fprintf (stderr, "Error closing printer!\n");\r
-                       exit (-1);\r
-               }\r
-               else\r
-               {\r
-                       printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-               }\r
-\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] deleted successfully.\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE  printer;
+       LPVOID  lpMsgBuf;
+
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+       }
+
+       if (!DeletePrinter(printer))
+       {
+               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
+                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
+                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+                       (LPTSTR) &lpMsgBuf, 0, NULL);
+               printf ("ERROR : %s\n", (char*)lpMsgBuf);
+               LocalFree (lpMsgBuf);
+
+               if (!ClosePrinter(printer))
+               {
+                       fprintf (stderr, "Error closing printer!\n");
+                       exit (-1);
+               }
+               else
+               {
+                       printf ("Printer [%s] closed successfully.\n", argv[1]);
+               }
+
+       }
+       else
+       {
+               printf ("Printer [%s] deleted successfully.\n", argv[1]);
+       }
+
+       return 0;
+
 }
\ No newline at end of file
index 97f626b..957c103 100644 (file)
@@ -1,38 +1,38 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       LPVOID  lpMsgBuf;\r
-\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       if (!DeletePrinterConnection(argv[1]))\r
-       {\r
-               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | \r
-                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),\r
-                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language\r
-                       (LPTSTR) &lpMsgBuf, 0, NULL);\r
-               printf ("ERROR : %s\n", (char*)lpMsgBuf);\r
-               LocalFree (lpMsgBuf);\r
-       }\r
-       else\r
-       {\r
-               printf ("Successfully deleted connection to [%s].\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+
+
+int main (int argc, char* argv[])
+{
+
+       LPVOID  lpMsgBuf;
+
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+
+       if (!DeletePrinterConnection(argv[1]))
+       {
+               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
+                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
+                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+                       (LPTSTR) &lpMsgBuf, 0, NULL);
+               printf ("ERROR : %s\n", (char*)lpMsgBuf);
+               LocalFree (lpMsgBuf);
+       }
+       else
+       {
+               printf ("Successfully deleted connection to [%s].\n", argv[1]);
+       }
+
+       return 0;
+
 }
\ No newline at end of file
index 7508d2c..81d0eb0 100644 (file)
@@ -1,60 +1,60 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE  printer;\r
-       LPVOID  lpMsgBuf;\r
-\r
-\r
-       if (argc < 3)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername> <data name>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-       }\r
-\r
-       if (DeletePrinterData(printer, argv[2]) != ERROR_SUCCESS)\r
-       {\r
-               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | \r
-                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),\r
-                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language\r
-                       (LPTSTR) &lpMsgBuf, 0, NULL);\r
-               printf ("ERROR : %s\n", (char*)lpMsgBuf);\r
-               LocalFree (lpMsgBuf);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer Data [%s] deleted successfully\n", argv[2]);\r
-       }\r
-\r
-\r
-       if (!ClosePrinter(printer))\r
-       {\r
-               fprintf (stderr, "Error closing printer!\n");\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE  printer;
+       LPVOID  lpMsgBuf;
+
+
+       if (argc < 3)
+       {
+               fprintf (stderr, "useage: %s <printername> <data name>\n", argv[0]);
+               exit (-1);
+       }
+
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+       }
+
+       if (DeletePrinterData(printer, argv[2]) != ERROR_SUCCESS)
+       {
+               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
+                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
+                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+                       (LPTSTR) &lpMsgBuf, 0, NULL);
+               printf ("ERROR : %s\n", (char*)lpMsgBuf);
+               LocalFree (lpMsgBuf);
+       }
+       else
+       {
+               printf ("Printer Data [%s] deleted successfully\n", argv[2]);
+       }
+
+
+       if (!ClosePrinter(printer))
+       {
+               fprintf (stderr, "Error closing printer!\n");
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+       }
+
+       return 0;
+
 }
\ No newline at end of file
index 6a580ff..e3101d1 100644 (file)
@@ -1,42 +1,42 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE  printer;\r
-\r
-\r
-       if (argc < 3)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername> <data name>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* open the server */\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-               PrintLastError();\r
-       else\r
-               printf ("Server [%s] opened successfully.\n\n", argv[1]);\r
-\r
-       if (DeletePrinterDataEx(printer, "DsSpool", argv[2]) != ERROR_SUCCESS)\r
-               PrintLastError();\r
-       else\r
-               printf ("Printer Data [%s] deleted successfully\n", argv[2]);\r
-\r
-\r
-       if (!ClosePrinter(printer))\r
-               PrintLastError();\r
-       else\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE  printer;
+
+
+       if (argc < 3)
+       {
+               fprintf (stderr, "useage: %s <printername> <data name>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* open the server */
+       if (!OpenPrinter (argv[1], &printer, NULL))
+               PrintLastError();
+       else
+               printf ("Server [%s] opened successfully.\n\n", argv[1]);
+
+       if (DeletePrinterDataEx(printer, "DsSpool", argv[2]) != ERROR_SUCCESS)
+               PrintLastError();
+       else
+               printf ("Printer Data [%s] deleted successfully\n", argv[2]);
+
+
+       if (!ClosePrinter(printer))
+               PrintLastError();
+       else
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+
+       return 0;
+
 }
\ No newline at end of file
index 48c4f7b..cddad64 100644 (file)
@@ -1,41 +1,41 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-/* we assume the necessary driver files are already uploaded\r
-   on the server.  We also only exercise The info level 3\r
-   since that is the one used by the NT Add Printer Wizard */\r
-int main (int argc, char* argv[])\r
-{\r
-       LPVOID                  lpMsgBuf;\r
-\r
-       if (argc < 3)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername> <arch> <driver name>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-\r
-       if (!DeletePrinterDriver(argv[1], argv[2], argv[3]))\r
-       {\r
-               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | \r
-                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),\r
-                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language\r
-                       (LPTSTR) &lpMsgBuf, 0, NULL);\r
-               printf ("ERROR : %s\n", (char*)lpMsgBuf);\r
-               LocalFree (lpMsgBuf);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer Driver deleted successfully\n");\r
-       }\r
-\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+/* we assume the necessary driver files are already uploaded
+   on the server.  We also only exercise The info level 3
+   since that is the one used by the NT Add Printer Wizard */
+int main (int argc, char* argv[])
+{
+       LPVOID                  lpMsgBuf;
+
+       if (argc < 3)
+       {
+               fprintf (stderr, "useage: %s <servername> <arch> <driver name>\n", argv[0]);
+               exit (-1);
+       }
+
+
+       if (!DeletePrinterDriver(argv[1], argv[2], argv[3]))
+       {
+               FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
+                       FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
+                       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+                       (LPTSTR) &lpMsgBuf, 0, NULL);
+               printf ("ERROR : %s\n", (char*)lpMsgBuf);
+               LocalFree (lpMsgBuf);
+       }
+       else
+       {
+               printf ("Printer Driver deleted successfully\n");
+       }
+
+
+       return 0;
+
 }
\ No newline at end of file
index d67491b..73fbcc4 100644 (file)
@@ -1,32 +1,32 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include "printlib.h"\r
-\r
-/* we assume the necessary driver files are already uploaded\r
-   on the server.  We also only exercise The info level 3\r
-   since that is the one used by the NT Add Printer Wizard */\r
-int main (int argc, char* argv[])\r
-{\r
-       LPVOID                  lpMsgBuf;\r
-\r
-       if (argc < 3)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername> <arch> <driver name> <version>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-\r
-       if (!DeletePrinterDriverEx( argv[1], argv[2], argv[3], DPD_DELETE_SPECIFIC_VERSION|DPD_DELETE_UNUSED_FILES, atoi(argv[4]) ) ) \r
-               PrintLastError();\r
-       else\r
-               printf ("Printer Driver deleted successfully\n");\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "printlib.h"
+
+/* we assume the necessary driver files are already uploaded
+   on the server.  We also only exercise The info level 3
+   since that is the one used by the NT Add Printer Wizard */
+int main (int argc, char* argv[])
+{
+       LPVOID                  lpMsgBuf;
+
+       if (argc < 3)
+       {
+               fprintf (stderr, "useage: %s <servername> <arch> <driver name> <version>\n", argv[0]);
+               exit (-1);
+       }
+
+
+       if (!DeletePrinterDriverEx( argv[1], argv[2], argv[3], DPD_DELETE_SPECIFIC_VERSION|DPD_DELETE_UNUSED_FILES, atoi(argv[4]) ) )
+               PrintLastError();
+       else
+               printf ("Printer Driver deleted successfully\n");
+
+       return 0;
+
 }
\ No newline at end of file
index ffc5b04..2a30482 100644 (file)
@@ -1,48 +1,48 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include "printlib.h"\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                  printer;\r
-       DWORD                   returned=0, \r
-                                       status;\r
-       LPTSTR                  buffer = NULL;\r
-\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* open the server */\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-               PrintLastError();\r
-       else\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-\r
-\r
-       status = DeletePrinterKey(printer, "PrinterDriverData");\r
-       if (status != ERROR_SUCCESS)\r
-               PrintLastError();\r
-       else\r
-               printf ("Success!\n");\r
-\r
-\r
-       /* close the server */\r
-       if (!ClosePrinter(printer))\r
-               PrintLastError();\r
-       else\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-\r
-       return 0;\r
-\r
-}\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "printlib.h"
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                  printer;
+       DWORD                   returned=0,
+                                       status;
+       LPTSTR                  buffer = NULL;
+
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* open the server */
+       if (!OpenPrinter (argv[1], &printer, NULL))
+               PrintLastError();
+       else
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+
+
+       status = DeletePrinterKey(printer, "PrinterDriverData");
+       if (status != ERROR_SUCCESS)
+               PrintLastError();
+       else
+               printf ("Success!\n");
+
+
+       /* close the server */
+       if (!ClosePrinter(printer))
+               PrintLastError();
+       else
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+
+       return 0;
+
+}
index 03d553b..ccab24d 100644 (file)
@@ -1,73 +1,73 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <string.h>\r
-#include <stdlib.h>\r
-#include "printlib.h"\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE  printer;\r
-       DOC_INFO_1      buffer;\r
-       LPVOID  lpMsgBuf;\r
-\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-       }\r
-\r
-       buffer.pDocName         = strdup("Testing StartDocPrinter");\r
-       buffer.pDatatype        = strdup("RAW");\r
-       buffer.pOutputFile      = NULL;\r
-\r
-       printf ("Attempting to call StartDocPrinter() using DOC_INFO_1 :\n");\r
-       print_doc_info_1 (&buffer);\r
-       printf ("\n");\r
-\r
-       if (StartDocPrinter (printer, 1, (LPBYTE)&buffer))\r
-               printf ("Document spooled sucessfully\n");\r
-       else\r
-               PrintLastError();\r
-       printf ("\n");\r
-\r
-\r
-       printf ("Attempting to call EndDocPrinter\n");\r
-       if (EndDocPrinter (printer))\r
-               printf ("Document removed from spool sucessfully\n");\r
-       else\r
-               PrintLastError();\r
-       printf ("\n");\r
-\r
-\r
-\r
-       if (!ClosePrinter(printer))\r
-       {\r
-               fprintf (stderr, "Error closing printer!\n");\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "printlib.h"
+
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE  printer;
+       DOC_INFO_1      buffer;
+       LPVOID  lpMsgBuf;
+
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+       }
+
+       buffer.pDocName         = strdup("Testing StartDocPrinter");
+       buffer.pDatatype        = strdup("RAW");
+       buffer.pOutputFile      = NULL;
+
+       printf ("Attempting to call StartDocPrinter() using DOC_INFO_1 :\n");
+       print_doc_info_1 (&buffer);
+       printf ("\n");
+
+       if (StartDocPrinter (printer, 1, (LPBYTE)&buffer))
+               printf ("Document spooled sucessfully\n");
+       else
+               PrintLastError();
+       printf ("\n");
+
+
+       printf ("Attempting to call EndDocPrinter\n");
+       if (EndDocPrinter (printer))
+               printf ("Document removed from spool sucessfully\n");
+       else
+               PrintLastError();
+       printf ("\n");
+
+
+
+       if (!ClosePrinter(printer))
+       {
+               fprintf (stderr, "Error closing printer!\n");
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+       }
+
+       return 0;
+
 }
\ No newline at end of file
index 30add77..104b439 100644 (file)
@@ -1,76 +1,76 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                  printer;\r
-       DWORD                   returned, needed, i;\r
-       PFORM_INFO_1    buffer1 = NULL;\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* open the printer */\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-       }\r
-\r
-       /* INFO LEVEL 1 */\r
-       EnumForms(printer, 1, (LPBYTE)buffer1, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               fprintf (stderr, "Error getting form information for [%s] using NULL buffer.\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-\r
-       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for FORM_INFO_1 buffer!\n");\r
-               exit (-1);\r
-       }\r
-       if (!EnumForms(printer, 1, (LPBYTE)buffer1, needed, &needed, &returned))\r
-       {\r
-               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n", \r
-                            argv[1], needed);\r
-               exit (-1);\r
-       }\r
-\r
-       printf ("Form Info Level 1:\n");\r
-       for (i=0; i<returned; i++)\r
-       {\r
-               print_form_info_1 (&buffer1[i]);\r
-               printf ("\n");\r
-       }\r
-       free (buffer1);\r
-\r
-\r
-       /* close the printer */\r
-       if (!ClosePrinter(printer))\r
-       {\r
-               fprintf (stderr, "Error closing printer!\n");\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                  printer;
+       DWORD                   returned, needed, i;
+       PFORM_INFO_1    buffer1 = NULL;
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* open the printer */
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+       }
+
+       /* INFO LEVEL 1 */
+       EnumForms(printer, 1, (LPBYTE)buffer1, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               fprintf (stderr, "Error getting form information for [%s] using NULL buffer.\n", argv[1]);
+               exit (-1);
+       }
+
+       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for FORM_INFO_1 buffer!\n");
+               exit (-1);
+       }
+       if (!EnumForms(printer, 1, (LPBYTE)buffer1, needed, &needed, &returned))
+       {
+               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n",
+                            argv[1], needed);
+               exit (-1);
+       }
+
+       printf ("Form Info Level 1:\n");
+       for (i=0; i<returned; i++)
+       {
+               print_form_info_1 (&buffer1[i]);
+               printf ("\n");
+       }
+       free (buffer1);
+
+
+       /* close the printer */
+       if (!ClosePrinter(printer))
+       {
+               fprintf (stderr, "Error closing printer!\n");
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+       }
+
+       return 0;
+
 }
\ No newline at end of file
index 426e864..cc3629b 100644 (file)
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-#define START_JOB      0\r
-#define MAX_JOBS       100\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                  printer;\r
-       DWORD                   returned, needed, i;\r
-       PJOB_INFO_1             buffer1 = NULL;\r
-       PJOB_INFO_2             buffer2 = NULL;\r
-\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* open the printer */\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-       }\r
-\r
-       /* INFO LEVEL 1 */\r
-       EnumJobs(printer, START_JOB, MAX_JOBS, 1, (LPBYTE)buffer1, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               if (needed != 0)\r
-               {\r
-                       fprintf (stderr, "Error getting job information for [%s] using NULL buffer.\n", argv[2]);\r
-                       exit (-1);\r
-               }\r
-               else\r
-               {\r
-                       printf ("Info Level 1 : No jobs returned for [%s]\n", argv[1]);\r
-                       ClosePrinter (printer);\r
-                       exit (0);\r
-               }\r
-       }\r
-\r
-       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for JOB_INFO_1 buffer!\n");\r
-               exit (-1);\r
-       }\r
-       if (!EnumJobs(printer, START_JOB, MAX_JOBS, 1, (LPBYTE)buffer1, needed, &needed, &returned))\r
-       {\r
-               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n", \r
-                            argv[2], needed);\r
-               exit (-1);\r
-       }\r
-\r
-       printf ("Job Info Level 1:\n");\r
-       for (i=0; i<returned; i++)\r
-       {\r
-               print_job_info_1 (&buffer1[i]);\r
-       }\r
-       printf ("\n");\r
-       free (buffer1);\r
-\r
-\r
-       /* INFO LEVEL 2 */\r
-       EnumJobs(printer, START_JOB, MAX_JOBS, 2, (LPBYTE)buffer2, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               if (needed != 0)\r
-               {\r
-                       fprintf (stderr, "Error getting job information for [%s] using NULL buffer.\n", argv[2]);\r
-                       exit (-1);\r
-               }\r
-               else\r
-               {\r
-                       printf ("Info Level 2 : No jobs returned for [%s]\n", argv[1]);\r
-                       ClosePrinter (printer);\r
-                       exit (0);\r
-               }\r
-       }\r
-\r
-       if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for JOB_INFO_2 buffer!\n");\r
-               exit (-1);\r
-       }\r
-       if (!EnumJobs(printer, START_JOB, MAX_JOBS, 2, (LPBYTE)buffer2, needed, &needed, &returned))\r
-       {\r
-               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n", \r
-                            argv[2], needed);\r
-               exit (-1);\r
-       }\r
-\r
-       printf ("Job Info Level 2:\n");\r
-       for (i=0; i<returned; i++)\r
-       {\r
-               print_job_info_2 (&buffer2[i]);\r
-       }\r
-       printf ("\n");\r
-       free (buffer2);\r
-\r
-\r
-       /* close the printer */\r
-       if (!ClosePrinter(printer))\r
-       {\r
-               fprintf (stderr, "Error closing printer!\n");\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
-}\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+#define START_JOB      0
+#define MAX_JOBS       100
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                  printer;
+       DWORD                   returned, needed, i;
+       PJOB_INFO_1             buffer1 = NULL;
+       PJOB_INFO_2             buffer2 = NULL;
+
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* open the printer */
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+       }
+
+       /* INFO LEVEL 1 */
+       EnumJobs(printer, START_JOB, MAX_JOBS, 1, (LPBYTE)buffer1, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               if (needed != 0)
+               {
+                       fprintf (stderr, "Error getting job information for [%s] using NULL buffer.\n", argv[2]);
+                       exit (-1);
+               }
+               else
+               {
+                       printf ("Info Level 1 : No jobs returned for [%s]\n", argv[1]);
+                       ClosePrinter (printer);
+                       exit (0);
+               }
+       }
+
+       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for JOB_INFO_1 buffer!\n");
+               exit (-1);
+       }
+       if (!EnumJobs(printer, START_JOB, MAX_JOBS, 1, (LPBYTE)buffer1, needed, &needed, &returned))
+       {
+               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n",
+                            argv[2], needed);
+               exit (-1);
+       }
+
+       printf ("Job Info Level 1:\n");
+       for (i=0; i<returned; i++)
+       {
+               print_job_info_1 (&buffer1[i]);
+       }
+       printf ("\n");
+       free (buffer1);
+
+
+       /* INFO LEVEL 2 */
+       EnumJobs(printer, START_JOB, MAX_JOBS, 2, (LPBYTE)buffer2, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               if (needed != 0)
+               {
+                       fprintf (stderr, "Error getting job information for [%s] using NULL buffer.\n", argv[2]);
+                       exit (-1);
+               }
+               else
+               {
+                       printf ("Info Level 2 : No jobs returned for [%s]\n", argv[1]);
+                       ClosePrinter (printer);
+                       exit (0);
+               }
+       }
+
+       if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for JOB_INFO_2 buffer!\n");
+               exit (-1);
+       }
+       if (!EnumJobs(printer, START_JOB, MAX_JOBS, 2, (LPBYTE)buffer2, needed, &needed, &returned))
+       {
+               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n",
+                            argv[2], needed);
+               exit (-1);
+       }
+
+       printf ("Job Info Level 2:\n");
+       for (i=0; i<returned; i++)
+       {
+               print_job_info_2 (&buffer2[i]);
+       }
+       printf ("\n");
+       free (buffer2);
+
+
+       /* close the printer */
+       if (!ClosePrinter(printer))
+       {
+               fprintf (stderr, "Error closing printer!\n");
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+       }
+
+       return 0;
+
+}
index 78c4d7f..e254cb6 100644 (file)
@@ -1,83 +1,83 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       DWORD                   returned, needed, i;\r
-       PMONITOR_INFO_1 buffer1 = NULL;\r
-       PMONITOR_INFO_2 buffer2 = NULL;\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* INFO LEVEL 1 */\r
-       needed = returned = 0;\r
-       EnumMonitors(argv[1], 1, (LPBYTE)buffer1, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               fprintf (stderr, "Error getting monitor information for [%s] using NULL buffer.\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-\r
-       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for MONITOR_INFO_1 buffer!\n");\r
-               exit (-1);\r
-       }\r
-       if (!EnumMonitors(argv[1], 1, (LPBYTE)buffer1, needed, &needed, &returned))\r
-       {\r
-               fprintf (stderr, "Error getting monitor information for [%s].\nSize of buffer = %d\n", \r
-                            argv[1], needed);\r
-               exit (-1);\r
-       }\r
-\r
-       printf ("Monitor Info Level 1:\n");\r
-       for (i=0; i<returned; i++)\r
-       {\r
-               print_monitor_info_1(&buffer1[i]);\r
-       }\r
-       free (buffer1);\r
-\r
-       /* INFO LEVEL 2 */\r
-       needed = returned = 0;\r
-       EnumMonitors(argv[1], 2, (LPBYTE)buffer2, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               fprintf (stderr, "Error getting monitor information for [%s] using NULL buffer.\n", argv[1], argv[2]);\r
-               exit (-1);\r
-       }\r
-\r
-       if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for MONITOR_INFO_2 buffer!\n");\r
-               exit (-1);\r
-       }\r
-       if (!EnumMonitors(argv[1], 2, (LPBYTE)buffer2, needed, &needed, &returned))\r
-       {\r
-               fprintf (stderr, "Error getting monitor information for [%s].\nSize of buffer = %d\n", \r
-                            argv[1], needed);\r
-               exit (-1);\r
-       }\r
-\r
-       printf ("Monitor Info Level 2:\n");\r
-       for (i=0; i<returned; i++)\r
-       {\r
-               print_monitor_info_2(&buffer2[i]);\r
-       }\r
-       free (buffer2);\r
-\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+
+int main (int argc, char* argv[])
+{
+
+       DWORD                   returned, needed, i;
+       PMONITOR_INFO_1 buffer1 = NULL;
+       PMONITOR_INFO_2 buffer2 = NULL;
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <servername>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* INFO LEVEL 1 */
+       needed = returned = 0;
+       EnumMonitors(argv[1], 1, (LPBYTE)buffer1, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               fprintf (stderr, "Error getting monitor information for [%s] using NULL buffer.\n", argv[1]);
+               exit (-1);
+       }
+
+       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for MONITOR_INFO_1 buffer!\n");
+               exit (-1);
+       }
+       if (!EnumMonitors(argv[1], 1, (LPBYTE)buffer1, needed, &needed, &returned))
+       {
+               fprintf (stderr, "Error getting monitor information for [%s].\nSize of buffer = %d\n",
+                            argv[1], needed);
+               exit (-1);
+       }
+
+       printf ("Monitor Info Level 1:\n");
+       for (i=0; i<returned; i++)
+       {
+               print_monitor_info_1(&buffer1[i]);
+       }
+       free (buffer1);
+
+       /* INFO LEVEL 2 */
+       needed = returned = 0;
+       EnumMonitors(argv[1], 2, (LPBYTE)buffer2, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               fprintf (stderr, "Error getting monitor information for [%s] using NULL buffer.\n", argv[1], argv[2]);
+               exit (-1);
+       }
+
+       if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for MONITOR_INFO_2 buffer!\n");
+               exit (-1);
+       }
+       if (!EnumMonitors(argv[1], 2, (LPBYTE)buffer2, needed, &needed, &returned))
+       {
+               fprintf (stderr, "Error getting monitor information for [%s].\nSize of buffer = %d\n",
+                            argv[1], needed);
+               exit (-1);
+       }
+
+       printf ("Monitor Info Level 2:\n");
+       for (i=0; i<returned; i++)
+       {
+               print_monitor_info_2(&buffer2[i]);
+       }
+       free (buffer2);
+
+
+       return 0;
+
 }
\ No newline at end of file
index 9e8fb3a..4ee8ffc 100644 (file)
@@ -1,88 +1,88 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       DWORD                   returned, needed, i;\r
-       PPORT_INFO_1    buffer1 = NULL;\r
-       PPORT_INFO_2    buffer2 = NULL;\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* INFO LEVEL 1 */\r
-       needed = returned = 0;\r
-       EnumPorts(argv[1], 1, (LPBYTE)buffer1, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               fprintf (stderr, "Error getting port information for [%s] using NULL buffer.\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-\r
-       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for PORT_INFO_1 buffer!\n");\r
-               exit (-1);\r
-       }\r
-       if (!EnumPorts(argv[1], 1, (LPBYTE)buffer1, needed, &needed, &returned))\r
-       {\r
-               fprintf (stderr, "Error getting port information for [%s].\nSize of buffer = %d\n", \r
-                            argv[1], needed);\r
-               exit (-1);\r
-       }\r
-\r
-       printf ("Port Info Level 1:\n");\r
-       for (i=0; i<returned; i++)\r
-       {\r
-               printf ("\tPort Name\t= %s\n", buffer1[i].pName);\r
-               printf ("\n");\r
-       }\r
-       free (buffer1);\r
-\r
-       /* INFO LEVEL 2 */\r
-       needed = returned = 0;\r
-       EnumPorts(argv[1], 2, (LPBYTE)buffer2, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               fprintf (stderr, "Error getting port information for [%s] using NULL buffer.\n", argv[1], argv[2]);\r
-               exit (-1);\r
-       }\r
-\r
-       if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for PORT_INFO_2 buffer!\n");\r
-               exit (-1);\r
-       }\r
-       if (!EnumPorts(argv[1], 2, (LPBYTE)buffer2, needed, &needed, &returned))\r
-       {\r
-               fprintf (stderr, "Error getting port information for [%s].\nSize of buffer = %d\n", \r
-                            argv[1], needed);\r
-               exit (-1);\r
-       }\r
-\r
-       printf ("Port Info Level 2:\n");\r
-       for (i=0; i<returned; i++)\r
-       {\r
-               printf ("\tPort Name\t= %s\n",          buffer2[i].pPortName);\r
-               printf ("\tMonitor Name\t= %s\n",       buffer2[i].pMonitorName);\r
-               printf ("\tDescription\t= %s\n",        buffer2[i].pDescription);\r
-               printf ("\tType\t\t= 0x%x\n",           buffer2[i].fPortType);\r
-               printf ("\tReserved\t= %d\n",           buffer2[i].Reserved);\r
-               printf ("\n");\r
-       }\r
-       free (buffer2);\r
-\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+
+
+int main (int argc, char* argv[])
+{
+
+       DWORD                   returned, needed, i;
+       PPORT_INFO_1    buffer1 = NULL;
+       PPORT_INFO_2    buffer2 = NULL;
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <servername>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* INFO LEVEL 1 */
+       needed = returned = 0;
+       EnumPorts(argv[1], 1, (LPBYTE)buffer1, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               fprintf (stderr, "Error getting port information for [%s] using NULL buffer.\n", argv[1]);
+               exit (-1);
+       }
+
+       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for PORT_INFO_1 buffer!\n");
+               exit (-1);
+       }
+       if (!EnumPorts(argv[1], 1, (LPBYTE)buffer1, needed, &needed, &returned))
+       {
+               fprintf (stderr, "Error getting port information for [%s].\nSize of buffer = %d\n",
+                            argv[1], needed);
+               exit (-1);
+       }
+
+       printf ("Port Info Level 1:\n");
+       for (i=0; i<returned; i++)
+       {
+               printf ("\tPort Name\t= %s\n", buffer1[i].pName);
+               printf ("\n");
+       }
+       free (buffer1);
+
+       /* INFO LEVEL 2 */
+       needed = returned = 0;
+       EnumPorts(argv[1], 2, (LPBYTE)buffer2, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               fprintf (stderr, "Error getting port information for [%s] using NULL buffer.\n", argv[1], argv[2]);
+               exit (-1);
+       }
+
+       if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for PORT_INFO_2 buffer!\n");
+               exit (-1);
+       }
+       if (!EnumPorts(argv[1], 2, (LPBYTE)buffer2, needed, &needed, &returned))
+       {
+               fprintf (stderr, "Error getting port information for [%s].\nSize of buffer = %d\n",
+                            argv[1], needed);
+               exit (-1);
+       }
+
+       printf ("Port Info Level 2:\n");
+       for (i=0; i<returned; i++)
+       {
+               printf ("\tPort Name\t= %s\n",          buffer2[i].pPortName);
+               printf ("\tMonitor Name\t= %s\n",       buffer2[i].pMonitorName);
+               printf ("\tDescription\t= %s\n",        buffer2[i].pDescription);
+               printf ("\tType\t\t= 0x%x\n",           buffer2[i].fPortType);
+               printf ("\tReserved\t= %d\n",           buffer2[i].Reserved);
+               printf ("\n");
+       }
+       free (buffer2);
+
+
+       return 0;
+
 }
\ No newline at end of file
index 671e056..0116b0d 100644 (file)
@@ -1,62 +1,61 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-\r
-#define NUM_ARCH       5\r
-const LPTSTR arch [NUM_ARCH] = {       "Windows 4.0",\r
-                                                       "Windows NT x86",\r
-                                                       "Windows NT R4000",\r
-                                                       "Windows NT PowerPC",\r
-                                                       "Windows NT Alpha_AXP"  };\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       DWORD   needed, returned, j;\r
-       PDATATYPES_INFO_1       buffer1 = NULL;\r
-       \r
-       if (argc < 3)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername> <print processor>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* INFO LEVEL 1 */\r
-       needed = returned = 0;\r
-       EnumPrintProcessorDatatypes(argv[1], argv[2], 1, (LPBYTE)buffer1, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               if (needed != 0)\r
-                       fprintf (stderr, "Error EnumPrintProcessorDatetypes Info Level 1 for [%s] using NULL buffer.\n", argv[1]);\r
-               else\r
-                       printf ("Info level 1 returned no information\n");\r
-       }\r
-       else\r
-       {\r
-               if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for buffer!\n");\r
-                       exit (-1);\r
-               }\r
-               if (!EnumPrintProcessorDatatypes(argv[1], argv[2], 1, (LPBYTE)buffer1, needed, &needed, &returned))\r
-               {\r
-                       fprintf (stderr, "Error enumerating print processor Info Level 1 for [%s].\nSize of buffer = %d\n", \r
-                                       argv[1], needed);\r
-               }\r
-                       printf ("Datatypes Info Level 1\n");\r
-               for (j=0; j<returned; j++)\r
-               {\r
-                       printf ("\tDatatype \t= %s\n", buffer1[j].pName);\r
-               }\r
-               free (buffer1);\r
-       }\r
-\r
-\r
-\r
-       return 0;\r
-\r
-}\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+
+#define NUM_ARCH       5
+const LPTSTR arch [NUM_ARCH] = {       "Windows 4.0",
+                                                       "Windows NT x86",
+                                                       "Windows NT R4000",
+                                                       "Windows NT PowerPC",
+                                                       "Windows NT Alpha_AXP"  };
+
+int main (int argc, char* argv[])
+{
+       DWORD   needed, returned, j;
+       PDATATYPES_INFO_1       buffer1 = NULL;
+
+       if (argc < 3)
+       {
+               fprintf (stderr, "useage: %s <servername> <print processor>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* INFO LEVEL 1 */
+       needed = returned = 0;
+       EnumPrintProcessorDatatypes(argv[1], argv[2], 1, (LPBYTE)buffer1, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               if (needed != 0)
+                       fprintf (stderr, "Error EnumPrintProcessorDatetypes Info Level 1 for [%s] using NULL buffer.\n", argv[1]);
+               else
+                       printf ("Info level 1 returned no information\n");
+       }
+       else
+       {
+               if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for buffer!\n");
+                       exit (-1);
+               }
+               if (!EnumPrintProcessorDatatypes(argv[1], argv[2], 1, (LPBYTE)buffer1, needed, &needed, &returned))
+               {
+                       fprintf (stderr, "Error enumerating print processor Info Level 1 for [%s].\nSize of buffer = %d\n",
+                                       argv[1], needed);
+               }
+                       printf ("Datatypes Info Level 1\n");
+               for (j=0; j<returned; j++)
+               {
+                       printf ("\tDatatype \t= %s\n", buffer1[j].pName);
+               }
+               free (buffer1);
+       }
+
+
+
+       return 0;
+
+}
index 5a675cf..d3eba7e 100644 (file)
@@ -1,63 +1,62 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-#define NUM_ARCH       5\r
-const LPTSTR arch [NUM_ARCH] = {       "Windows 4.0",\r
-                                                       "Windows NT x86",\r
-                                                       "Windows NT R4000",\r
-                                                       "Windows NT PowerPC",\r
-                                                       "Windows NT Alpha_AXP"  };\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       DWORD   needed, returned, i, j;\r
-       PPRINTPROCESSOR_INFO_1  buffer1 = NULL;\r
-       \r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       for (i=0; i<NUM_ARCH; i++)\r
-       {\r
-               printf ("[%s]\n", arch[i]);\r
-\r
-               needed = 0;\r
-               EnumPrintProcessors(argv[1], arch[i], 1, (LPBYTE)buffer1, 0, &needed, &returned);\r
-               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-               {\r
-                       fprintf (stderr, "Error EnumPrintProcessors Info Level 1 for [%s] using NULL buffer.\n", argv[1]);\r
-                       continue;\r
-               }\r
-\r
-               if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for buffer!\n");\r
-                       exit (-1);\r
-               }\r
-               if (!EnumPrintProcessors(argv[1], arch[i], 1, (LPBYTE)buffer1, needed, &needed, &returned))\r
-               {\r
-                       fprintf (stderr, "Error getting print processor information for [%s].\nSize of buffer = %d\n", \r
-                                       argv[1], needed);\r
-               }\r
-               printf ("Print Processor Info 1:\n");\r
-               for (j=0; j<returned; j++)\r
-               {\r
-                       print_printprocessor_info_1 (&buffer1[j]);\r
-                       printf ("\n");\r
-               }\r
-               free (buffer1);\r
-       }\r
-\r
-\r
-       return 0;\r
-\r
-}\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+#define NUM_ARCH       5
+const LPTSTR arch [NUM_ARCH] = {       "Windows 4.0",
+                                                       "Windows NT x86",
+                                                       "Windows NT R4000",
+                                                       "Windows NT PowerPC",
+                                                       "Windows NT Alpha_AXP"  };
+
+int main (int argc, char* argv[])
+{
+       DWORD   needed, returned, i, j;
+       PPRINTPROCESSOR_INFO_1  buffer1 = NULL;
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <servername>\n", argv[0]);
+               exit (-1);
+       }
+
+       for (i=0; i<NUM_ARCH; i++)
+       {
+               printf ("[%s]\n", arch[i]);
+
+               needed = 0;
+               EnumPrintProcessors(argv[1], arch[i], 1, (LPBYTE)buffer1, 0, &needed, &returned);
+               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+               {
+                       fprintf (stderr, "Error EnumPrintProcessors Info Level 1 for [%s] using NULL buffer.\n", argv[1]);
+                       continue;
+               }
+
+               if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for buffer!\n");
+                       exit (-1);
+               }
+               if (!EnumPrintProcessors(argv[1], arch[i], 1, (LPBYTE)buffer1, needed, &needed, &returned))
+               {
+                       fprintf (stderr, "Error getting print processor information for [%s].\nSize of buffer = %d\n",
+                                       argv[1], needed);
+               }
+               printf ("Print Processor Info 1:\n");
+               for (j=0; j<returned; j++)
+               {
+                       print_printprocessor_info_1 (&buffer1[j]);
+                       printf ("\n");
+               }
+               free (buffer1);
+       }
+
+
+       return 0;
+
+}
index d50a653..51154e9 100644 (file)
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include "printlib.h"\r
-\r
-#define START_JOB      0\r
-#define MAX_JOBS       100\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                  printer;\r
-       DWORD                   dwIndex, pcbValue, type, pcbData;\r
-       DWORD                   pcbMaxValue, pcbMaxData;\r
-       LPTSTR                  pValueName = NULL;\r
-       LPBYTE                  pData = NULL;\r
-       DWORD                   i, status;\r
-\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* open the printer */\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-               PrintLastError();\r
-       else\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-\r
-       dwIndex = 0;\r
-       status = ERROR_SUCCESS;\r
-\r
-       pcbMaxValue = pcbMaxData = 0;\r
-       status=EnumPrinterData(printer, dwIndex, pValueName, 0, &pcbMaxValue, &type, pData, 0, &pcbMaxData);\r
-       printf ("\tMax Size of Value = %d\n", pcbMaxValue);\r
-       printf ("\tMax Size of Data  = %d\n", pcbMaxData);\r
-       printf("\n");\r
-       if (status != ERROR_SUCCESS)\r
-       {\r
-               PrintLastError();\r
-               exit (-1);\r
-       }\r
-\r
-       if ((pValueName = (LPTSTR)malloc(pcbMaxValue)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for Value Name!\n");\r
-               exit (-1);\r
-       }\r
-       if ((pData = (LPBYTE)malloc(pcbMaxData)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for Value Data!\n");\r
-               exit (-1);\r
-       }\r
-\r
-\r
-       while (status != ERROR_NO_MORE_ITEMS)\r
-       {\r
-               pcbValue = pcbData = 0;\r
-               status = EnumPrinterData(printer, dwIndex, pValueName, pcbMaxValue, &pcbValue, &type, pData, pcbMaxData, &pcbData);\r
-               PrintLastError();\r
-               if (status == ERROR_SUCCESS)\r
-               {\r
-                       printf ("\tValue Name [size] = %s [%d]\n", pValueName, pcbValue);\r
-                       printf ("\tType = %d\n", type);\r
-                       printf ("\tData = 0x%x [%d] bytes\n", pcbData, pcbData);\r
-                       i = 0;\r
-                       while (i < pcbData)\r
-                       {\r
-                               printf ("\t0x%x", *(pData++));\r
-                               if (i%4 == 3)\r
-                                       printf ("\n");\r
-                               i++;\r
-                       }\r
-                       printf ("\n");\r
-               }\r
-\r
-               dwIndex++;\r
-       }\r
-       printf ("\n");\r
-\r
-#if 0\r
-       free (pValueName);\r
-       free (pData);\r
-#endif\r
-\r
-\r
-       /* close the printer */\r
-       if (!ClosePrinter(printer))\r
-               PrintLastError();\r
-       else\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-\r
-       return 0;\r
-\r
-}\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "printlib.h"
+
+#define START_JOB      0
+#define MAX_JOBS       100
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                  printer;
+       DWORD                   dwIndex, pcbValue, type, pcbData;
+       DWORD                   pcbMaxValue, pcbMaxData;
+       LPTSTR                  pValueName = NULL;
+       LPBYTE                  pData = NULL;
+       DWORD                   i, status;
+
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* open the printer */
+       if (!OpenPrinter (argv[1], &printer, NULL))
+               PrintLastError();
+       else
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+
+       dwIndex = 0;
+       status = ERROR_SUCCESS;
+
+       pcbMaxValue = pcbMaxData = 0;
+       status=EnumPrinterData(printer, dwIndex, pValueName, 0, &pcbMaxValue, &type, pData, 0, &pcbMaxData);
+       printf ("\tMax Size of Value = %d\n", pcbMaxValue);
+       printf ("\tMax Size of Data  = %d\n", pcbMaxData);
+       printf("\n");
+       if (status != ERROR_SUCCESS)
+       {
+               PrintLastError();
+               exit (-1);
+       }
+
+       if ((pValueName = (LPTSTR)malloc(pcbMaxValue)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for Value Name!\n");
+               exit (-1);
+       }
+       if ((pData = (LPBYTE)malloc(pcbMaxData)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for Value Data!\n");
+               exit (-1);
+       }
+
+
+       while (status != ERROR_NO_MORE_ITEMS)
+       {
+               pcbValue = pcbData = 0;
+               status = EnumPrinterData(printer, dwIndex, pValueName, pcbMaxValue, &pcbValue, &type, pData, pcbMaxData, &pcbData);
+               PrintLastError();
+               if (status == ERROR_SUCCESS)
+               {
+                       printf ("\tValue Name [size] = %s [%d]\n", pValueName, pcbValue);
+                       printf ("\tType = %d\n", type);
+                       printf ("\tData = 0x%x [%d] bytes\n", pcbData, pcbData);
+                       i = 0;
+                       while (i < pcbData)
+                       {
+                               printf ("\t0x%x", *(pData++));
+                               if (i%4 == 3)
+                                       printf ("\n");
+                               i++;
+                       }
+                       printf ("\n");
+               }
+
+               dwIndex++;
+       }
+       printf ("\n");
+
+#if 0
+       free (pValueName);
+       free (pData);
+#endif
+
+
+       /* close the printer */
+       if (!ClosePrinter(printer))
+               PrintLastError();
+       else
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+
+       return 0;
+
+}
index 0c18372..8d13ea8 100644 (file)
@@ -1,69 +1,69 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include "printlib.h"\r
-\r
-\r
-#define ENUM_KEY_NAME  "PrinterDriverData"\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                  printer;\r
-       DWORD                   i, status, needed, returned;\r
-       PRINTER_ENUM_VALUES     *buffer = NULL;\r
-\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* open the server */\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-               PrintLastError();\r
-       else\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-\r
-\r
-       needed = returned = 0;\r
-       status = EnumPrinterDataEx(printer, ENUM_KEY_NAME, (LPBYTE)buffer, 0, &needed, &returned);\r
-       if (status == ERROR_MORE_DATA)\r
-       {\r
-               if ((buffer = malloc(needed)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc enough space for [%d] bytes\n", needed);\r
-                       exit (-1);\r
-               }\r
-\r
-               status = EnumPrinterDataEx(printer, ENUM_KEY_NAME, (LPBYTE)buffer, needed, &needed, &returned);\r
-               if (status == ERROR_SUCCESS)\r
-               {\r
-                       printf ("Printer Enum Values :\n");\r
-                       for (i=0; i<returned; i++)\r
-                       {\r
-                               print_printer_enum_values (&buffer[i]);\r
-                               printf ("\n");\r
-                       }\r
-               }\r
-               free (buffer);\r
-       }\r
-       else if (status != ERROR_SUCCESS)\r
-               PrintLastError();\r
-\r
-\r
-       /* close the server */\r
-       if (!ClosePrinter(printer))\r
-               PrintLastError();\r
-       else\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-\r
-       return 0;\r
-\r
-}\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "printlib.h"
+
+
+#define ENUM_KEY_NAME  "PrinterDriverData"
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                  printer;
+       DWORD                   i, status, needed, returned;
+       PRINTER_ENUM_VALUES     *buffer = NULL;
+
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* open the server */
+       if (!OpenPrinter (argv[1], &printer, NULL))
+               PrintLastError();
+       else
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+
+
+       needed = returned = 0;
+       status = EnumPrinterDataEx(printer, ENUM_KEY_NAME, (LPBYTE)buffer, 0, &needed, &returned);
+       if (status == ERROR_MORE_DATA)
+       {
+               if ((buffer = malloc(needed)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc enough space for [%d] bytes\n", needed);
+                       exit (-1);
+               }
+
+               status = EnumPrinterDataEx(printer, ENUM_KEY_NAME, (LPBYTE)buffer, needed, &needed, &returned);
+               if (status == ERROR_SUCCESS)
+               {
+                       printf ("Printer Enum Values :\n");
+                       for (i=0; i<returned; i++)
+                       {
+                               print_printer_enum_values (&buffer[i]);
+                               printf ("\n");
+                       }
+               }
+               free (buffer);
+       }
+       else if (status != ERROR_SUCCESS)
+               PrintLastError();
+
+
+       /* close the server */
+       if (!ClosePrinter(printer))
+               PrintLastError();
+       else
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+
+       return 0;
+
+}
index 7ba58e5..3063f01 100644 (file)
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-\r
-#define NUM_ARCH       5\r
-const LPTSTR arch [NUM_ARCH] = {       "Windows 4.0",\r
-                                                       "Windows NT x86",\r
-                                                       "Windows NT R4000",\r
-                                                       "Windows NT PowerPC",\r
-                                                       "Windows NT Alpha_AXP"  };\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       DWORD   needed, returned, i, j;\r
-       PDRIVER_INFO_1  buffer1 = NULL;\r
-       PDRIVER_INFO_2  buffer2 = NULL;\r
-       PDRIVER_INFO_3  buffer3 = NULL;\r
-       \r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       for (i=0; i<NUM_ARCH; i++)\r
-       {\r
-               printf ("\n\n[%s]\n", arch[i]);\r
-\r
-               /* INFO LEVEL 1 */\r
-               needed = returned = 0;\r
-               EnumPrinterDrivers(argv[1], arch[i], 1, (LPBYTE)buffer1, 0, &needed, &returned);\r
-               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-               {\r
-                       if (needed != 0)\r
-                               fprintf (stderr, "Error EnumPrinterDrivers Info Level 1 for [%s] using NULL buffer.\n", argv[1]);\r
-                       else\r
-                               printf ("Info level 1 returned no information\n");\r
-               }\r
-               else\r
-               {\r
-                       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)\r
-                       {\r
-                               fprintf (stderr, "Unable to malloc memory for buffer!\n");\r
-                               exit (-1);\r
-                       }\r
-                       if (!EnumPrinterDrivers(argv[1], arch[i], 1, (LPBYTE)buffer1, needed, &needed, &returned))\r
-                       {\r
-                               fprintf (stderr, "Error enumerating printer drivers Info Level 1 for [%s].\nSize of buffer = %d\n", \r
-                                               argv[1], needed);\r
-                       }\r
-\r
-                       printf ("Driver Info Level 1\n");\r
-                       for (j=0; j<returned; j++)\r
-                       {\r
-                               printf ("\tDriver Name\t= %s\n\n", buffer1[j].pName);\r
-                               printf ("\n");\r
-                       }\r
-                       free (buffer1);\r
-               }\r
-\r
-               /* INFO LEVEL 2 */\r
-               needed = returned = 0;\r
-               EnumPrinterDrivers(argv[1], arch[i], 2, (LPBYTE)buffer2, 0, &needed, &returned);\r
-               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-               {\r
-                       if (needed != 0)\r
-                               fprintf (stderr, "Error EnumPrinterDrivers Info Level 2 for [%s] using NULL buffer.\n", argv[1]);\r
-                       else\r
-                               printf ("Info level 2 returned no information\n");\r
-               }\r
-               else\r
-               {\r
-                       if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)\r
-                       {\r
-                               fprintf (stderr, "Unable to malloc memory for buffer!\n");\r
-                               exit (-1);\r
-                       }\r
-                       if (!EnumPrinterDrivers(argv[1], arch[i], 2, (LPBYTE)buffer2, needed, &needed, &returned))\r
-                       {\r
-                               fprintf (stderr, "Error enumerating printer drivers Info Level 2 for [%s].\nSize of buffer = %d\n", \r
-                                               argv[1], needed);\r
-                       }\r
-\r
-                       printf ("\nDriver Info Level 2\n");\r
-                       for (j=0; j<returned; j++)\r
-                       {\r
-                               printf ("\tDriver Name\t= %s\n",        buffer2[j].pName);\r
-                               printf ("\tEnvironment\t= %s\n",        buffer2[j].pEnvironment);\r
-                               printf ("\tVersion\t\t= %d\n",          buffer2[j].cVersion);\r
-                               printf ("\tDriver Path\t= %s\n",        buffer2[j].pDriverPath);\r
-                               printf ("\tData File\t= %s\n",          buffer2[j].pDataFile);\r
-                               printf ("\tConfig File\t= %s\n\n",      buffer2[j].pConfigFile);\r
-                               printf ("\n");\r
-                       }\r
-                       free (buffer2);\r
-               }\r
-\r
-               /* INFO LEVEL 3 */\r
-               needed = returned = 0;\r
-               EnumPrinterDrivers(argv[1], arch[i], 3, (LPBYTE)buffer3, 0, &needed, &returned);\r
-               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-               {\r
-                       if (needed != 0)\r
-                               fprintf (stderr, "Error EnumPrinterDrivers Info Level 3 for [%s] using NULL buffer.\n", argv[1]);\r
-                       else\r
-                               printf ("Info level 3 returned no information\n");\r
-               }\r
-               else\r
-               {\r
-                       if ((buffer3 = (LPBYTE)malloc(needed)) == NULL)\r
-                       {\r
-                               fprintf (stderr, "Unable to malloc memory for buffer!\n");\r
-                               exit (-1);\r
-                       }\r
-                       if (!EnumPrinterDrivers(argv[1], arch[i], 3, (LPBYTE)buffer3, needed, &needed, &returned))\r
-                       {\r
-                               fprintf (stderr, "Error enumerating printer drivers Info Level 3 for [%s].\nSize of buffer = %d\n", \r
-                                               argv[1], needed);\r
-                       }\r
-\r
-                       printf ("\nDriver Info Level 3\n");\r
-                       for (j=0; j<returned; j++)\r
-                       {\r
-                               char*   ptr;\r
-\r
-                               printf ("\tDriver Name\t= %s\n",        buffer3[j].pName);\r
-                               printf ("\tEnvironment\t= %s\n",        buffer3[j].pEnvironment);\r
-                               printf ("\tVersion\t\t= %d\n",          buffer3[j].cVersion);\r
-                               printf ("\tDriver Path\t= %s\n",        buffer3[j].pDriverPath);\r
-                               printf ("\tData File\t= %s\n",          buffer3[j].pDataFile);\r
-                               printf ("\tConfig File\t= %s\n",        buffer3[j].pConfigFile);\r
-                               printf ("\tHelp Path\t= %s\n",          buffer3[j].pHelpFile);\r
-                               printf ("\tMonitor Name\t= %s\n",       buffer3[j].pMonitorName);\r
-                               printf ("\tData Type\t= %s\n",          buffer3[j].pDefaultDataType);\r
-                               ptr = (char*)buffer3->pDependentFiles;\r
-                               while (*ptr != '\0')\r
-                               {\r
-                                       printf ("\tDependent Files\t= %s\n", ptr);\r
-                                       for (;*ptr != '\0'; ptr++)\r
-                                               /* printf ("%s\n", ptr); */\r
-                                               ;\r
-                                       ptr++;\r
-                               }\r
-\r
-                               printf ("\n");\r
-                       }\r
-                       free (buffer3);\r
-               }\r
-\r
-       }\r
-\r
-\r
-       return 0;\r
-\r
-}\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+
+#define NUM_ARCH       5
+const LPTSTR arch [NUM_ARCH] = {       "Windows 4.0",
+                                                       "Windows NT x86",
+                                                       "Windows NT R4000",
+                                                       "Windows NT PowerPC",
+                                                       "Windows NT Alpha_AXP"  };
+
+int main (int argc, char* argv[])
+{
+       DWORD   needed, returned, i, j;
+       PDRIVER_INFO_1  buffer1 = NULL;
+       PDRIVER_INFO_2  buffer2 = NULL;
+       PDRIVER_INFO_3  buffer3 = NULL;
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <servername>\n", argv[0]);
+               exit (-1);
+       }
+
+       for (i=0; i<NUM_ARCH; i++)
+       {
+               printf ("\n\n[%s]\n", arch[i]);
+
+               /* INFO LEVEL 1 */
+               needed = returned = 0;
+               EnumPrinterDrivers(argv[1], arch[i], 1, (LPBYTE)buffer1, 0, &needed, &returned);
+               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+               {
+                       if (needed != 0)
+                               fprintf (stderr, "Error EnumPrinterDrivers Info Level 1 for [%s] using NULL buffer.\n", argv[1]);
+                       else
+                               printf ("Info level 1 returned no information\n");
+               }
+               else
+               {
+                       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)
+                       {
+                               fprintf (stderr, "Unable to malloc memory for buffer!\n");
+                               exit (-1);
+                       }
+                       if (!EnumPrinterDrivers(argv[1], arch[i], 1, (LPBYTE)buffer1, needed, &needed, &returned))
+                       {
+                               fprintf (stderr, "Error enumerating printer drivers Info Level 1 for [%s].\nSize of buffer = %d\n",
+                                               argv[1], needed);
+                       }
+
+                       printf ("Driver Info Level 1\n");
+                       for (j=0; j<returned; j++)
+                       {
+                               printf ("\tDriver Name\t= %s\n\n", buffer1[j].pName);
+                               printf ("\n");
+                       }
+                       free (buffer1);
+               }
+
+               /* INFO LEVEL 2 */
+               needed = returned = 0;
+               EnumPrinterDrivers(argv[1], arch[i], 2, (LPBYTE)buffer2, 0, &needed, &returned);
+               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+               {
+                       if (needed != 0)
+                               fprintf (stderr, "Error EnumPrinterDrivers Info Level 2 for [%s] using NULL buffer.\n", argv[1]);
+                       else
+                               printf ("Info level 2 returned no information\n");
+               }
+               else
+               {
+                       if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)
+                       {
+                               fprintf (stderr, "Unable to malloc memory for buffer!\n");
+                               exit (-1);
+                       }
+                       if (!EnumPrinterDrivers(argv[1], arch[i], 2, (LPBYTE)buffer2, needed, &needed, &returned))
+                       {
+                               fprintf (stderr, "Error enumerating printer drivers Info Level 2 for [%s].\nSize of buffer = %d\n",
+                                               argv[1], needed);
+                       }
+
+                       printf ("\nDriver Info Level 2\n");
+                       for (j=0; j<returned; j++)
+                       {
+                               printf ("\tDriver Name\t= %s\n",        buffer2[j].pName);
+                               printf ("\tEnvironment\t= %s\n",        buffer2[j].pEnvironment);
+                               printf ("\tVersion\t\t= %d\n",          buffer2[j].cVersion);
+                               printf ("\tDriver Path\t= %s\n",        buffer2[j].pDriverPath);
+                               printf ("\tData File\t= %s\n",          buffer2[j].pDataFile);
+                               printf ("\tConfig File\t= %s\n\n",      buffer2[j].pConfigFile);
+                               printf ("\n");
+                       }
+                       free (buffer2);
+               }
+
+               /* INFO LEVEL 3 */
+               needed = returned = 0;
+               EnumPrinterDrivers(argv[1], arch[i], 3, (LPBYTE)buffer3, 0, &needed, &returned);
+               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+               {
+                       if (needed != 0)
+                               fprintf (stderr, "Error EnumPrinterDrivers Info Level 3 for [%s] using NULL buffer.\n", argv[1]);
+                       else
+                               printf ("Info level 3 returned no information\n");
+               }
+               else
+               {
+                       if ((buffer3 = (LPBYTE)malloc(needed)) == NULL)
+                       {
+                               fprintf (stderr, "Unable to malloc memory for buffer!\n");
+                               exit (-1);
+                       }
+                       if (!EnumPrinterDrivers(argv[1], arch[i], 3, (LPBYTE)buffer3, needed, &needed, &returned))
+                       {
+                               fprintf (stderr, "Error enumerating printer drivers Info Level 3 for [%s].\nSize of buffer = %d\n",
+                                               argv[1], needed);
+                       }
+
+                       printf ("\nDriver Info Level 3\n");
+                       for (j=0; j<returned; j++)
+                       {
+                               char*   ptr;
+
+                               printf ("\tDriver Name\t= %s\n",        buffer3[j].pName);
+                               printf ("\tEnvironment\t= %s\n",        buffer3[j].pEnvironment);
+                               printf ("\tVersion\t\t= %d\n",          buffer3[j].cVersion);
+                               printf ("\tDriver Path\t= %s\n",        buffer3[j].pDriverPath);
+                               printf ("\tData File\t= %s\n",          buffer3[j].pDataFile);
+                               printf ("\tConfig File\t= %s\n",        buffer3[j].pConfigFile);
+                               printf ("\tHelp Path\t= %s\n",          buffer3[j].pHelpFile);
+                               printf ("\tMonitor Name\t= %s\n",       buffer3[j].pMonitorName);
+                               printf ("\tData Type\t= %s\n",          buffer3[j].pDefaultDataType);
+                               ptr = (char*)buffer3->pDependentFiles;
+                               while (*ptr != '\0')
+                               {
+                                       printf ("\tDependent Files\t= %s\n", ptr);
+                                       for (;*ptr != '\0'; ptr++)
+                                               /* printf ("%s\n", ptr); */
+                                               ;
+                                       ptr++;
+                               }
+
+                               printf ("\n");
+                       }
+                       free (buffer3);
+               }
+
+       }
+
+
+       return 0;
+
+}
index 97de8a8..dedbe36 100644 (file)
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include "printlib.h"\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                  printer;\r
-       DWORD                   returned=0, \r
-                                       status;\r
-       LPTSTR                  buffer = NULL;\r
-\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* open the server */\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-               PrintLastError();\r
-       else\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-\r
-\r
-       status = EnumPrinterKey(printer, "", buffer, 0, &returned);\r
-       if (status == ERROR_MORE_DATA)\r
-       {\r
-               if ((buffer = (LPTSTR)malloc(returned)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc enough space for [%d] bytes\n", returned);\r
-                       exit (-1);\r
-               }\r
-\r
-               status = EnumPrinterKey(printer, "", buffer, returned, &returned);\r
-               if (status == ERROR_SUCCESS)\r
-               {\r
-                       LPTSTR  p = NULL;\r
-\r
-                       printf ("Enumurated Key Values : [%d]\n", returned);\r
-\r
-                       p = buffer;     \r
-                       while (*p)\r
-                       { \r
-                               printf ("\t%s\n", p);\r
-                               for (; *p; p=CharNext(p));\r
-                               p=CharNext(p);\r
-                       }\r
-\r
-               }\r
-               free (buffer);\r
-\r
-       }\r
-       else if (status != ERROR_SUCCESS)\r
-               PrintLastError();\r
-       else\r
-               printf ("No data!\n");\r
-\r
-       returned = 0;\r
-       status = EnumPrinterKey(printer, "PrinterDriverData", buffer, 0, &returned);\r
-       if (status == ERROR_MORE_DATA)\r
-       {\r
-               if ((buffer = (LPTSTR)malloc(returned)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc enough space for [%d] bytes\n", returned);\r
-                       exit (-1);\r
-               }\r
-\r
-               status = EnumPrinterKey(printer, "PrinterDriverData", buffer, returned, &returned);\r
-               if (status == ERROR_SUCCESS)\r
-               {\r
-                       LPTSTR  p = NULL;\r
-\r
-                       printf ("Enumurated Key Values : [%d]\n", returned);\r
-\r
-                       p = buffer;     \r
-                       while (*p)\r
-                       { \r
-                               printf ("\t%s\n", p);\r
-                               for (p = buffer; *p; p=CharNext(p));\r
-                               p=CharNext(p);\r
-                       }\r
-\r
-               }\r
-               free (buffer);\r
-\r
-       }\r
-       else if (status != ERROR_SUCCESS)\r
-               PrintLastError();\r
-       else\r
-               printf ("No data!\n");\r
-\r
-\r
-\r
-\r
-\r
-\r
-       /* close the server */\r
-       if (!ClosePrinter(printer))\r
-               PrintLastError();\r
-       else\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-\r
-       return 0;\r
-\r
-}\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "printlib.h"
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                  printer;
+       DWORD                   returned=0,
+                                       status;
+       LPTSTR                  buffer = NULL;
+
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* open the server */
+       if (!OpenPrinter (argv[1], &printer, NULL))
+               PrintLastError();
+       else
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+
+
+       status = EnumPrinterKey(printer, "", buffer, 0, &returned);
+       if (status == ERROR_MORE_DATA)
+       {
+               if ((buffer = (LPTSTR)malloc(returned)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc enough space for [%d] bytes\n", returned);
+                       exit (-1);
+               }
+
+               status = EnumPrinterKey(printer, "", buffer, returned, &returned);
+               if (status == ERROR_SUCCESS)
+               {
+                       LPTSTR  p = NULL;
+
+                       printf ("Enumurated Key Values : [%d]\n", returned);
+
+                       p = buffer;
+                       while (*p)
+                       {
+                               printf ("\t%s\n", p);
+                               for (; *p; p=CharNext(p));
+                               p=CharNext(p);
+                       }
+
+               }
+               free (buffer);
+
+       }
+       else if (status != ERROR_SUCCESS)
+               PrintLastError();
+       else
+               printf ("No data!\n");
+
+       returned = 0;
+       status = EnumPrinterKey(printer, "PrinterDriverData", buffer, 0, &returned);
+       if (status == ERROR_MORE_DATA)
+       {
+               if ((buffer = (LPTSTR)malloc(returned)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc enough space for [%d] bytes\n", returned);
+                       exit (-1);
+               }
+
+               status = EnumPrinterKey(printer, "PrinterDriverData", buffer, returned, &returned);
+               if (status == ERROR_SUCCESS)
+               {
+                       LPTSTR  p = NULL;
+
+                       printf ("Enumurated Key Values : [%d]\n", returned);
+
+                       p = buffer;
+                       while (*p)
+                       {
+                               printf ("\t%s\n", p);
+                               for (p = buffer; *p; p=CharNext(p));
+                               p=CharNext(p);
+                       }
+
+               }
+               free (buffer);
+
+       }
+       else if (status != ERROR_SUCCESS)
+               PrintLastError();
+       else
+               printf ("No data!\n");
+
+
+
+
+
+
+       /* close the server */
+       if (!ClosePrinter(printer))
+               PrintLastError();
+       else
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+
+       return 0;
+
+}
index 46d5a59..06f87e9 100644 (file)
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-\r
-void TestEnumPrinters (LPTSTR servername, DWORD flags)\r
-{\r
-       DWORD   needed, returned, i;\r
-       PPRINTER_INFO_1 buffer1 = NULL;\r
-       PPRINTER_INFO_2 buffer2 = NULL;\r
-       PPRINTER_INFO_4 buffer4 = NULL;\r
-       PPRINTER_INFO_5 buffer5 = NULL;\r
-\r
-       /* INFO LEVEL 1 */\r
-       needed = returned = 0;\r
-       EnumPrinters(flags, servername, 1, (LPBYTE)buffer1, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               if (needed != 0)\r
-                       fprintf (stderr, "Error EnumPrinters Info Level 1 for [%s] using NULL buffer.\n", servername);\r
-               else\r
-                       printf ("Info level 1 returned no information\n");\r
-       }\r
-       else\r
-       {\r
-               if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for buffer!\n");\r
-                       return;\r
-               }\r
-               if (!EnumPrinters(flags, servername, 1, (LPBYTE)buffer1, needed, &needed, &returned))\r
-               {\r
-                       fprintf (stderr, "Error enumerating printers Info Level 1 for [%s].\nSize of buffer = %d\n", \r
-                                       servername, needed);\r
-               }\r
-\r
-               printf ("Printer Info Level 1:\n");\r
-               for (i=0; i<returned; i++)\r
-               {\r
-                       print_printer_info_1 (&buffer1[i]);\r
-                       printf ("\n");\r
-               }\r
-               free (buffer1);\r
-       }\r
-\r
-       /* the following flags are only valid for info level 1 */\r
-       if ((flags == PRINTER_ENUM_REMOTE) || (flags == PRINTER_ENUM_NETWORK))\r
-               return;\r
-\r
-       /* INFO LEVEL 2 */\r
-       needed = returned = 0;\r
-       EnumPrinters(flags, servername, 2, (LPBYTE)buffer2, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               if (needed != 0)\r
-                       fprintf (stderr, "Error EnumPrinters Info Level 2 for [%s] using NULL buffer.\n", servername);\r
-               else\r
-                       printf ("Info level 2 returned no information\n");\r
-       }\r
-       else\r
-       {\r
-               if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for buffer!\n");\r
-                       return;\r
-               }\r
-               if (!EnumPrinters(flags, servername, 2, (LPBYTE)buffer2, needed, &needed, &returned))\r
-               {\r
-                       fprintf (stderr, "Error enumerating printers Info Level 2 for [%s].\nSize of buffer = %d\n", \r
-                                       servername, needed);\r
-               }\r
-\r
-               printf ("Printer Info Level 2:\n");\r
-               for (i=0; i<returned; i++)\r
-               {\r
-                       print_printer_info_2 (&buffer2[i]);\r
-                       printf ("\n");\r
-               }\r
-               free (buffer2);\r
-       }\r
-\r
-       /* INFO LEVEL 5 */\r
-       needed = returned = 0;\r
-       EnumPrinters(flags, servername, 5, (LPBYTE)buffer5, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               if (needed != 0)\r
-                       fprintf (stderr, "Error EnumPrinters Info Level 5 for [%s] using NULL buffer.\n", servername);\r
-               else\r
-                       printf ("Info level 5 returned no information\n");\r
-       }\r
-       else\r
-       {\r
-               if ((buffer5 = (LPBYTE)malloc(needed)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for buffer!\n");\r
-                       return;\r
-               }\r
-               if (!EnumPrinters(flags, servername, 5, (LPBYTE)buffer5, needed, &needed, &returned))\r
-               {\r
-                       fprintf (stderr, "Error enumerating printers Info Level 5 for [%s].\nSize of buffer = %d\n", \r
-                                       servername, needed);\r
-               }\r
-\r
-               printf ("Printer Info Level 5:\n");\r
-               for (i=0; i<returned; i++)\r
-               {\r
-                       print_printer_info_5 (&buffer5[i]);\r
-                       printf ("\n");\r
-               }\r
-               free (buffer5);\r
-       }\r
-\r
-}\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-#if 0\r
-       printf ("\n\nFlags = PRINTER_ENUM_NAME\n");\r
-       TestEnumPrinters (argv[1], PRINTER_ENUM_NAME);\r
-       printf ("\n");\r
-\r
-       printf ("\n\nFlags = PRINTER_ENUM_NAME | PRINTER_ENUM_SHARED\n");\r
-       TestEnumPrinters (argv[1], PRINTER_ENUM_NAME | PRINTER_ENUM_SHARED);\r
-       printf ("\n");\r
-#endif\r
-\r
-       printf ("\n\nFlags = PRINTER_ENUM_CONNECTIONS\n");\r
-       TestEnumPrinters (argv[1], PRINTER_ENUM_CONNECTIONS);\r
-       printf ("\n");\r
-\r
-       printf ("\n\nFlags = PRINTER_ENUM_NETWORK\n");\r
-       TestEnumPrinters (NULL, PRINTER_ENUM_NETWORK);\r
-       printf ("\n");\r
-\r
-       printf ("\n\nFlags = PRINTER_ENUM_REMOTE\n");\r
-       TestEnumPrinters (NULL, PRINTER_ENUM_REMOTE);\r
-       printf ("\n");\r
-\r
-\r
-       return 0;\r
-\r
-}\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+
+void TestEnumPrinters (LPTSTR servername, DWORD flags)
+{
+       DWORD   needed, returned, i;
+       PPRINTER_INFO_1 buffer1 = NULL;
+       PPRINTER_INFO_2 buffer2 = NULL;
+       PPRINTER_INFO_4 buffer4 = NULL;
+       PPRINTER_INFO_5 buffer5 = NULL;
+
+       /* INFO LEVEL 1 */
+       needed = returned = 0;
+       EnumPrinters(flags, servername, 1, (LPBYTE)buffer1, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               if (needed != 0)
+                       fprintf (stderr, "Error EnumPrinters Info Level 1 for [%s] using NULL buffer.\n", servername);
+               else
+                       printf ("Info level 1 returned no information\n");
+       }
+       else
+       {
+               if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for buffer!\n");
+                       return;
+               }
+               if (!EnumPrinters(flags, servername, 1, (LPBYTE)buffer1, needed, &needed, &returned))
+               {
+                       fprintf (stderr, "Error enumerating printers Info Level 1 for [%s].\nSize of buffer = %d\n",
+                                       servername, needed);
+               }
+
+               printf ("Printer Info Level 1:\n");
+               for (i=0; i<returned; i++)
+               {
+                       print_printer_info_1 (&buffer1[i]);
+                       printf ("\n");
+               }
+               free (buffer1);
+       }
+
+       /* the following flags are only valid for info level 1 */
+       if ((flags == PRINTER_ENUM_REMOTE) || (flags == PRINTER_ENUM_NETWORK))
+               return;
+
+       /* INFO LEVEL 2 */
+       needed = returned = 0;
+       EnumPrinters(flags, servername, 2, (LPBYTE)buffer2, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               if (needed != 0)
+                       fprintf (stderr, "Error EnumPrinters Info Level 2 for [%s] using NULL buffer.\n", servername);
+               else
+                       printf ("Info level 2 returned no information\n");
+       }
+       else
+       {
+               if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for buffer!\n");
+                       return;
+               }
+               if (!EnumPrinters(flags, servername, 2, (LPBYTE)buffer2, needed, &needed, &returned))
+               {
+                       fprintf (stderr, "Error enumerating printers Info Level 2 for [%s].\nSize of buffer = %d\n",
+                                       servername, needed);
+               }
+
+               printf ("Printer Info Level 2:\n");
+               for (i=0; i<returned; i++)
+               {
+                       print_printer_info_2 (&buffer2[i]);
+                       printf ("\n");
+               }
+               free (buffer2);
+       }
+
+       /* INFO LEVEL 5 */
+       needed = returned = 0;
+       EnumPrinters(flags, servername, 5, (LPBYTE)buffer5, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               if (needed != 0)
+                       fprintf (stderr, "Error EnumPrinters Info Level 5 for [%s] using NULL buffer.\n", servername);
+               else
+                       printf ("Info level 5 returned no information\n");
+       }
+       else
+       {
+               if ((buffer5 = (LPBYTE)malloc(needed)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for buffer!\n");
+                       return;
+               }
+               if (!EnumPrinters(flags, servername, 5, (LPBYTE)buffer5, needed, &needed, &returned))
+               {
+                       fprintf (stderr, "Error enumerating printers Info Level 5 for [%s].\nSize of buffer = %d\n",
+                                       servername, needed);
+               }
+
+               printf ("Printer Info Level 5:\n");
+               for (i=0; i<returned; i++)
+               {
+                       print_printer_info_5 (&buffer5[i]);
+                       printf ("\n");
+               }
+               free (buffer5);
+       }
+
+}
+
+
+int main (int argc, char* argv[])
+{
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <servername>\n", argv[0]);
+               exit (-1);
+       }
+#if 0
+       printf ("\n\nFlags = PRINTER_ENUM_NAME\n");
+       TestEnumPrinters (argv[1], PRINTER_ENUM_NAME);
+       printf ("\n");
+
+       printf ("\n\nFlags = PRINTER_ENUM_NAME | PRINTER_ENUM_SHARED\n");
+       TestEnumPrinters (argv[1], PRINTER_ENUM_NAME | PRINTER_ENUM_SHARED);
+       printf ("\n");
+#endif
+
+       printf ("\n\nFlags = PRINTER_ENUM_CONNECTIONS\n");
+       TestEnumPrinters (argv[1], PRINTER_ENUM_CONNECTIONS);
+       printf ("\n");
+
+       printf ("\n\nFlags = PRINTER_ENUM_NETWORK\n");
+       TestEnumPrinters (NULL, PRINTER_ENUM_NETWORK);
+       printf ("\n");
+
+       printf ("\n\nFlags = PRINTER_ENUM_REMOTE\n");
+       TestEnumPrinters (NULL, PRINTER_ENUM_REMOTE);
+       printf ("\n");
+
+
+       return 0;
+
+}
index e77c814..f6dd44d 100644 (file)
--- a/GetForm.c
+++ b/GetForm.c
@@ -1,74 +1,74 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                  printer;\r
-       DWORD                   needed;\r
-       PFORM_INFO_1    buffer1 = NULL;\r
-\r
-       if (argc < 3)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername> <form>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* open the printer */\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-       }\r
-\r
-       /* INFO LEVEL 1 */\r
-       GetForm(printer, argv[2], 1, (LPBYTE)buffer1, 0, &needed);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               fprintf (stderr, "Error getting form information for [%s] using NULL buffer.\n", argv[2]);\r
-               exit (-1);\r
-       }\r
-\r
-       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for FORM_INFO_1 buffer!\n");\r
-               exit (-1);\r
-       }\r
-       if (!GetForm(printer, argv[2], 1, (LPBYTE)buffer1, needed, &needed))\r
-       {\r
-               fprintf (stderr, "Error getting form information for [%2].\nSize of buffer = %d\n", \r
-                            argv[2], needed);\r
-               exit (-1);\r
-       }\r
-\r
-       printf ("Form Info Level 1:\n");\r
-       print_form_info_1 (buffer1);\r
-       printf ("\n");\r
-       free (buffer1);\r
-\r
-\r
-       /* close the printer */\r
-       if (!ClosePrinter(printer))\r
-       {\r
-               fprintf (stderr, "Error closing printer!\n");\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                  printer;
+       DWORD                   needed;
+       PFORM_INFO_1    buffer1 = NULL;
+
+       if (argc < 3)
+       {
+               fprintf (stderr, "useage: %s <printername> <form>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* open the printer */
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+       }
+
+       /* INFO LEVEL 1 */
+       GetForm(printer, argv[2], 1, (LPBYTE)buffer1, 0, &needed);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               fprintf (stderr, "Error getting form information for [%s] using NULL buffer.\n", argv[2]);
+               exit (-1);
+       }
+
+       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for FORM_INFO_1 buffer!\n");
+               exit (-1);
+       }
+       if (!GetForm(printer, argv[2], 1, (LPBYTE)buffer1, needed, &needed))
+       {
+               fprintf (stderr, "Error getting form information for [%2].\nSize of buffer = %d\n",
+                            argv[2], needed);
+               exit (-1);
+       }
+
+       printf ("Form Info Level 1:\n");
+       print_form_info_1 (buffer1);
+       printf ("\n");
+       free (buffer1);
+
+
+       /* close the printer */
+       if (!ClosePrinter(printer))
+       {
+               fprintf (stderr, "Error closing printer!\n");
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+       }
+
+       return 0;
+
 }
\ No newline at end of file
index 3f0f054..e2ed994 100644 (file)
--- a/GetJob.c
+++ b/GetJob.c
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include "printlib.h"\r
-\r
-#define START_JOB      0\r
-#define MAX_JOBS       100\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                  printer;\r
-       DWORD                   returned, needed, i;\r
-       PJOB_INFO_1             buffer1 = NULL;\r
-       PJOB_INFO_2             buffer2 = NULL;\r
-       DWORD                   dJob = 0;\r
-\r
-\r
-       if (argc < 3)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername> <job id>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-       dJob = atoi(argv[2]);\r
-\r
-       /* open the printer */\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-       }\r
-\r
-       /* INFO LEVEL 1 */\r
-       EnumJobs(printer, START_JOB, MAX_JOBS, 1, (LPBYTE)buffer1, 0, &needed, &returned);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               if (needed != 0)\r
-               {\r
-                       fprintf (stderr, "Error getting job information for [%s] using NULL buffer.\n", argv[2]);\r
-                       exit (-1);\r
-               }\r
-               else\r
-               {\r
-                       printf ("No jobs returned for [%s]\n", argv[1]);\r
-                       ClosePrinter (printer);\r
-                       exit (0);\r
-               }\r
-       }\r
-\r
-       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for JOB_INFO_1 buffer!\n");\r
-               exit (-1);\r
-       }\r
-       if (!EnumJobs(printer, START_JOB, MAX_JOBS, 1, (LPBYTE)buffer1, needed, &needed, &returned))\r
-       {\r
-               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n", \r
-                            argv[2], needed);\r
-               exit (-1);\r
-       }\r
-\r
-       printf ("Job Info Level 1:\n");\r
-       for (i=0; i<returned; i++)\r
-       {\r
-               print_job_info_1 (&buffer1[i]);\r
-       }\r
-       printf ("\n");\r
-       free (buffer1);\r
-\r
-\r
-       /* INFO LEVEL 2 */\r
-       GetJob(printer, dJob, 2, (LPBYTE)buffer2, 0, &needed);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               if (needed != 0)\r
-               {\r
-                       fprintf (stderr, "Error getting job information for [%s] using NULL buffer.\n", argv[2]);\r
-                       exit (-1);\r
-               }\r
-               else\r
-               {\r
-                       printf ("No jobs returned for [%s]\n", argv[1]);\r
-                       ClosePrinter (printer);\r
-                       exit (0);\r
-               }\r
-       }\r
-\r
-       if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for JOB_INFO_2 buffer!\n");\r
-               exit (-1);\r
-       }\r
-       if (!GetJob(printer, dJob, 2, (LPBYTE)buffer2, needed, &needed))\r
-       {\r
-               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n", \r
-                            argv[2], needed);\r
-               exit (-1);\r
-       }\r
-\r
-       printf ("Job Info Level 2:\n");\r
-       for (i=0; i<returned; i++)\r
-       {\r
-               print_job_info_2 (&buffer2[i]);\r
-       }\r
-       printf ("\n");\r
-       free (buffer2);\r
-\r
-\r
-       /* close the printer */\r
-       if (!ClosePrinter(printer))\r
-       {\r
-               fprintf (stderr, "Error closing printer!\n");\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
-}\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "printlib.h"
+
+#define START_JOB      0
+#define MAX_JOBS       100
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                  printer;
+       DWORD                   returned, needed, i;
+       PJOB_INFO_1             buffer1 = NULL;
+       PJOB_INFO_2             buffer2 = NULL;
+       DWORD                   dJob = 0;
+
+
+       if (argc < 3)
+       {
+               fprintf (stderr, "useage: %s <printername> <job id>\n", argv[0]);
+               exit (-1);
+       }
+       dJob = atoi(argv[2]);
+
+       /* open the printer */
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+       }
+
+       /* INFO LEVEL 1 */
+       EnumJobs(printer, START_JOB, MAX_JOBS, 1, (LPBYTE)buffer1, 0, &needed, &returned);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               if (needed != 0)
+               {
+                       fprintf (stderr, "Error getting job information for [%s] using NULL buffer.\n", argv[2]);
+                       exit (-1);
+               }
+               else
+               {
+                       printf ("No jobs returned for [%s]\n", argv[1]);
+                       ClosePrinter (printer);
+                       exit (0);
+               }
+       }
+
+       if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for JOB_INFO_1 buffer!\n");
+               exit (-1);
+       }
+       if (!EnumJobs(printer, START_JOB, MAX_JOBS, 1, (LPBYTE)buffer1, needed, &needed, &returned))
+       {
+               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n",
+                            argv[2], needed);
+               exit (-1);
+       }
+
+       printf ("Job Info Level 1:\n");
+       for (i=0; i<returned; i++)
+       {
+               print_job_info_1 (&buffer1[i]);
+       }
+       printf ("\n");
+       free (buffer1);
+
+
+       /* INFO LEVEL 2 */
+       GetJob(printer, dJob, 2, (LPBYTE)buffer2, 0, &needed);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               if (needed != 0)
+               {
+                       fprintf (stderr, "Error getting job information for [%s] using NULL buffer.\n", argv[2]);
+                       exit (-1);
+               }
+               else
+               {
+                       printf ("No jobs returned for [%s]\n", argv[1]);
+                       ClosePrinter (printer);
+                       exit (0);
+               }
+       }
+
+       if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for JOB_INFO_2 buffer!\n");
+               exit (-1);
+       }
+       if (!GetJob(printer, dJob, 2, (LPBYTE)buffer2, needed, &needed))
+       {
+               fprintf (stderr, "Error getting form information for [%s].\nSize of buffer = %d\n",
+                            argv[2], needed);
+               exit (-1);
+       }
+
+       printf ("Job Info Level 2:\n");
+       for (i=0; i<returned; i++)
+       {
+               print_job_info_2 (&buffer2[i]);
+       }
+       printf ("\n");
+       free (buffer2);
+
+
+       /* close the printer */
+       if (!ClosePrinter(printer))
+       {
+               fprintf (stderr, "Error closing printer!\n");
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+       }
+
+       return 0;
+
+}
index 06aba61..9b7e7de 100644 (file)
@@ -1,59 +1,58 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-\r
-#define NUM_ARCH       5\r
-const LPTSTR arch [NUM_ARCH] = {       "Windows 4.0",\r
-                                                       "Windows NT x86",\r
-                                                       "Windows NT R4000",\r
-                                                       "Windows NT PowerPC",\r
-                                                       "Windows NT Alpha_AXP"  };\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       DWORD   needed, i;\r
-       LPTSTR  buffer1 = NULL;\r
-       \r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       for (i=0; i<NUM_ARCH; i++)\r
-       {\r
-               printf ("[%s]\n", arch[i]);\r
-\r
-               needed = 0;\r
-               GetPrintProcessorDirectory(argv[1], arch[i], 1, (LPBYTE)buffer1, 0, &needed);\r
-               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-               {\r
-                       fprintf (stderr, "Error GetPrintProcessorDirectory for [%s] using NULL buffer.\n\n", argv[1]);\r
-                       continue;\r
-               }\r
-\r
-               if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for buffer!\n");\r
-                       exit (-1);\r
-               }\r
-               if (!GetPrintProcessorDirectory(argv[1], arch[i], 1, (LPBYTE)buffer1, needed, &needed))\r
-               {\r
-                       fprintf (stderr, "Error getting print processor path for [%s].\nSize of buffer = %d\n\n", \r
-                                       argv[1], needed);\r
-               }\r
-               printf ("\tPrint Processor Path\t= %s\n", buffer1);\r
-               printf ("\n");\r
-\r
-               free (buffer1);\r
-       }\r
-\r
-\r
-       return 0;\r
-\r
-}\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+
+#define NUM_ARCH       5
+const LPTSTR arch [NUM_ARCH] = {       "Windows 4.0",
+                                                       "Windows NT x86",
+                                                       "Windows NT R4000",
+                                                       "Windows NT PowerPC",
+                                                       "Windows NT Alpha_AXP"  };
+
+int main (int argc, char* argv[])
+{
+       DWORD   needed, i;
+       LPTSTR  buffer1 = NULL;
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <servername>\n", argv[0]);
+               exit (-1);
+       }
+
+       for (i=0; i<NUM_ARCH; i++)
+       {
+               printf ("[%s]\n", arch[i]);
+
+               needed = 0;
+               GetPrintProcessorDirectory(argv[1], arch[i], 1, (LPBYTE)buffer1, 0, &needed);
+               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+               {
+                       fprintf (stderr, "Error GetPrintProcessorDirectory for [%s] using NULL buffer.\n\n", argv[1]);
+                       continue;
+               }
+
+               if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for buffer!\n");
+                       exit (-1);
+               }
+               if (!GetPrintProcessorDirectory(argv[1], arch[i], 1, (LPBYTE)buffer1, needed, &needed))
+               {
+                       fprintf (stderr, "Error getting print processor path for [%s].\nSize of buffer = %d\n\n",
+                                       argv[1], needed);
+               }
+               printf ("\tPrint Processor Path\t= %s\n", buffer1);
+               printf ("\n");
+
+               free (buffer1);
+       }
+
+
+       return 0;
+
+}
index 9820a2b..c9c2f56 100644 (file)
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       DWORD   needed, returned;\r
-       HANDLE  printer;\r
-       PPRINTER_INFO_1 buffer1 = NULL;\r
-       PPRINTER_INFO_2 buffer2 = NULL;\r
-       PPRINTER_INFO_5 buffer5 = NULL;\r
-       PPRINTER_INFO_7 buffer7 = NULL;\r
-       \r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* open the printer */\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-       }\r
-\r
-\r
-       /* INFO LEVEL 1 */\r
-       needed = returned = 0;\r
-       GetPrinter(printer, 1, (LPBYTE)buffer1, 0, &needed);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               if (needed != 0)\r
-                       fprintf (stderr, "Error GetPrinter Info Level 1 for [%s] using NULL buffer.\n", argv[1]);\r
-               else\r
-                       printf ("Info level 1 returned no information\n");\r
-       }\r
-       else\r
-       {\r
-               if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for buffer!\n");\r
-                       exit (-1);\r
-               }\r
-               if (!GetPrinter(printer, 1, (LPBYTE)buffer1, needed, &returned))\r
-               {\r
-                       fprintf (stderr, "Error enumerating printers Info Level 1 for [%s].\nSize of buffer = %d\n", \r
-                                       argv[1], needed);\r
-               }\r
-\r
-               printf ("Printer Info Level 1:\n");\r
-               print_printer_info_1(buffer1);\r
-               printf ("\n");\r
-               free (buffer1);\r
-       }\r
-\r
-       /* INFO LEVEL 2 */\r
-       needed = returned = 0;\r
-       GetPrinter(printer, 2, (LPBYTE)buffer2, 0, &needed);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               if (needed != 0)\r
-                       fprintf (stderr, "Error GetPrinter Info Level 2 for [%s] using NULL buffer.\n", argv[1]);\r
-               else\r
-                       printf ("Info level 2 returned no information\n");\r
-       }\r
-       else\r
-       {\r
-               if ((buffer2 = (LPBYTE)malloc(needed*2)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for buffer!\n");\r
-                       exit (-1);\r
-               }\r
-\r
-               printf("Pass one\n");\r
-               if (!GetPrinter(printer, 2, (LPBYTE)buffer2, needed, &returned))\r
-               {\r
-                       fprintf (stderr, "Error getting printers Info Level 2 for [%s].\nSize of buffer = 0x%x [0x%x]\n", \r
-                                       argv[1], needed, returned);\r
-                       PrintLastError();\r
-\r
-                       needed *= 2;\r
-                       returned = 0;\r
-                       printf("Pass Two\n");\r
-                       if (!GetPrinter(printer, 2, (LPBYTE)buffer2, needed, &returned))\r
-                       {\r
-                               fprintf (stderr, "Error getting printers Info Level 2 for [%s].\nSize of buffer = 0x%x [0x%x]\n", \r
-                                               argv[1], needed, returned);     \r
-                               PrintLastError();\r
-                       }\r
-               }\r
-\r
-               printf ("Printer Info Level 2:\n");\r
-               printf ("Returned = 0x%x\n", returned);\r
-               print_printer_info_2(buffer2);\r
-               printf ("\n");\r
-               free (buffer2);\r
-       }\r
-\r
-       /* INFO LEVEL 5 */\r
-       GetPrinter(printer, 5, (LPBYTE)buffer5, 0, &needed);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               if (needed != 0)\r
-                       fprintf (stderr, "Error GetPrinter Info Level 5 for [%s] using NULL buffer.\n", argv[1]);\r
-               else\r
-                       printf ("Info level 5 returned no information\n");\r
-       }\r
-       else\r
-       {\r
-               if ((buffer5 = (LPBYTE)malloc(needed)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for buffer!\n");\r
-                       exit (-1);\r
-               }\r
-               if (!GetPrinter(printer, 5, (LPBYTE)buffer5, needed, &needed))\r
-               {\r
-                       fprintf (stderr, "Error getting printers Info Level 5 for [%s].\nSize of buffer = %d\n", \r
-                                       argv[1], needed);\r
-               }\r
-\r
-               printf ("Printer Info Level 5:\n");\r
-               print_printer_info_5(buffer5);\r
-               printf ("\n");\r
-               free (buffer5);\r
-       }\r
-\r
-       /* INFO LEVEL 7 */\r
-       GetPrinter(printer, 7, (LPBYTE)buffer7, 0, &needed);\r
-       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-       {\r
-               if (needed != 0)\r
-                       fprintf (stderr, "Error GetPrinter Info Level 7 for [%s] using NULL buffer.\n", argv[1]);\r
-               else\r
-                       printf ("Info level 7 returned no information\n");\r
-       }\r
-       else\r
-       {\r
-               if ((buffer7 = (LPBYTE)malloc(needed)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for buffer!\n");\r
-                       exit (-1);\r
-               }\r
-               if (!GetPrinter(printer, 7, (LPBYTE)buffer7, needed, &needed))\r
-               {\r
-                       fprintf (stderr, "Error getting printers Info Level 7 for [%s].\nSize of buffer = %d\n", \r
-                                       argv[1], needed);\r
-               }\r
-\r
-               printf ("Printer Info Level 7:\n");\r
-               printf ("flags = %d\n", buffer7->dwAction);\r
-               printf ("\n");\r
-               free (buffer7);\r
-       }\r
-\r
-       /* close the printer */\r
-       if (!ClosePrinter(printer))\r
-       {\r
-               fprintf (stderr, "Error closing printer!\n");\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
-}\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+int main (int argc, char* argv[])
+{
+       DWORD   needed, returned;
+       HANDLE  printer;
+       PPRINTER_INFO_1 buffer1 = NULL;
+       PPRINTER_INFO_2 buffer2 = NULL;
+       PPRINTER_INFO_5 buffer5 = NULL;
+       PPRINTER_INFO_7 buffer7 = NULL;
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* open the printer */
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+       }
+
+
+       /* INFO LEVEL 1 */
+       needed = returned = 0;
+       GetPrinter(printer, 1, (LPBYTE)buffer1, 0, &needed);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               if (needed != 0)
+                       fprintf (stderr, "Error GetPrinter Info Level 1 for [%s] using NULL buffer.\n", argv[1]);
+               else
+                       printf ("Info level 1 returned no information\n");
+       }
+       else
+       {
+               if ((buffer1 = (LPBYTE)malloc(needed)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for buffer!\n");
+                       exit (-1);
+               }
+               if (!GetPrinter(printer, 1, (LPBYTE)buffer1, needed, &returned))
+               {
+                       fprintf (stderr, "Error enumerating printers Info Level 1 for [%s].\nSize of buffer = %d\n",
+                                       argv[1], needed);
+               }
+
+               printf ("Printer Info Level 1:\n");
+               print_printer_info_1(buffer1);
+               printf ("\n");
+               free (buffer1);
+       }
+
+       /* INFO LEVEL 2 */
+       needed = returned = 0;
+       GetPrinter(printer, 2, (LPBYTE)buffer2, 0, &needed);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               if (needed != 0)
+                       fprintf (stderr, "Error GetPrinter Info Level 2 for [%s] using NULL buffer.\n", argv[1]);
+               else
+                       printf ("Info level 2 returned no information\n");
+       }
+       else
+       {
+               if ((buffer2 = (LPBYTE)malloc(needed*2)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for buffer!\n");
+                       exit (-1);
+               }
+
+               printf("Pass one\n");
+               if (!GetPrinter(printer, 2, (LPBYTE)buffer2, needed, &returned))
+               {
+                       fprintf (stderr, "Error getting printers Info Level 2 for [%s].\nSize of buffer = 0x%x [0x%x]\n",
+                                       argv[1], needed, returned);
+                       PrintLastError();
+
+                       needed *= 2;
+                       returned = 0;
+                       printf("Pass Two\n");
+                       if (!GetPrinter(printer, 2, (LPBYTE)buffer2, needed, &returned))
+                       {
+                               fprintf (stderr, "Error getting printers Info Level 2 for [%s].\nSize of buffer = 0x%x [0x%x]\n",
+                                               argv[1], needed, returned);
+                               PrintLastError();
+                       }
+               }
+
+               printf ("Printer Info Level 2:\n");
+               printf ("Returned = 0x%x\n", returned);
+               print_printer_info_2(buffer2);
+               printf ("\n");
+               free (buffer2);
+       }
+
+       /* INFO LEVEL 5 */
+       GetPrinter(printer, 5, (LPBYTE)buffer5, 0, &needed);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               if (needed != 0)
+                       fprintf (stderr, "Error GetPrinter Info Level 5 for [%s] using NULL buffer.\n", argv[1]);
+               else
+                       printf ("Info level 5 returned no information\n");
+       }
+       else
+       {
+               if ((buffer5 = (LPBYTE)malloc(needed)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for buffer!\n");
+                       exit (-1);
+               }
+               if (!GetPrinter(printer, 5, (LPBYTE)buffer5, needed, &needed))
+               {
+                       fprintf (stderr, "Error getting printers Info Level 5 for [%s].\nSize of buffer = %d\n",
+                                       argv[1], needed);
+               }
+
+               printf ("Printer Info Level 5:\n");
+               print_printer_info_5(buffer5);
+               printf ("\n");
+               free (buffer5);
+       }
+
+       /* INFO LEVEL 7 */
+       GetPrinter(printer, 7, (LPBYTE)buffer7, 0, &needed);
+       if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+       {
+               if (needed != 0)
+                       fprintf (stderr, "Error GetPrinter Info Level 7 for [%s] using NULL buffer.\n", argv[1]);
+               else
+                       printf ("Info level 7 returned no information\n");
+       }
+       else
+       {
+               if ((buffer7 = (LPBYTE)malloc(needed)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for buffer!\n");
+                       exit (-1);
+               }
+               if (!GetPrinter(printer, 7, (LPBYTE)buffer7, needed, &needed))
+               {
+                       fprintf (stderr, "Error getting printers Info Level 7 for [%s].\nSize of buffer = %d\n",
+                                       argv[1], needed);
+               }
+
+               printf ("Printer Info Level 7:\n");
+               printf ("flags = %d\n", buffer7->dwAction);
+               printf ("\n");
+               free (buffer7);
+       }
+
+       /* close the printer */
+       if (!ClosePrinter(printer))
+       {
+               fprintf (stderr, "Error closing printer!\n");
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+       }
+
+       return 0;
+
+}
index dc8dd35..3ed019c 100644 (file)
@@ -1,88 +1,88 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include "printlib.h"\r
-\r
-#define START_JOB      0\r
-#define MAX_JOBS       100\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                  printer;\r
-       DWORD                   type, pcbData;\r
-       LPBYTE                  pData = NULL;\r
-       DWORD                   i, status;\r
-\r
-\r
-       if (argc < 3)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername> <value name>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* open the printer */\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-       }\r
-\r
-       status=GetPrinterData(printer, argv[2], &type, pData, 0, &pcbData);\r
-       if ((status != ERROR_SUCCESS) && (status != ERROR_MORE_DATA))\r
-       {\r
-               PrintLastError();\r
-               ClosePrinter (printer);\r
-               exit (-1);\r
-       }\r
-\r
-       if ((pData = (LPBYTE)malloc(pcbData)) == NULL)\r
-       {\r
-               fprintf (stderr, "Unable to malloc memory for Value Data!\n");\r
-               exit (-1);\r
-       }\r
-       \r
-       status = GetPrinterData(printer, argv[2], &type, pData, pcbData, &pcbData);\r
-       if (status == ERROR_SUCCESS)\r
-       {\r
-               printf ("\tValue Name = %s\n", argv[2]);\r
-               printf ("\tType = %d\n", type);\r
-               printf ("\tData = 0x%x bytes\n", pcbData);\r
-               i = 0;\r
-               while (i < pcbData)\r
-               {\r
-                       printf ("\t0x%x", *(pData++));\r
-                       if (i%4 == 3)\r
-                               printf ("\n");\r
-                       i++;\r
-               }\r
-               printf ("\n");\r
-       }\r
-       \r
-       printf ("\n");\r
-\r
-\r
-\r
-       /* close the printer */\r
-       if (!ClosePrinter(printer))\r
-       {\r
-               fprintf (stderr, "Error closing printer!\n");\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
-}\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "printlib.h"
+
+#define START_JOB      0
+#define MAX_JOBS       100
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                  printer;
+       DWORD                   type, pcbData;
+       LPBYTE                  pData = NULL;
+       DWORD                   i, status;
+
+
+       if (argc < 3)
+       {
+               fprintf (stderr, "useage: %s <printername> <value name>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* open the printer */
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+       }
+
+       status=GetPrinterData(printer, argv[2], &type, pData, 0, &pcbData);
+       if ((status != ERROR_SUCCESS) && (status != ERROR_MORE_DATA))
+       {
+               PrintLastError();
+               ClosePrinter (printer);
+               exit (-1);
+       }
+
+       if ((pData = (LPBYTE)malloc(pcbData)) == NULL)
+       {
+               fprintf (stderr, "Unable to malloc memory for Value Data!\n");
+               exit (-1);
+       }
+
+       status = GetPrinterData(printer, argv[2], &type, pData, pcbData, &pcbData);
+       if (status == ERROR_SUCCESS)
+       {
+               printf ("\tValue Name = %s\n", argv[2]);
+               printf ("\tType = %d\n", type);
+               printf ("\tData = 0x%x bytes\n", pcbData);
+               i = 0;
+               while (i < pcbData)
+               {
+                       printf ("\t0x%x", *(pData++));
+                       if (i%4 == 3)
+                               printf ("\n");
+                       i++;
+               }
+               printf ("\n");
+       }
+
+       printf ("\n");
+
+
+
+       /* close the printer */
+       if (!ClosePrinter(printer))
+       {
+               fprintf (stderr, "Error closing printer!\n");
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+       }
+
+       return 0;
+
+}
index 9fbb1ae..5c7b2b2 100644 (file)
@@ -1,77 +1,77 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include "printlib.h"\r
-\r
-#define START_JOB      0\r
-#define MAX_JOBS       100\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                  server;\r
-       DWORD                   type, pcbData;\r
-       LPBYTE                  pData = NULL;\r
-       DWORD                   i, status;\r
-\r
-\r
-       if (argc < 3)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername> <value name>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* open the server */\r
-       if (!OpenPrinter (argv[1], &server, NULL))\r
-               PrintLastError();\r
-       else\r
-               printf ("Server [%s] opened successfully.\n\n", argv[1]);\r
-\r
-       status=GetPrinterDataEx(server, "PrinterDriverData", argv[2], &type, pData, 0, &pcbData);\r
-       if ((status != ERROR_SUCCESS) && (status != ERROR_MORE_DATA))\r
-       {\r
-               PrintLastError();\r
-       }\r
-       else\r
-       {\r
-               if ((pData = (LPBYTE)malloc(pcbData)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for Value Data!\n");\r
-                       exit (-1);\r
-               }\r
-       \r
-               status = GetPrinterDataEx(server, "PrinterDriverData", argv[2], &type, pData, pcbData, &pcbData);\r
-               if (status == ERROR_SUCCESS)\r
-               {\r
-                       printf ("\tValue Name = %s\n", argv[2]);\r
-                       printf ("\tType = %d\n", type);\r
-                       printf ("\tData = 0x%x bytes\n", pcbData);\r
-                       i = 0;\r
-                       while (i < pcbData)\r
-                       {\r
-                               printf ("\t0x%x", *(pData++));\r
-                               if (i%4 == 3)\r
-                                       printf ("\n");\r
-                               i++;\r
-                       }\r
-                       printf ("\n");\r
-               }\r
-       \r
-               printf ("\n");\r
-       }\r
-\r
-\r
-       /* close the server */\r
-       if (!ClosePrinter(server))\r
-               PrintLastError();\r
-       else\r
-               printf ("Server [%s] closed successfully.\n", argv[1]);\r
-\r
-       return 0;\r
-\r
-}\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "printlib.h"
+
+#define START_JOB      0
+#define MAX_JOBS       100
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                  server;
+       DWORD                   type, pcbData;
+       LPBYTE                  pData = NULL;
+       DWORD                   i, status;
+
+
+       if (argc < 3)
+       {
+               fprintf (stderr, "useage: %s <servername> <value name>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* open the server */
+       if (!OpenPrinter (argv[1], &server, NULL))
+               PrintLastError();
+       else
+               printf ("Server [%s] opened successfully.\n\n", argv[1]);
+
+       status=GetPrinterDataEx(server, "PrinterDriverData", argv[2], &type, pData, 0, &pcbData);
+       if ((status != ERROR_SUCCESS) && (status != ERROR_MORE_DATA))
+       {
+               PrintLastError();
+       }
+       else
+       {
+               if ((pData = (LPBYTE)malloc(pcbData)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for Value Data!\n");
+                       exit (-1);
+               }
+
+               status = GetPrinterDataEx(server, "PrinterDriverData", argv[2], &type, pData, pcbData, &pcbData);
+               if (status == ERROR_SUCCESS)
+               {
+                       printf ("\tValue Name = %s\n", argv[2]);
+                       printf ("\tType = %d\n", type);
+                       printf ("\tData = 0x%x bytes\n", pcbData);
+                       i = 0;
+                       while (i < pcbData)
+                       {
+                               printf ("\t0x%x", *(pData++));
+                               if (i%4 == 3)
+                                       printf ("\n");
+                               i++;
+                       }
+                       printf ("\n");
+               }
+
+               printf ("\n");
+       }
+
+
+       /* close the server */
+       if (!ClosePrinter(server))
+               PrintLastError();
+       else
+               printf ("Server [%s] closed successfully.\n", argv[1]);
+
+       return 0;
+
+}
index 446fbe3..c5ca6a9 100644 (file)
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-#define NUM_ARCH       5\r
-const LPTSTR arch [NUM_ARCH] = {       "Windows 4.0",\r
-                                                       "Windows NT x86",\r
-                                                       "Windows NT R4000",\r
-                                                       "Windows NT PowerPC",\r
-                                                       "Windows NT Alpha_AXP"  };\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                  printer;\r
-       DWORD                   returned, needed, i;\r
-       PDRIVER_INFO_1  buffer1 = NULL;\r
-       PDRIVER_INFO_2  buffer2 = NULL;\r
-       PDRIVER_INFO_3  buffer3 = NULL;\r
-       PDRIVER_INFO_4  buffer4 = NULL;\r
-       PDRIVER_INFO_5  buffer5 = NULL;\r
-       PDRIVER_INFO_6  buffer6 = NULL;\r
-\r
-       /* printf ("argc = %d\n", argc);*/\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       /* open the printer */\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               PrintLastError();\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-       }\r
-\r
-       for (i=0; i<NUM_ARCH; i++)\r
-       {       \r
-               printf ("Environment = [%s]\n\n", arch[i]);\r
-\r
-               /* INFO LEVEL 1 */\r
-               GetPrinterDriver(printer, arch[i], 1, (LPBYTE)buffer1, 0, &needed);\r
-               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-               {\r
-                       fprintf (stderr, "Error getting printer driver information for [%s] using NULL buffer.\n", argv[1]);\r
-                       PrintLastError();\r
-                       continue;\r
-\r
-               }\r
-\r
-               if ((buffer1 = (LPBYTE)malloc(needed*1024)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for DRIVER_INFO_1 buffer!\n");\r
-                       exit (-1);\r
-               }\r
-               needed *= 1024;\r
-               if (!GetPrinterDriver(printer, arch[i], 1, (LPBYTE)buffer1, needed, &returned))\r
-               {\r
-                       fprintf (stderr, "Error getting printer driver information for [%s].\nSize of buffer = %d\n", \r
-                                    argv[1], needed);\r
-                       PrintLastError();\r
-                       continue;\r
-               }\r
-\r
-               printf ("Printer Driver Info Level 1:\n");\r
-               print_driver_info_1 (buffer1);\r
-               free (buffer1);\r
-\r
-               /* INFO LEVEL 2 */\r
-               GetPrinterDriver(printer, arch[i], 2, (LPBYTE)buffer2, 0, &needed);\r
-               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-               {\r
-                       fprintf (stderr, "Error getting printer driver information for [%s] using NULL buffer.\n", argv[1]);\r
-                       PrintLastError();\r
-                       continue;\r
-               }\r
-\r
-               if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for DRIVER_INFO_2 buffer!\n");\r
-                       exit (-1);\r
-               }\r
-               if (!GetPrinterDriver(printer, arch[i], 2, (LPBYTE)buffer2, needed, &returned))\r
-               {\r
-                       fprintf (stderr, "Error getting printer driver information for [%s].\nSize of buffer = %d\n", \r
-                                    argv[1], needed);\r
-                       PrintLastError();\r
-                       continue;\r
-               }\r
-\r
-               printf ("Printer Driver Info Level 2:\n");\r
-               print_driver_info_2 (buffer2);\r
-               free (buffer2);\r
-\r
-\r
-               /* INFO LEVEL 3 */\r
-               GetPrinterDriver(printer, arch[i], 3, (LPBYTE)buffer3, 0, &needed);\r
-               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-               {\r
-                       fprintf (stderr, "Error getting printer driver information for [%s] using NULL buffer.\n", argv[1]);\r
-                       PrintLastError();\r
-                       continue;\r
-               }\r
-\r
-               if ((buffer3 = (LPBYTE)malloc(needed)) == NULL)\r
-               {\r
-               fprintf (stderr, "Unable to malloc memory for DRIVER_INFO_3 buffer!\n");\r
-                       exit (-1);\r
-               }\r
-               if (!GetPrinterDriver(printer, arch[i], 3, (LPBYTE)buffer3, needed, &returned))\r
-               {\r
-                       fprintf (stderr, "Error getting printer driver information for [%s].\nSize of buffer = %d\n", \r
-                                    argv[1], needed);\r
-                       PrintLastError();\r
-                       continue;\r
-               }\r
-\r
-               printf ("Printer Driver Info Level 3:\n");\r
-               print_driver_info_3 (buffer3);\r
-               printf ("\n");\r
-               free (buffer3);\r
-\r
-               /* INFO LEVEL 6 */\r
-               GetPrinterDriver(printer, arch[i], 6, (LPBYTE)buffer6, 0, &needed);\r
-               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-               {\r
-                       fprintf (stderr, "Error getting printer driver information for [%s] using NULL buffer.\n", argv[1]);\r
-                       PrintLastError();\r
-                       continue;\r
-               }\r
-\r
-               if ((buffer6 = (LPBYTE)malloc(needed)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for DRIVER_INFO_6 buffer!\n");\r
-                       exit (-1);\r
-               }\r
-               if (!GetPrinterDriver(printer, arch[i], 6, (LPBYTE)buffer6, needed, &returned))\r
-               {\r
-                       fprintf (stderr, "Error getting printer driver information for [%s].\nSize of buffer = %d\n", \r
-                                    argv[1], needed);\r
-                       PrintLastError();\r
-                       continue;\r
-               }\r
-\r
-               printf ("Printer Driver Info Level 6:\n");\r
-               print_driver_info_6 (buffer6);\r
-               printf ("\n");\r
-               free (buffer6);\r
-\r
-       }\r
-\r
-\r
-       /* close the printer */\r
-       if (!ClosePrinter(printer))\r
-       {\r
-               PrintLastError();\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+#define NUM_ARCH       5
+const LPTSTR arch [NUM_ARCH] = {       "Windows 4.0",
+                                                       "Windows NT x86",
+                                                       "Windows NT R4000",
+                                                       "Windows NT PowerPC",
+                                                       "Windows NT Alpha_AXP"  };
+
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                  printer;
+       DWORD                   returned, needed, i;
+       PDRIVER_INFO_1  buffer1 = NULL;
+       PDRIVER_INFO_2  buffer2 = NULL;
+       PDRIVER_INFO_3  buffer3 = NULL;
+       PDRIVER_INFO_4  buffer4 = NULL;
+       PDRIVER_INFO_5  buffer5 = NULL;
+       PDRIVER_INFO_6  buffer6 = NULL;
+
+       /* printf ("argc = %d\n", argc);*/
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+
+       /* open the printer */
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               PrintLastError();
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+       }
+
+       for (i=0; i<NUM_ARCH; i++)
+       {
+               printf ("Environment = [%s]\n\n", arch[i]);
+
+               /* INFO LEVEL 1 */
+               GetPrinterDriver(printer, arch[i], 1, (LPBYTE)buffer1, 0, &needed);
+               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+               {
+                       fprintf (stderr, "Error getting printer driver information for [%s] using NULL buffer.\n", argv[1]);
+                       PrintLastError();
+                       continue;
+
+               }
+
+               if ((buffer1 = (LPBYTE)malloc(needed*1024)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for DRIVER_INFO_1 buffer!\n");
+                       exit (-1);
+               }
+               needed *= 1024;
+               if (!GetPrinterDriver(printer, arch[i], 1, (LPBYTE)buffer1, needed, &returned))
+               {
+                       fprintf (stderr, "Error getting printer driver information for [%s].\nSize of buffer = %d\n",
+                                    argv[1], needed);
+                       PrintLastError();
+                       continue;
+               }
+
+               printf ("Printer Driver Info Level 1:\n");
+               print_driver_info_1 (buffer1);
+               free (buffer1);
+
+               /* INFO LEVEL 2 */
+               GetPrinterDriver(printer, arch[i], 2, (LPBYTE)buffer2, 0, &needed);
+               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+               {
+                       fprintf (stderr, "Error getting printer driver information for [%s] using NULL buffer.\n", argv[1]);
+                       PrintLastError();
+                       continue;
+               }
+
+               if ((buffer2 = (LPBYTE)malloc(needed)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for DRIVER_INFO_2 buffer!\n");
+                       exit (-1);
+               }
+               if (!GetPrinterDriver(printer, arch[i], 2, (LPBYTE)buffer2, needed, &returned))
+               {
+                       fprintf (stderr, "Error getting printer driver information for [%s].\nSize of buffer = %d\n",
+                                    argv[1], needed);
+                       PrintLastError();
+                       continue;
+               }
+
+               printf ("Printer Driver Info Level 2:\n");
+               print_driver_info_2 (buffer2);
+               free (buffer2);
+
+
+               /* INFO LEVEL 3 */
+               GetPrinterDriver(printer, arch[i], 3, (LPBYTE)buffer3, 0, &needed);
+               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+               {
+                       fprintf (stderr, "Error getting printer driver information for [%s] using NULL buffer.\n", argv[1]);
+                       PrintLastError();
+                       continue;
+               }
+
+               if ((buffer3 = (LPBYTE)malloc(needed)) == NULL)
+               {
+               fprintf (stderr, "Unable to malloc memory for DRIVER_INFO_3 buffer!\n");
+                       exit (-1);
+               }
+               if (!GetPrinterDriver(printer, arch[i], 3, (LPBYTE)buffer3, needed, &returned))
+               {
+                       fprintf (stderr, "Error getting printer driver information for [%s].\nSize of buffer = %d\n",
+                                    argv[1], needed);
+                       PrintLastError();
+                       continue;
+               }
+
+               printf ("Printer Driver Info Level 3:\n");
+               print_driver_info_3 (buffer3);
+               printf ("\n");
+               free (buffer3);
+
+               /* INFO LEVEL 6 */
+               GetPrinterDriver(printer, arch[i], 6, (LPBYTE)buffer6, 0, &needed);
+               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+               {
+                       fprintf (stderr, "Error getting printer driver information for [%s] using NULL buffer.\n", argv[1]);
+                       PrintLastError();
+                       continue;
+               }
+
+               if ((buffer6 = (LPBYTE)malloc(needed)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for DRIVER_INFO_6 buffer!\n");
+                       exit (-1);
+               }
+               if (!GetPrinterDriver(printer, arch[i], 6, (LPBYTE)buffer6, needed, &returned))
+               {
+                       fprintf (stderr, "Error getting printer driver information for [%s].\nSize of buffer = %d\n",
+                                    argv[1], needed);
+                       PrintLastError();
+                       continue;
+               }
+
+               printf ("Printer Driver Info Level 6:\n");
+               print_driver_info_6 (buffer6);
+               printf ("\n");
+               free (buffer6);
+
+       }
+
+
+       /* close the printer */
+       if (!ClosePrinter(printer))
+       {
+               PrintLastError();
+       }
+       else
+       {
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+       }
+
+       return 0;
+
 }
\ No newline at end of file
index d9a03f3..b411c78 100644 (file)
@@ -1,56 +1,56 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-\r
-#define NUM_ARCH       5\r
-const LPTSTR arch [NUM_ARCH] = {       "Windows 4.0",\r
-                                                       "Windows NT x86",\r
-                                                       "Windows NT R4000",\r
-                                                       "Windows NT PowerPC",\r
-                                                       "Windows NT Alpha_AXP"  };\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       DWORD                   returned, needed, i;\r
-       LPTSTR                  buffer = NULL;\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <servername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       printf ("Printer Driver Directory Info Level 1:\n");\r
-       for (i=0; i<NUM_ARCH; i++)\r
-       {\r
-               GetPrinterDriverDirectory(argv[1], arch[i], 1, (LPBYTE)buffer, 0, &needed);\r
-               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)\r
-               {\r
-                       fprintf (stderr, "Error getting printer driver directory for [%s] using NULL buffer.\n", argv[1]);\r
-                       exit (-1);\r
-               }\r
-\r
-               if ((buffer = (LPBYTE)malloc(needed)) == NULL)\r
-               {\r
-                       fprintf (stderr, "Unable to malloc memory for directory path!\n");\r
-                       exit (-1);\r
-               }\r
-               if (!GetPrinterDriverDirectory(argv[1], arch[i], 1, (LPBYTE)buffer, needed, &returned))\r
-               {\r
-                       fprintf (stderr, "Error getting printer driver directory for [%s].\nSize of buffer = %d\n", \r
-                                    argv[1], needed);\r
-                       exit (-1);\r
-               }\r
-\r
-               printf ("\t%s Path\t= %s\n\n", arch[i], buffer);\r
-               free (buffer);\r
-       }\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+
+#define NUM_ARCH       5
+const LPTSTR arch [NUM_ARCH] = {       "Windows 4.0",
+                                                       "Windows NT x86",
+                                                       "Windows NT R4000",
+                                                       "Windows NT PowerPC",
+                                                       "Windows NT Alpha_AXP"  };
+
+int main (int argc, char* argv[])
+{
+
+       DWORD                   returned, needed, i;
+       LPTSTR                  buffer = NULL;
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <servername>\n", argv[0]);
+               exit (-1);
+       }
+
+       printf ("Printer Driver Directory Info Level 1:\n");
+       for (i=0; i<NUM_ARCH; i++)
+       {
+               GetPrinterDriverDirectory(argv[1], arch[i], 1, (LPBYTE)buffer, 0, &needed);
+               if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+               {
+                       fprintf (stderr, "Error getting printer driver directory for [%s] using NULL buffer.\n", argv[1]);
+                       exit (-1);
+               }
+
+               if ((buffer = (LPBYTE)malloc(needed)) == NULL)
+               {
+                       fprintf (stderr, "Unable to malloc memory for directory path!\n");
+                       exit (-1);
+               }
+               if (!GetPrinterDriverDirectory(argv[1], arch[i], 1, (LPBYTE)buffer, needed, &returned))
+               {
+                       fprintf (stderr, "Error getting printer driver directory for [%s].\nSize of buffer = %d\n",
+                                    argv[1], needed);
+                       exit (-1);
+               }
+
+               printf ("\t%s Path\t= %s\n\n", arch[i], buffer);
+               free (buffer);
+       }
+
+       return 0;
+
 }
\ No newline at end of file
index b78e343..6d700b5 100644 (file)
@@ -1,37 +1,37 @@
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE  printer;\r
-\r
-\r
-       if (argc < 2)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               PrintLastError();\r
-               exit (-1);\r
-       }\r
-       else\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-\r
-       if (!ClosePrinter(printer))\r
-               PrintLastError();\r
-       else\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE  printer;
+
+
+       if (argc < 2)
+       {
+               fprintf (stderr, "useage: %s <printername>\n", argv[0]);
+               exit (-1);
+       }
+
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               PrintLastError();
+               exit (-1);
+       }
+       else
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+
+       if (!ClosePrinter(printer))
+               PrintLastError();
+       else
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+
+       return 0;
+
 }
\ No newline at end of file
index b45bf48..b844726 100644 (file)
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <fcntl.h>\r
-#include <io.h>\r
-#include <string.h>\r
-#include "printlib.h"\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE                          printer;\r
-       int                                     fd;\r
-       BYTE                            buffer[256];\r
-       DWORD                           bytes, wrote;\r
-       DOC_INFO_1                      buffer1;\r
-       PRINTER_DEFAULTS        print_defaults;\r
-\r
-       if (argc < 3)\r
-       {\r
-               fprintf (stderr, "useage: %s <printername> <filename>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       printf ("This test program exercises the following win32 functions:\n");\r
-       printf ("\tResetPrinter()\n");\r
-       printf ("\tStartDocPrinter()\n");\r
-       printf ("\tEndDocPrinter()\n");\r
-       printf ("\tStartPagePrinter()\n");\r
-       printf ("\tEndPagePrinter()\n");\r
-       printf ("\tWritePrinter()\n");\r
-       printf ("\n\n");\r
-\r
-       printf ("This test program exercises both the StartPagePrinter()\n");\r
-       printf ("and EndPagePrinter() Win32 functions.\n\n");\r
-\r
-       if (!OpenPrinter (argv[1], &printer, NULL))\r
-       {\r
-               fprintf (stderr, "Unable to open %s!\n", argv[1]);\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[1]);\r
-       }\r
-\r
-       /* set the printer defaults */\r
-       print_defaults.pDatatype                = strdup ("RAW");\r
-       print_defaults.DesiredAccess    = NULL;\r
-       print_defaults.pDevMode                 = NULL;\r
-       if (ResetPrinter(printer, &print_defaults))\r
-               printf ("ResetPrinter call succeeded\n");\r
-       else\r
-               PrintLastError();\r
-       printf ("\n");\r
-\r
-       /* StartDocPrinter */\r
-       buffer1.pDocName        = strdup("Testing Printer");\r
-       buffer1.pDatatype       = strdup("RAW");\r
-       buffer1.pOutputFile     = NULL;\r
-\r
-       printf ("Attempting to call StartDocPrinter() using DOC_INFO_1 :\n");\r
-       print_doc_info_1 (&buffer1);\r
-       printf ("\n");\r
-\r
-       if (StartDocPrinter (printer, 1, (LPBYTE)&buffer1))\r
-               printf ("StartDocPrinter called successfully\n");\r
-       else\r
-               PrintLastError();\r
-       printf ("\n");\r
-\r
-\r
-       if (StartPagePrinter(printer))\r
-       {\r
-               printf ("StartPagePrinter returned success.\n");\r
-\r
-               if ((fd=_open(argv[2], _O_RDONLY)) == -1)\r
-               {\r
-                       fprintf (stderr, "ERROR: Unable to open [%s] for read access!\n", argv[2]);\r
-                       ClosePrinter (printer);\r
-                       exit (-1);\r
-               }\r
-\r
-               while ((bytes=_read(fd, buffer, 256)) != 0)\r
-               {\r
-                       if (!WritePrinter(printer, (LPVOID)buffer, bytes, &wrote))\r
-                       {\r
-                               fprintf (stderr, "ERROR: WritePrinter failed for [%d] bytes!\n", bytes);\r
-                               PrintLastError();\r
-                       }\r
-                       else\r
-                               printf ("Successfully wrote [%d] bytes to the printer\n", bytes);\r
-               }\r
-               _close (fd);\r
-\r
-               if (EndPagePrinter (printer))\r
-                       printf ("EndPagePrinter returned success.\n");\r
-               else\r
-                       PrintLastError();\r
-       }\r
-       else\r
-               PrintLastError();\r
-       printf ("\n");\r
-                       \r
-       printf ("Attempting to call EndDocPrinter\n");\r
-       if (EndDocPrinter (printer))\r
-               printf ("EndDocPrinter called successfully\n");\r
-       else\r
-               PrintLastError();\r
-       printf ("\n");\r
-\r
-\r
-\r
-       if (!ClosePrinter(printer))\r
-       {\r
-               fprintf (stderr, "Error closing printer!\n");\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] closed successfully.\n", argv[1]);\r
-       }\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <io.h>
+#include <string.h>
+#include "printlib.h"
+
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE                          printer;
+       int                                     fd;
+       BYTE                            buffer[256];
+       DWORD                           bytes, wrote;
+       DOC_INFO_1                      buffer1;
+       PRINTER_DEFAULTS        print_defaults;
+
+       if (argc < 3)
+       {
+               fprintf (stderr, "useage: %s <printername> <filename>\n", argv[0]);
+               exit (-1);
+       }
+
+       printf ("This test program exercises the following win32 functions:\n");
+       printf ("\tResetPrinter()\n");
+       printf ("\tStartDocPrinter()\n");
+       printf ("\tEndDocPrinter()\n");
+       printf ("\tStartPagePrinter()\n");
+       printf ("\tEndPagePrinter()\n");
+       printf ("\tWritePrinter()\n");
+       printf ("\n\n");
+
+       printf ("This test program exercises both the StartPagePrinter()\n");
+       printf ("and EndPagePrinter() Win32 functions.\n\n");
+
+       if (!OpenPrinter (argv[1], &printer, NULL))
+       {
+               fprintf (stderr, "Unable to open %s!\n", argv[1]);
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[1]);
+       }
+
+       /* set the printer defaults */
+       print_defaults.pDatatype                = strdup ("RAW");
+       print_defaults.DesiredAccess    = NULL;
+       print_defaults.pDevMode                 = NULL;
+       if (ResetPrinter(printer, &print_defaults))
+               printf ("ResetPrinter call succeeded\n");
+       else
+               PrintLastError();
+       printf ("\n");
+
+       /* StartDocPrinter */
+       buffer1.pDocName        = strdup("Testing Printer");
+       buffer1.pDatatype       = strdup("RAW");
+       buffer1.pOutputFile     = NULL;
+
+       printf ("Attempting to call StartDocPrinter() using DOC_INFO_1 :\n");
+       print_doc_info_1 (&buffer1);
+       printf ("\n");
+
+       if (StartDocPrinter (printer, 1, (LPBYTE)&buffer1))
+               printf ("StartDocPrinter called successfully\n");
+       else
+               PrintLastError();
+       printf ("\n");
+
+
+       if (StartPagePrinter(printer))
+       {
+               printf ("StartPagePrinter returned success.\n");
+
+               if ((fd=_open(argv[2], _O_RDONLY)) == -1)
+               {
+                       fprintf (stderr, "ERROR: Unable to open [%s] for read access!\n", argv[2]);
+                       ClosePrinter (printer);
+                       exit (-1);
+               }
+
+               while ((bytes=_read(fd, buffer, 256)) != 0)
+               {
+                       if (!WritePrinter(printer, (LPVOID)buffer, bytes, &wrote))
+                       {
+                               fprintf (stderr, "ERROR: WritePrinter failed for [%d] bytes!\n", bytes);
+                               PrintLastError();
+                       }
+                       else
+                               printf ("Successfully wrote [%d] bytes to the printer\n", bytes);
+               }
+               _close (fd);
+
+               if (EndPagePrinter (printer))
+                       printf ("EndPagePrinter returned success.\n");
+               else
+                       PrintLastError();
+       }
+       else
+               PrintLastError();
+       printf ("\n");
+
+       printf ("Attempting to call EndDocPrinter\n");
+       if (EndDocPrinter (printer))
+               printf ("EndDocPrinter called successfully\n");
+       else
+               PrintLastError();
+       printf ("\n");
+
+
+
+       if (!ClosePrinter(printer))
+       {
+               fprintf (stderr, "Error closing printer!\n");
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] closed successfully.\n", argv[1]);
+       }
+
+       return 0;
+
 }
\ No newline at end of file
index 99017dd..7d184df 100644 (file)
-/******************************************************************\r
- * SPOOLSS regression testing code for Samba print servers\r
- * \r
- *****************************************************************/\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include "printlib.h"\r
-\r
-void PrintNotifyInfoData(PRINTER_NOTIFY_INFO_DATA *p)\r
-{\r
-       printf("\tType\t=0x%x\n", p->Type);\r
-       printf("\tField\t=0x%x\n", p->Field);\r
-       printf("\tId\t=0x%x\n", p->Id);\r
-       printf("\tdata\t= %s\n", p->NotifyData.Data.pBuf);\r
-\r
-       return;\r
-\r
-}\r
-\r
-\r
-int main (int argc, char* argv[])\r
-{\r
-       \r
-       HANDLE  server, change;\r
-       PRINTER_NOTIFY_INFO     *change_info = NULL;\r
-       PRINTER_NOTIFY_OPTIONS watch, *pWatch = NULL;\r
-       PRINTER_NOTIFY_OPTIONS_TYPE data;\r
-       DWORD option = PRINTER_CHANGE_PRINTER_DRIVER;\r
-       BOOL use_notify_options = TRUE;\r
-       DWORD   condition;\r
-       DWORD flags = PRINTER_NOTIFY_OPTIONS_REFRESH;\r
-\r
-\r
-\r
-       if ((argc < 3) || (strcmp(argv[1], "-l") && strcmp(argv[1], "-t")))\r
-       {\r
-               fprintf (stderr, "usage: -l|-t %s <servername>\n", argv[0]);\r
-               exit (-1);\r
-       }\r
-\r
-       if (strcmp(argv[1], "-l") == 0)\r
-               use_notify_options = FALSE;\r
-\r
-\r
-       if (!OpenPrinter (argv[2], &server, NULL))\r
-       {\r
-               PrintLastError();\r
-               exit (-1);\r
-       }\r
-       else\r
-       {\r
-               printf ("Printer [%s] opened successfully.\n\n", argv[2]);\r
-       }\r
-\r
-       printf ("flags = PRINTER_CHANGE_PRINTER\n");\r
-       watch.Version = 2;\r
-       watch.Count = 1;\r
-       watch.pTypes = &data;\r
-       data.Type = PRINTER_NOTIFY_TYPE;\r
-       data.Count = 1;\r
-       data.pFields = &option;\r
-\r
-       if (use_notify_options) {\r
-               pWatch = &watch;\r
-               option = PRINTER_NOTIFY_FIELD_DRIVER_NAME;\r
-       }\r
-\r
-       if ((change=FindFirstPrinterChangeNotification(server, option, 0, pWatch)) == INVALID_HANDLE_VALUE)\r
-       {\r
-               printf ("FindFirstPrinterChangeNotification failed : ");\r
-               PrintLastError();\r
-               ClosePrinter(server);\r
-               exit (-1);\r
-       }\r
-       else\r
-               printf ("FindFirstPrinterChangeNotification succeeded with flags [PRINTER_CHANGE_PRINTER_DRIVER]\n\n");\r
-\r
-       if (pWatch) {\r
-               printf ("Calling FindNextPrinterCangeNotification() with PRINTER_NOTIFY_OPTIONS_REFRESH\n");\r
-               memset(&watch, 0x0, sizeof(watch));\r
-               watch.Flags = PRINTER_NOTIFY_OPTIONS_REFRESH;\r
-               watch.Version = 2;\r
-               if (FindNextPrinterChangeNotification(change, &condition, pWatch, &change_info))\r
-                       printf ("Received change notification of [0x%x]\n", condition);\r
-               else\r
-                       PrintLastError();\r
-\r
-               if (change_info) {\r
-                       int i;\r
-\r
-                       printf("\tVersion\t=0x%x\n", change_info->Version);\r
-                       printf("\tFlags\t=0x%x\n", change_info->Flags);\r
-                       printf("\tCount\t=%d\n", change_info->Count);\r
-\r
-                       for (i=0; i<(int)change_info->Count; i++) {\r
-                               PrintNotifyInfoData(&change_info->aData[i]);\r
-                               printf("\n");\r
-                       }\r
-               }\r
-\r
-               FreePrinterNotifyInfo(change_info);\r
-               printf ("\n");\r
-       }\r
-\r
-       do \r
-       {\r
-\r
-               printf ("Waiting for Printer Change Notification...\n");\r
-\r
-               if (WaitForSingleObject(change, INFINITE) != WAIT_OBJECT_0)\r
-                       continue;\r
-\r
-               if (FindNextPrinterChangeNotification(change, &condition, NULL, &change_info))\r
-                       printf ("Received change notification of [0x%x]\n", condition);\r
-               else\r
-                       PrintLastError();\r
-\r
-               if (change_info) {\r
-                       int i;\r
-\r
-                       printf("\tVersion\t=0x%x\n", change_info->Version);\r
-                       printf("\tFlags\t=0x%x\n", change_info->Flags);\r
-                       printf("\tCount\t=%d\n", change_info->Count);\r
-\r
-                       for (i=0; i<(int)change_info->Count; i++) {\r
-                               PrintNotifyInfoData(&change_info->aData[i]);\r
-                               printf("\n");\r
-                       }\r
-               }\r
-\r
-               FreePrinterNotifyInfo(change_info);\r
-               printf ("\n");\r
-       } while (1);\r
-       \r
-\r
-       if (FindClosePrinterChangeNotification(change))\r
-               printf ("FindClosePrinterChangeNotification call succeeded.\n");\r
-       else\r
-       {\r
-               printf ("FindClosePrinterChangeNotification failed : ");\r
-               PrintLastError();\r
-       }\r
-       printf ("\n");\r
-\r
-       if (!ClosePrinter(server))\r
-               PrintLastError();\r
-       else\r
-               printf ("Printer [%s] closed successfully.\n", argv[2]);\r
-\r
-       return 0;\r
-\r
+/******************************************************************
+ * SPOOLSS regression testing code for Samba print servers
+ *
+ *****************************************************************/
+
+#include <windows.h>
+#include <stdio.h>
+#include "printlib.h"
+
+void PrintNotifyInfoData(PRINTER_NOTIFY_INFO_DATA *p)
+{
+       printf("\tType\t=0x%x\n", p->Type);
+       printf("\tField\t=0x%x\n", p->Field);
+       printf("\tId\t=0x%x\n", p->Id);
+       printf("\tdata\t= %s\n", p->NotifyData.Data.pBuf);
+
+       return;
+
+}
+
+
+int main (int argc, char* argv[])
+{
+
+       HANDLE  server, change;
+       PRINTER_NOTIFY_INFO     *change_info = NULL;
+       PRINTER_NOTIFY_OPTIONS watch, *pWatch = NULL;
+       PRINTER_NOTIFY_OPTIONS_TYPE data;
+       DWORD option = PRINTER_CHANGE_PRINTER_DRIVER;
+       BOOL use_notify_options = TRUE;
+       DWORD   condition;
+       DWORD flags = PRINTER_NOTIFY_OPTIONS_REFRESH;
+
+
+
+       if ((argc < 3) || (strcmp(argv[1], "-l") && strcmp(argv[1], "-t")))
+       {
+               fprintf (stderr, "usage: -l|-t %s <servername>\n", argv[0]);
+               exit (-1);
+       }
+
+       if (strcmp(argv[1], "-l") == 0)
+               use_notify_options = FALSE;
+
+
+       if (!OpenPrinter (argv[2], &server, NULL))
+       {
+               PrintLastError();
+               exit (-1);
+       }
+       else
+       {
+               printf ("Printer [%s] opened successfully.\n\n", argv[2]);
+       }
+
+       printf ("flags = PRINTER_CHANGE_PRINTER\n");
+       watch.Version = 2;
+       watch.Count = 1;
+       watch.pTypes = &data;
+       data.Type = PRINTER_NOTIFY_TYPE;
+       data.Count = 1;
+       data.pFields = &option;
+
+       if (use_notify_options) {
+               pWatch = &watch;
+               option = PRINTER_NOTIFY_FIELD_DRIVER_NAME;
+       }
+
+       if ((change=FindFirstPrinterChangeNotification(server, option, 0, pWatch)) == INVALID_HANDLE_VALUE)
+       {
+               printf ("FindFirstPrinterChangeNotification failed : ");
+               PrintLastError();
+               ClosePrinter(server);
+               exit (-1);
+       }
+       else
+               printf ("FindFirstPrinterChangeNotification succeeded with flags [PRINTER_CHANGE_PRINTER_DRIVER]\n\n");
+
+       if (pWatch) {
+               printf ("Calling FindNextPrinterCangeNotification() with PRINTER_NOTIFY_OPTIONS_REFRESH\n");
+               memset(&watch, 0x0, sizeof(watch));
+               watch.Flags = PRINTER_NOTIFY_OPTIONS_REFRESH;
+               watch.Version = 2;
+               if (FindNextPrinterChangeNotification(change, &condition, pWatch, &change_info))
+                       printf ("Received change notification of [0x%x]\n", condition);
+               else
+