1 /******************************************************************
\r
2 * SPOOLSS regression testing code for Samba print servers
\r
4 *****************************************************************/
\r
8 #include "printlib.h"
\r
11 int main (int argc, char* argv[])
\r
19 fprintf (stderr, "useage: %s <printername> <form name>\n", argv[0]);
\r
23 /* open the printer */
\r
24 if (!OpenPrinter (argv[1], &printer, NULL))
\r
26 fprintf (stderr, "Unable to open %s!\n", argv[1]);
\r
31 printf ("Printer [%s] opened successfully.\n\n", argv[1]);
\r
34 printf ("Attempting to remove %s...\n", argv[2]);
\r
35 if (!DeleteForm(printer, (LPTSTR)argv[2]))
\r
37 FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
\r
38 FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
\r
39 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
\r
40 (LPTSTR) &lpMsgBuf, 0, NULL);
\r
41 printf ("ERROR : %s\n", (char*)lpMsgBuf);
\r
42 LocalFree (lpMsgBuf);
\r
46 printf ("Form removed successfully!\n");
\r
51 /* close the printer */
\r
52 if (!ClosePrinter(printer))
\r
54 fprintf (stderr, "Error closing printer!\n");
\r
59 printf ("Printer [%s] closed successfully.\n", argv[1]);
\r