1 /******************************************************************
\r
2 * SPOOLSS regression testing code for Samba print servers
\r
4 *****************************************************************/
\r
8 #include "printlib.h"
\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
15 DRIVER_INFO_3 buffer3;
\r
16 BYTE pDependentFiles[] = { "PSCRIPT.HLP\0PSCRPTUI.DLL\0PSCRIPT.DLL\0LWNTX518.PPD\0\0" };
\r
21 fprintf (stderr, "useage: %s <servername>\n", argv[0]);
\r
25 /* we'll use the Apple LaserWriter II NTX v51.8 driver
\r
27 buffer3.cVersion = 2;
\r
28 buffer3.pEnvironment = strdup("Windows NT x86");
\r
29 buffer3.pName = strdup("Apple LaserWriter II NTX v51.8");
\r
30 buffer3.pDriverPath = strdup("pscript.dll");
\r
31 buffer3.pDataFile = strdup("lwntx518.ppd");
\r
32 buffer3.pConfigFile = strdup("pscriptui.dll");
\r
33 buffer3.pDependentFiles = pDependentFiles;
\r
34 buffer3.pHelpFile = strdup("pscript.hlp");
\r
35 buffer3.pMonitorName = NULL;
\r
36 buffer3.pDefaultDataType = strdup("RAW");
\r
38 printf ("Attempting to add Driver Info Level 3 :\n");
\r
39 print_driver_info_3 (&buffer3);
\r
43 if (!AddPrinterDriver(argv[1], 3, (LPBYTE)&buffer3))
\r
45 FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
\r
46 FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(),
\r
47 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
\r
48 (LPTSTR) &lpMsgBuf, 0, NULL);
\r
49 printf ("ERROR : %s\n", (char*)lpMsgBuf);
\r
50 LocalFree (lpMsgBuf);
\r
54 printf ("Printer Driver installed successfully\n");
\r