From 642ae912566d4e4f60fc5d78aecce114d6e3a849 Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Thu, 27 Jul 2000 07:59:39 +0000 Subject: fix the devmode.orientation being set to 0. that bug was *subtle* :-( J.F. (This used to be commit 0e9e048b6d65b57bdcc7440ddaa9d2cc1eac71dc) --- source3/printing/nt_printing.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source3/printing/nt_printing.c') diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 0161ee05e8..2fb1cbc998 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -1257,6 +1257,7 @@ static void free_nt_printer_info_level_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr) static int unpack_devicemode(NT_DEVICEMODE **nt_devmode, char *buf, int buflen) { int len = 0; + int extra_len = 0; NT_DEVICEMODE devmode; ZERO_STRUCT(devmode); @@ -1304,8 +1305,13 @@ static int unpack_devicemode(NT_DEVICEMODE **nt_devmode, char *buf, int buflen) &devmode.panningheight, &devmode.private); - if (devmode.private) - len += tdb_unpack(buf+len, buflen-len, "B", &devmode.driverextra, &devmode.private); + if (devmode.private) { + /* the len in tdb_unpack is an int value and + * devmoce.driverextra is only a short + */ + len += tdb_unpack(buf+len, buflen-len, "B", &extra_len, &devmode.private); + devmode.driverextra=(uint16)extra_len; + } *nt_devmode = (NT_DEVICEMODE *)memdup(&devmode, sizeof(devmode)); -- cgit