1 /******************************************************************
\r
2 * SPOOLSS regression testing code for Samba print servers
\r
4 *****************************************************************/
\r
9 #include "printlib.h"
\r
12 #define MAX_JOBS 100
\r
14 int main (int argc, char* argv[])
\r
18 DWORD type, pcbData;
\r
19 LPBYTE pData = NULL;
\r
25 fprintf (stderr, "useage: %s <printername> <value name>\n", argv[0]);
\r
29 /* open the printer */
\r
30 if (!OpenPrinter (argv[1], &printer, NULL))
\r
32 fprintf (stderr, "Unable to open %s!\n", argv[1]);
\r
37 printf ("Printer [%s] opened successfully.\n\n", argv[1]);
\r
40 status=GetPrinterData(printer, argv[2], &type, pData, 0, &pcbData);
\r
41 if ((status != ERROR_SUCCESS) && (status != ERROR_MORE_DATA))
\r
44 ClosePrinter (printer);
\r
48 if ((pData = (LPBYTE)malloc(pcbData)) == NULL)
\r
50 fprintf (stderr, "Unable to malloc memory for Value Data!\n");
\r
54 status = GetPrinterData(printer, argv[2], &type, pData, pcbData, &pcbData);
\r
55 if (status == ERROR_SUCCESS)
\r
57 printf ("\tValue Name = %s\n", argv[2]);
\r
58 printf ("\tType = %d\n", type);
\r
59 printf ("\tData = 0x%x bytes\n", pcbData);
\r
63 printf ("\t0x%x", *(pData++));
\r
75 /* close the printer */
\r
76 if (!ClosePrinter(printer))
\r
78 fprintf (stderr, "Error closing printer!\n");
\r
83 printf ("Printer [%s] closed successfully.\n", argv[1]);
\r