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