summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-01-22 18:14:31 +0000
committerGerald Carter <jerry@samba.org>2002-01-22 18:14:31 +0000
commit528ff0d6f724f74800a5098ef2ec6106d67164a6 (patch)
treecf7fc127c6db629b95fe7358a14c1118888f7888 /source3/printing
parent73af0a70f5c55192f48e2b0f2815ec3e0747fd90 (diff)
downloadsamba-528ff0d6f724f74800a5098ef2ec6106d67164a6.tar.gz
samba-528ff0d6f724f74800a5098ef2ec6106d67164a6.tar.bz2
samba-528ff0d6f724f74800a5098ef2ec6106d67164a6.zip
merge from 2.2. of
* PRINTER_ATTRIBUTE's * "default devmode" parameter (This used to be commit 90a7a1840b4823d4ebe047130a95dd15a824500b)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 0f02266c0f..0ba0f45452 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -2425,10 +2425,7 @@ static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstrin
fstrcpy(info.printprocessor, "winprint");
fstrcpy(info.datatype, "RAW");
- info.attributes = PRINTER_ATTRIBUTE_SHARED \
- | PRINTER_ATTRIBUTE_LOCAL \
- | PRINTER_ATTRIBUTE_RAW_ONLY \
- | PRINTER_ATTRIBUTE_QUEUED ; /* attributes */
+ info.attributes = (PRINTER_ATTRIBUTE_SHARED | PRINTER_ATTRIBUTE_NETWORK);
info.starttime = 0; /* Minutes since 12:00am GMT */
info.untiltime = 0; /* Minutes since 12:00am GMT */
@@ -2440,20 +2437,19 @@ static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstrin
* I changed this as I think it is better to have a generic
* DEVMODE than to crash Win2k explorer.exe --jerry
* See the HP Deskjet 990c Win2k drivers for an example.
+ *
+ * However the default devmode appears to cause problems
+ * with the HP CLJ 8500 PCL driver. Hence the addition of
+ * the "default devmode" parameter --jerry 22/01/2002
*/
-#if 0 /* JRA - NO NOT CHANGE ! */
- info.devmode = NULL;
-#else
- /*
- * We should not return a default devicemode, as this causes
- * Win2K to not send the correct one on PCL drivers. It needs to
- * see a null devicemode so it can then overwrite the devicemode
- * on OpenPrinterEx. Yes this *is* insane :-). JRA.
- */
- if ((info.devmode = construct_nt_devicemode(info.printername)) == NULL)
- goto fail;
-#endif
+ if (lp_default_devmode(snum)) {
+ info.devmode = NULL;
+ }
+ else {
+ if ((info.devmode = construct_nt_devicemode(info.printername)) == NULL)
+ goto fail;
+ }
/* This will get the current RPC talloc context, but we should be
passing this as a parameter... fixme... JRA ! */
@@ -2522,7 +2518,7 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstring sharen
info.parameters);
/* Samba has to have shared raw drivers. */
- info.attributes |= (PRINTER_ATTRIBUTE_SHARED|PRINTER_ATTRIBUTE_RAW_ONLY);
+ info.attributes |= (PRINTER_ATTRIBUTE_SHARED | PRINTER_ATTRIBUTE_NETWORK);
/* Restore the stripped strings. */
slprintf(info.servername, sizeof(info.servername)-1, "\\\\%s", get_called_name());
@@ -2531,19 +2527,22 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstring sharen
fstrcpy(info.printername, printername);
len += unpack_devicemode(&info.devmode,dbuf.dptr+len, dbuf.dsize-len);
-#if 1
+
/*
* Some client drivers freak out if there is a NULL devmode
* (probably the driver is not checking before accessing
* the devmode pointer) --jerry
+ *
+ * See comments in get_a_printer_2_default()
*/
- if (!info.devmode)
+
+ if (lp_default_devmode(lp_servicenumber(sharename)) && !info.devmode)
{
DEBUG(8,("get_a_printer_2: Constructing a default device mode for [%s]\n",
printername));
info.devmode = construct_nt_devicemode(printername);
}
-#endif
+
len += unpack_specifics(&info.specific,dbuf.dptr+len, dbuf.dsize-len);
/* This will get the current RPC talloc context, but we should be