summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-04-11 01:48:38 +0000
committerGerald Carter <jerry@samba.org>2002-04-11 01:48:38 +0000
commitb40e73e2ca520eaeb3f3751fab31be669f287938 (patch)
tree39932b5e330a83ee6a735eb41648062a05caa559 /source3
parent81ca81e85b62a10149b49d150b2a7bc591a73b5d (diff)
downloadsamba-b40e73e2ca520eaeb3f3751fab31be669f287938.tar.gz
samba-b40e73e2ca520eaeb3f3751fab31be669f287938.tar.bz2
samba-b40e73e2ca520eaeb3f3751fab31be669f287938.zip
specversion merge from SAMBA_2_2
(This used to be commit d87aa35d482824df7b5a2e87240ae43c113cc730)
Diffstat (limited to 'source3')
-rw-r--r--source3/printing/nt_printing.c2
-rw-r--r--source3/rpc_parse/parse_spoolss.c27
2 files changed, 29 insertions, 0 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index e9af659c19..26320c24fa 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -3099,6 +3099,8 @@ static WERROR save_driver_init_2(NT_PRINTER_INFO_LEVEL *printer, NT_PRINTER_PARA
goto done;
}
+ memset(nt_devmode, 0x0, sizeof(NT_DEVICEMODE));
+
ZERO_STRUCTP(nt_devmode);
/*
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c
index a995375cfe..1cbb97c337 100644
--- a/source3/rpc_parse/parse_spoolss.c
+++ b/source3/rpc_parse/parse_spoolss.c
@@ -616,6 +616,21 @@ BOOL spoolss_io_devmode(char *desc, prs_struct *ps, int depth, DEVICEMODE *devmo
return False;
if (!prs_uint32("displayfrequency", ps, depth, &devmode->displayfrequency))
return False;
+
+ /*
+ * Conditional parsing. Assume that the DeviceMode has been
+ * zero'd by the caller.
+ */
+ switch(devmode->specversion) {
+
+ /* Used by spooler when issuing OpenPrinter() calls. NT 3.5x? */
+ case 0x0320:
+ break;
+
+ /* See the comments on the DEVMODE in the msdn GDI documentation */
+ /* (WINVER >= 0x0400) */
+ case 0x0400:
+ case 0x0401:
if (!prs_uint32("icmmethod", ps, depth, &devmode->icmmethod))
return False;
if (!prs_uint32("icmintent", ps, depth, &devmode->icmintent))
@@ -628,10 +643,22 @@ BOOL spoolss_io_devmode(char *desc, prs_struct *ps, int depth, DEVICEMODE *devmo
return False;
if (!prs_uint32("reserved2", ps, depth, &devmode->reserved2))
return False;
+
+ /* (WINVER >= 0x0500) || (_WIN32_WINNT >= 0x0400) */
+ if (devmode->specversion == 0x401) {
if (!prs_uint32("panningwidth", ps, depth, &devmode->panningwidth))
return False;
if (!prs_uint32("panningheight", ps, depth, &devmode->panningheight))
return False;
+ }
+ break;
+
+ /* log an error if we see something else */
+ default:
+ DEBUG(0,("spoolss_io_devmode: Unknown specversion [0x%x]!\n", devmode->specversion));
+ DEBUG(0,("spoolss_io_devmode: Please report to samba-technical@samba.org\n"));
+ break;
+ }
if (devmode->driverextra!=0) {
if (UNMARSHALLING(ps)) {