From 3123dde48e9cdc5ed45c52c7e500877c7579711d Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 8 Apr 2002 00:27:36 +0000 Subject: A devicemode contains a uint32 at the start which represents the size of the structure. Fixed an off by one but in displaying the device mode in a PRINTER_INFO_2 structure. The devicemode in a devicemode container is not a deferred pointer but rather occurs immediately after the pointer if it is non-NULL. svn path=/trunk/; revision=5114 --- packet-dcerpc-spoolss.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'packet-dcerpc-spoolss.c') diff --git a/packet-dcerpc-spoolss.c b/packet-dcerpc-spoolss.c index d7a4dadf88..42c8a3c8c0 100644 --- a/packet-dcerpc-spoolss.c +++ b/packet-dcerpc-spoolss.c @@ -2,7 +2,7 @@ * Routines for SMB \PIPE\spoolss packet disassembly * Copyright 2001-2002, Tim Potter * - * $Id: packet-dcerpc-spoolss.c,v 1.14 2002/04/05 03:07:28 tpot Exp $ + * $Id: packet-dcerpc-spoolss.c,v 1.15 2002/04/08 00:27:36 tpot Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -747,6 +747,8 @@ static int prs_DEVMODE(tvbuff_t *tvb, int offset, packet_info *pinfo, subtree = proto_item_add_subtree(item, ett_DEVMODE); + offset = prs_uint32(tvb, offset, pinfo, subtree, NULL, "Size"); + /* The device name is stored in a 32-wchar buffer */ prs_uint16uni(tvb, offset, pinfo, subtree, NULL, "Devicename"); @@ -975,8 +977,8 @@ static int prs_PRINTER_INFO_2(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = prs_uint32(tvb, offset, pinfo, tree, &rel_offset, NULL); - prs_DEVMODE( - tvb, struct_start + rel_offset, pinfo, tree, dp_list, NULL); + prs_DEVMODE(tvb, struct_start + rel_offset - 4, pinfo, tree, + dp_list, NULL); offset = prs_relstr(tvb, offset, pinfo, tree, dp_list, struct_start, NULL, "Separator file"); @@ -1054,7 +1056,8 @@ static int prs_DEVMODE_CTR(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = prs_ptr(tvb, offset, pinfo, subtree, &ptr, "Devicemode"); if (ptr) - defer_ptr(dp_list, prs_DEVMODE, subtree); + offset = prs_DEVMODE(tvb, offset, pinfo, subtree, dp_list, + data); return offset; } -- cgit v1.2.3