summaryrefslogtreecommitdiff
path: root/source3/printing/nt_printing.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-07-19 20:11:11 +0000
committerJeremy Allison <jra@samba.org>2000-07-19 20:11:11 +0000
commit5c162bbe5b6ce32f894c3ee77da9dcdd9c840ad4 (patch)
treea6e9c9ede92831ad5e3e6bf995632fe6c049ce83 /source3/printing/nt_printing.c
parent3c9e410c340d53897a3f97243d8286812704f6c0 (diff)
downloadsamba-5c162bbe5b6ce32f894c3ee77da9dcdd9c840ad4.tar.gz
samba-5c162bbe5b6ce32f894c3ee77da9dcdd9c840ad4.tar.bz2
samba-5c162bbe5b6ce32f894c3ee77da9dcdd9c840ad4.zip
Code from John Reilly <jreilly@hp.com> to add tdb lookups into the Win95
printer driver download if looking for the default driver files fail. Jeremy. (This used to be commit 1192d867c4e863471f9bc12afceb68a23ba2142e)
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r--source3/printing/nt_printing.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 00735ecbc1..d1cb7e8f34 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -455,6 +455,61 @@ static uint32 get_a_printer_driver_3(NT_PRINTER_DRIVER_INFO_LEVEL_3 **info_ptr,
}
/****************************************************************************
+****************************************************************************/
+uint32 get_a_printer_driver_9x_compatible(pstring line, fstring model)
+{
+ NT_PRINTER_DRIVER_INFO_LEVEL_3 *info3;
+ TDB_DATA kbuf, dbuf;
+ pstring key;
+ int i;
+ line[0] = '\0';
+
+ slprintf(key, sizeof(key), "%s%s/%s", DRIVERS_PREFIX, "WIN40", model);
+ DEBUG(10,("driver key: [%s]\n", key));
+
+ kbuf.dptr = key;
+ kbuf.dsize = strlen(key)+1;
+ if (!tdb_exists(tdb, kbuf)) return False;
+
+ ZERO_STRUCT(info3);
+ get_a_printer_driver_3(&info3, model, "Windows 4.0");
+
+ DEBUGADD(10,("info3->name [%s]\n", info3->name));
+ DEBUGADD(10,("info3->datafile [%s]\n", info3->datafile));
+ DEBUGADD(10,("info3->helpfile [%s]\n", info3->helpfile));
+ DEBUGADD(10,("info3->monitorname [%s]\n", info3->monitorname));
+ DEBUGADD(10,("info3->defaultdatatype [%s]\n", info3->defaultdatatype));
+ for (i=0; info3->dependentfiles && *info3->dependentfiles[i]; i++) {
+ DEBUGADD(10,("info3->dependentfiles [%s]\n", info3->dependentfiles[i]));
+ }
+ DEBUGADD(10,("info3->environment [%s]\n", info3->environment));
+ DEBUGADD(10,("info3->driverpath [%s]\n", info3->driverpath));
+ DEBUGADD(10,("info3->configfile [%s]\n", info3->configfile));
+
+ /*pstrcat(line, info3->name); pstrcat(line, ":");*/
+ pstrcat(line, info3->configfile);
+ pstrcat(line, ":");
+ pstrcat(line, info3->datafile);
+ pstrcat(line, ":");
+ pstrcat(line, info3->helpfile);
+ pstrcat(line, ":");
+ pstrcat(line, info3->monitorname);
+ pstrcat(line, ":");
+ pstrcat(line, "RAW"); /*info3->defaultdatatype);*/
+ pstrcat(line, ":");
+
+ for (i=0; info3->dependentfiles &&
+ *info3->dependentfiles[i]; i++) {
+ if (i) pstrcat(line, ","); /* don't end in a "," */
+ pstrcat(line, info3->dependentfiles[i]);
+ }
+
+ free(info3);
+
+ return True;
+}
+
+/****************************************************************************
debugging function, dump at level 6 the struct in the logs
****************************************************************************/
static uint32 dump_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 level)