From f7e4e37c63044c378a1ea624304b331c9c443fc9 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 20 Dec 2001 15:09:23 +0000 Subject: merge from 2.2 (This used to be commit 72d3b160229ce9ab8497579ee79668738a70a81f) --- source3/rpc_parse/parse_spoolss.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index f6d629f857..14e22c4195 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -6368,6 +6368,7 @@ static BOOL spoolss_io_printer_enum_values_ctr(char *desc, prs_struct *ps, uint32 valuename_offset, data_offset, current_offset; + const uint32 basic_unit = 20; /* size of static portion of enum_values */ prs_debug(ps, depth, desc, "spoolss_io_printer_enum_values_ctr"); depth++; @@ -6375,10 +6376,9 @@ static BOOL spoolss_io_printer_enum_values_ctr(char *desc, prs_struct *ps, if (!prs_uint32("size", ps, depth, &ctr->size)) return False; - /* offset data begins at 20 bytes per structure * size_of_array. - Don't forget the uint32 at the beginning */ + /* offset data begins at 20 bytes per structure * size_of_array. */ - current_offset = 4 + (20*ctr->size_of_array); + current_offset = basic_unit * ctr->size_of_array; /* first loop to write basic enum_value information */ @@ -6401,13 +6401,13 @@ static BOOL spoolss_io_printer_enum_values_ctr(char *desc, prs_struct *ps, if (!prs_uint32("data_len", ps, depth, &ctr->values[i].data_len)) return False; - current_offset = data_offset + ctr->values[i].data_len; + current_offset = data_offset + ctr->values[i].data_len - basic_unit; } /* loop #2 for writing the dynamically size objects - while viewing oncversations between Win2k -> Win2k, - 4-byte alignment does not seem to matter here --jerrty */ + while viewing conversations between Win2k -> Win2k, + 4-byte alignment does not seem to matter here --jerry */ for (i=0; isize_of_array; i++) { -- cgit