From 528ff0d6f724f74800a5098ef2ec6106d67164a6 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 22 Jan 2002 18:14:31 +0000 Subject: merge from 2.2. of * PRINTER_ATTRIBUTE's * "default devmode" parameter (This used to be commit 90a7a1840b4823d4ebe047130a95dd15a824500b) --- source3/printing/nt_printing.c | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'source3/printing') 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 -- cgit