add SetPrinterDataExW.exe.
[gd/win32-spoolss/.git] / DeletePrinterKey.c
1 /******************************************************************
2  * SPOOLSS regression testing code for Samba print servers
3  *
4  *****************************************************************/
5
6 #include <windows.h>
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include "printlib.h"
10
11 int main (int argc, char* argv[])
12 {
13
14         HANDLE                  printer;
15         DWORD                   status;
16
17
18         if (argc < 2)
19         {
20                 fprintf (stderr, "useage: %s <printername>\n", argv[0]);
21                 exit (-1);
22         }
23
24         /* open the server */
25         if (!OpenPrinter (argv[1], &printer, NULL))
26                 PrintLastError();
27         else
28                 printf ("Printer [%s] opened successfully.\n\n", argv[1]);
29
30
31         status = DeletePrinterKey(printer, "PrinterDriverData");
32         if (status != ERROR_SUCCESS)
33                 PrintLastError();
34         else
35                 printf ("Success!\n");
36
37
38         /* close the server */
39         if (!ClosePrinter(printer))
40                 PrintLastError();
41         else
42                 printf ("Printer [%s] closed successfully.\n", argv[1]);
43
44         return 0;
45
46 }