Update README to say GPLv2 or later and remove references to bzr.
[jerry/slag.git] / win32 / spoolss / DeletePrinterDriver.c
1 /******************************************************************\r
2  * SPOOLSS regression testing code for Samba print servers\r
3  * \r
4  *****************************************************************/\r
5 \r
6 #include <windows.h>\r
7 #include <stdio.h>\r
8 #include "printlib.h"\r
9 \r
10 /* we assume the necessary driver files are already uploaded\r
11    on the server.  We also only exercise The info level 3\r
12    since that is the one used by the NT Add Printer Wizard */\r
13 int main (int argc, char* argv[])\r
14 {\r
15         LPVOID                  lpMsgBuf;\r
16 \r
17         if (argc < 3)\r
18         {\r
19                 fprintf (stderr, "useage: %s <servername> <arch> <driver name>\n", argv[0]);\r
20                 exit (-1);\r
21         }\r
22 \r
23 \r
24         if (!DeletePrinterDriver(argv[1], argv[2], argv[3]))\r
25         {\r
26                 FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | \r
27                         FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),\r
28                         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language\r
29                         (LPTSTR) &lpMsgBuf, 0, NULL);\r
30                 printf ("ERROR : %s\n", (char*)lpMsgBuf);\r
31                 LocalFree (lpMsgBuf);\r
32         }\r
33         else\r
34         {\r
35                 printf ("Printer Driver deleted successfully\n");\r
36         }\r
37 \r
38 \r
39         return 0;\r
40 \r
41 }