1 /* packet-dcerpc-spoolss.c
2 * Routines for SMB \PIPE\spoolss packet disassembly
3 * Copyright 2001-2003, Tim Potter <tpot@samba.org>
5 * $Id: packet-dcerpc-spoolss.c,v 1.107 2004/01/19 20:10:35 jmayer Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 - audit of item lengths
39 #include <epan/packet.h>
40 #include "packet-dcerpc.h"
41 #include "packet-dcerpc-nt.h"
42 #include "packet-dcerpc-spoolss.h"
43 #include "packet-dcerpc-reg.h"
45 #include "packet-smb-common.h"
47 /* GetPrinterDriver2 */
49 static int hf_clientmajorversion = -1;
50 static int hf_clientminorversion = -1;
51 static int hf_servermajorversion = -1;
52 static int hf_serverminorversion = -1;
53 static int hf_driverpath = -1;
54 static int hf_datafile = -1;
55 static int hf_configfile = -1;
56 static int hf_helpfile = -1;
57 static int hf_monitorname = -1;
58 static int hf_defaultdatatype = -1;
59 static int hf_driverinfo_cversion = -1;
60 static int hf_dependentfiles = -1;
66 static int hf_start_time = -1;
67 static int hf_end_time = -1;
68 static int hf_elapsed_time = -1;
70 /****************************************************************************/
73 * New hf index values - I'm in the process of doing a bit of a cleanup -tpot
76 static int hf_opnum = -1;
77 static int hf_hnd = -1;
78 static int hf_rc = -1;
79 static int hf_offered = -1;
80 static int hf_needed = -1;
81 static int hf_returned = -1;
82 static int hf_buffer_size = -1;
83 static int hf_buffer_data = -1;
84 static int hf_offset = -1;
85 static int hf_level = -1;
86 static int hf_access_required = -1;
88 static int hf_printername = -1;
89 static int hf_machinename = -1;
90 static int hf_notifyname = -1;
91 static int hf_printerdesc = -1;
92 static int hf_printercomment = -1;
93 static int hf_servername = -1;
94 static int hf_sharename = -1;
95 static int hf_portname = -1;
96 static int hf_printerlocation = -1;
97 static int hf_drivername = -1;
98 static int hf_architecture = -1;
99 static int hf_username = -1;
100 static int hf_documentname = -1;
101 static int hf_outputfile = -1;
102 static int hf_datatype = -1;
103 static int hf_textstatus = -1;
104 static int hf_sepfile = -1;
105 static int hf_printprocessor = -1;
106 static int hf_parameters = -1;
108 /* Printer information */
110 static int hf_printer_cjobs = -1;
111 static int hf_printer_total_jobs = -1;
112 static int hf_printer_total_bytes = -1;
113 static int hf_printer_global_counter = -1;
114 static int hf_printer_total_pages = -1;
115 static int hf_printer_major_version = -1;
116 static int hf_printer_build_version = -1;
117 static int hf_printer_unk7 = -1;
118 static int hf_printer_unk8 = -1;
119 static int hf_printer_unk9 = -1;
120 static int hf_printer_session_ctr = -1;
121 static int hf_printer_unk11 = -1;
122 static int hf_printer_printer_errors = -1;
123 static int hf_printer_unk13 = -1;
124 static int hf_printer_unk14 = -1;
125 static int hf_printer_unk15 = -1;
126 static int hf_printer_unk16 = -1;
127 static int hf_printer_changeid = -1;
128 static int hf_printer_unk18 = -1;
129 static int hf_printer_unk20 = -1;
130 static int hf_printer_c_setprinter = -1;
131 static int hf_printer_unk22 = -1;
132 static int hf_printer_unk23 = -1;
133 static int hf_printer_unk24 = -1;
134 static int hf_printer_unk25 = -1;
135 static int hf_printer_unk26 = -1;
136 static int hf_printer_unk27 = -1;
137 static int hf_printer_unk28 = -1;
138 static int hf_printer_unk29 = -1;
139 static int hf_printer_flags = -1;
140 static int hf_printer_priority = -1;
141 static int hf_printer_default_priority = -1;
142 static int hf_printer_jobs = -1;
143 static int hf_printer_averageppm = -1;
144 static int hf_printer_guid = -1;
145 static int hf_printer_action = -1;
149 static int hf_printerdata = -1;
150 static int hf_printerdata_key = -1;
151 static int hf_printerdata_value = -1;
152 static int hf_printerdata_type = -1;
153 static int hf_printerdata_size = -1; /* Length of printer data */
154 static int hf_printerdata_data = -1;
155 static int hf_printerdata_data_sz = -1;
156 static int hf_printerdata_data_dword = -1;
160 static int hf_devmodectr_size = -1;
162 static int hf_devmode = -1;
163 static int hf_devmode_size = -1;
164 static int hf_devmode_spec_version = -1;
165 static int hf_devmode_driver_version = -1;
166 static int hf_devmode_size2 = -1;
167 static int hf_devmode_driver_extra_len = -1;
168 static int hf_devmode_fields = -1;
169 static int hf_devmode_orientation = -1;
170 static int hf_devmode_paper_size = -1;
171 static int hf_devmode_paper_width = -1;
172 static int hf_devmode_paper_length = -1;
173 static int hf_devmode_scale = -1;
174 static int hf_devmode_copies = -1;
175 static int hf_devmode_default_source = -1;
176 static int hf_devmode_print_quality = -1;
177 static int hf_devmode_color = -1;
178 static int hf_devmode_duplex = -1;
179 static int hf_devmode_y_resolution = -1;
180 static int hf_devmode_tt_option = -1;
181 static int hf_devmode_collate = -1;
182 static int hf_devmode_log_pixels = -1;
183 static int hf_devmode_bits_per_pel = -1;
184 static int hf_devmode_pels_width = -1;
185 static int hf_devmode_pels_height = -1;
186 static int hf_devmode_display_flags = -1;
187 static int hf_devmode_display_freq = -1;
188 static int hf_devmode_icm_method = -1;
189 static int hf_devmode_icm_intent = -1;
190 static int hf_devmode_media_type = -1;
191 static int hf_devmode_dither_type = -1;
192 static int hf_devmode_reserved1 = -1;
193 static int hf_devmode_reserved2 = -1;
194 static int hf_devmode_panning_width = -1;
195 static int hf_devmode_panning_height = -1;
196 static int hf_devmode_driver_extra = -1;
198 static int hf_devmode_fields_orientation = -1;
199 static int hf_devmode_fields_papersize = -1;
200 static int hf_devmode_fields_paperlength = -1;
201 static int hf_devmode_fields_paperwidth = -1;
202 static int hf_devmode_fields_scale = -1;
203 static int hf_devmode_fields_position = -1;
204 static int hf_devmode_fields_nup = -1;
205 static int hf_devmode_fields_copies = -1;
206 static int hf_devmode_fields_defaultsource = -1;
207 static int hf_devmode_fields_printquality = -1;
208 static int hf_devmode_fields_color = -1;
209 static int hf_devmode_fields_duplex = -1;
210 static int hf_devmode_fields_yresolution = -1;
211 static int hf_devmode_fields_ttoption = -1;
212 static int hf_devmode_fields_collate = -1;
213 static int hf_devmode_fields_formname = -1;
214 static int hf_devmode_fields_logpixels = -1;
215 static int hf_devmode_fields_bitsperpel = -1;
216 static int hf_devmode_fields_pelswidth = -1;
217 static int hf_devmode_fields_pelsheight = -1;
218 static int hf_devmode_fields_displayflags = -1;
219 static int hf_devmode_fields_displayfrequency = -1;
220 static int hf_devmode_fields_icmmethod = -1;
221 static int hf_devmode_fields_icmintent = -1;
222 static int hf_devmode_fields_mediatype = -1;
223 static int hf_devmode_fields_dithertype = -1;
224 static int hf_devmode_fields_panningwidth = -1;
225 static int hf_devmode_fields_panningheight = -1;
229 static int hf_job_id = -1;
230 static int hf_job_priority = -1;
231 static int hf_job_position = -1;
232 static int hf_job_totalpages = -1;
233 static int hf_job_totalbytes = -1;
234 static int hf_job_pagesprinted = -1;
235 static int hf_job_bytesprinted = -1;
236 static int hf_job_size = -1;
238 static int hf_job_status = -1;
239 static int hf_job_status_paused = -1;
240 static int hf_job_status_error = -1;
241 static int hf_job_status_deleting = -1;
242 static int hf_job_status_spooling = -1;
243 static int hf_job_status_printing = -1;
244 static int hf_job_status_offline = -1;
245 static int hf_job_status_paperout = -1;
246 static int hf_job_status_printed = -1;
247 static int hf_job_status_deleted = -1;
248 static int hf_job_status_blocked = -1;
249 static int hf_job_status_user_intervention = -1;
253 static int hf_form = -1;
254 static int hf_form_level = -1;
255 static int hf_form_name = -1;
256 static int hf_form_flags = -1;
257 static int hf_form_unknown = -1;
258 static int hf_form_width = -1;
259 static int hf_form_height = -1;
260 static int hf_form_left_margin = -1;
261 static int hf_form_top_margin = -1;
262 static int hf_form_horiz_len = -1;
263 static int hf_form_vert_len = -1;
265 static int hf_enumforms_num = -1;
269 static int hf_notify_options_version = -1;
270 static int hf_notify_options_flags = -1;
271 static int hf_notify_options_flags_refresh = -1;
272 static int hf_notify_options_count = -1;
273 static int hf_notify_option_type = -1;
274 static int hf_notify_option_reserved1 = -1;
275 static int hf_notify_option_reserved2 = -1;
276 static int hf_notify_option_reserved3 = -1;
277 static int hf_notify_option_count = -1;
278 static int hf_notify_option_data_count = -1;
279 static int hf_notify_info_count = -1;
280 static int hf_notify_info_version = -1;
281 static int hf_notify_info_flags = -1;
282 static int hf_notify_info_data_type = -1;
283 static int hf_notify_info_data_count = -1;
284 static int hf_notify_info_data_id = -1;
285 static int hf_notify_info_data_value1 = -1;
286 static int hf_notify_info_data_value2 = -1;
287 static int hf_notify_info_data_bufsize = -1;
288 static int hf_notify_info_data_buffer = -1;
289 static int hf_notify_info_data_buffer_len = -1;
290 static int hf_notify_info_data_buffer_data = -1;
292 static int hf_notify_field = -1;
294 static int hf_printerlocal = -1;
296 static int hf_rrpcn_changelow = -1;
297 static int hf_rrpcn_changehigh = -1;
298 static int hf_rrpcn_unk0 = -1;
299 static int hf_rrpcn_unk1 = -1;
301 static int hf_replyopenprinter_unk0 = -1;
302 static int hf_replyopenprinter_unk1 = -1;
304 /****************************************************************************/
307 * Dissect SPOOLSS specific access rights
310 static int hf_server_access_admin = -1;
311 static int hf_server_access_enum = -1;
312 static int hf_printer_access_admin = -1;
313 static int hf_printer_access_use = -1;
314 static int hf_job_access_admin = -1;
317 spoolss_printer_specific_rights(tvbuff_t *tvb, gint offset, proto_tree *tree,
320 proto_tree_add_boolean(
321 tree, hf_printer_access_use, tvb, offset, 4, access);
323 proto_tree_add_boolean(
324 tree, hf_printer_access_admin, tvb, offset, 4, access);
327 struct access_mask_info spoolss_printer_access_mask_info = {
329 spoolss_printer_specific_rights,
330 NULL, /* Generic mapping table */
331 NULL /* Standard mapping table */
335 spoolss_printserver_specific_rights(tvbuff_t *tvb, gint offset,
336 proto_tree *tree, guint32 access)
338 proto_tree_add_boolean(
339 tree, hf_server_access_enum, tvb, offset, 4, access);
341 proto_tree_add_boolean(
342 tree, hf_server_access_admin, tvb, offset, 4, access);
345 struct access_mask_info spoolss_printserver_access_mask_info = {
346 "SPOOLSS print server",
347 spoolss_printserver_specific_rights,
348 NULL, /* Generic mapping table */
349 NULL /* Standard mapping table */
353 spoolss_job_specific_rights(tvbuff_t *tvb, gint offset,
354 proto_tree *tree, guint32 access)
356 proto_tree_add_boolean(
357 tree, hf_job_access_admin, tvb, offset, 4, access);
360 struct access_mask_info spoolss_job_access_mask_info = {
362 spoolss_job_specific_rights,
363 NULL, /* Generic mapping table */
364 NULL /* Standard mapping table */
368 * Routines to dissect a spoolss BUFFER
373 proto_item *tree; /* Proto tree buffer located in */
377 static gint ett_BUFFER = -1;
380 dissect_spoolss_buffer_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
381 proto_tree *tree, guint8 *drep)
383 dcerpc_info *di = pinfo->private_data;
384 BUFFER *b = (BUFFER *)di->private_data;
389 if (di->conformant_run)
392 /* Dissect size and data */
394 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
395 hf_buffer_size, &size);
397 offset = dissect_ndr_uint8s(tvb, offset, pinfo, NULL, drep,
398 hf_buffer_data, size, &data);
400 item = proto_tree_add_item(
401 tree, hf_buffer_data, tvb, offset - size,
402 size, drep[0] & 0x10);
404 /* Return buffer info */
408 /* I'm not sure about this. Putting the buffer into
409 it's own tvb makes sense and the dissection code is
410 much clearer, but the data is a proper subset of
411 the actual tvb. Not adding the new data source
412 makes the hex display confusing as it switches
413 between the 'DCERPC over SMB' tvb and the buffer
414 tvb with no visual cues as to what is going on. */
416 b->tvb = tvb_new_real_data(data, size, size);
417 tvb_set_child_real_data_tvbuff(tvb, b->tvb);
418 add_new_data_source(pinfo, b->tvb, "SPOOLSS buffer");
421 b->tree = proto_item_add_subtree(item, ett_BUFFER);
427 /* Dissect a spoolss buffer and return buffer data */
430 dissect_spoolss_buffer(tvbuff_t *tvb, gint offset, packet_info *pinfo,
431 proto_tree *tree, guint8 *drep, BUFFER *b)
433 dcerpc_info *di = pinfo->private_data;
436 memset(b, 0, sizeof(BUFFER));
438 di->private_data = b;
440 offset = dissect_ndr_pointer(
441 tvb, offset, pinfo, tree, drep,
442 dissect_spoolss_buffer_data, NDR_POINTER_UNIQUE,
452 static gint ett_SYSTEM_TIME;
454 static int hf_time_year = -1;
455 static int hf_time_month = -1;
456 static int hf_time_dow = -1;
457 static int hf_time_day = -1;
458 static int hf_time_hour = -1;
459 static int hf_time_minute = -1;
460 static int hf_time_second = -1;
461 static int hf_time_msec = -1;
464 dissect_SYSTEM_TIME(tvbuff_t *tvb, int offset, packet_info *pinfo,
465 proto_tree *tree, guint8 *drep, char *name,
466 gboolean add_subtree, char **data)
468 proto_item *item = NULL;
469 proto_tree *subtree = tree;
470 guint16 year, month, day, hour, minute, second, millisecond;
474 item = proto_tree_add_text(tree, tvb, offset, 16, name);
475 subtree = proto_item_add_subtree(item, ett_SYSTEM_TIME);
478 offset = dissect_ndr_uint16(
479 tvb, offset, pinfo, subtree, drep, hf_time_year, &year);
481 offset = dissect_ndr_uint16(
482 tvb, offset, pinfo, subtree, drep, hf_time_month, &month);
484 offset = dissect_ndr_uint16(
485 tvb, offset, pinfo, subtree, drep, hf_time_dow, NULL);
487 offset = dissect_ndr_uint16(
488 tvb, offset, pinfo, subtree, drep, hf_time_day, &day);
490 offset = dissect_ndr_uint16(
491 tvb, offset, pinfo, subtree, drep, hf_time_hour, &hour);
493 offset = dissect_ndr_uint16(
494 tvb, offset, pinfo, subtree, drep, hf_time_minute, &minute);
496 offset = dissect_ndr_uint16(
497 tvb, offset, pinfo, subtree, drep, hf_time_second, &second);
499 offset = dissect_ndr_uint16(
500 tvb, offset, pinfo, subtree, drep, hf_time_msec, &millisecond);
502 str = g_strdup_printf("%d/%02d/%02d %02d:%02d:%02d.%03d",
503 year, month, day, hour, minute, second,
507 proto_item_append_text(item, ": %s", str);
518 dissect_SYSTEM_TIME_ptr(tvbuff_t *tvb, int offset, packet_info *pinfo,
519 proto_tree *tree, guint8 *drep)
521 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
522 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
525 offset = dissect_SYSTEM_TIME(
526 tvb, offset, pinfo, tree, drep, NULL, FALSE, &str);
528 dcv->private_data = str;
534 * SpoolssClosePrinter
537 static int SpoolssClosePrinter_q(tvbuff_t *tvb, int offset,
538 packet_info *pinfo, proto_tree *tree,
541 e_ctx_hnd policy_hnd;
546 offset = dissect_nt_policy_hnd(
547 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, NULL,
550 dcerpc_smb_fetch_pol(&policy_hnd, &pol_name, NULL, NULL,
553 if (check_col(pinfo->cinfo, COL_INFO) && pol_name)
554 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
560 static int SpoolssClosePrinter_r(tvbuff_t *tvb, int offset,
561 packet_info *pinfo, proto_tree *tree,
566 offset = dissect_nt_policy_hnd(
567 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
571 offset = dissect_doserror(
572 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
577 /* Dissect some printer data. The get/set/enum printerdata routines all
578 store value/data in a uint8 array. We could use the ndr routines for
579 this but that would result in one item for each byte in the printer
582 static gint ett_printerdata_data = -1;
583 static gint ett_printerdata_value = -1;
585 static int dissect_printerdata_data(tvbuff_t *tvb, int offset,
586 packet_info *pinfo, proto_tree *tree,
587 guint8 *drep _U_, guint32 type)
593 item = proto_tree_add_text(tree, tvb, offset, 0, "Data");
595 subtree = proto_item_add_subtree(item, ett_printerdata_data);
597 offset = dissect_ndr_uint32(
598 tvb, offset, pinfo, subtree, drep, hf_printerdata_size, &size);
602 offset = dissect_ndr_uint8s(
603 tvb, offset, pinfo, subtree, drep,
604 hf_printerdata_data, size, NULL);
607 case DCERPC_REG_SZ: {
608 char *data = tvb_fake_unicode(tvb, offset - size, size/2, TRUE);
610 proto_item_append_text(item, ": %s", data);
612 if (check_col(pinfo->cinfo, COL_INFO))
614 pinfo->cinfo, COL_INFO, " = %s", data);
616 proto_tree_add_string_hidden(
617 tree, hf_printerdata_data_sz, tvb,
618 offset - size, size, data);
624 case DCERPC_REG_DWORD: {
625 guint32 data = tvb_get_letohl(tvb, offset - size);
627 proto_item_append_text(item, ": 0x%08x", data);
629 if (check_col(pinfo->cinfo, COL_INFO))
631 pinfo->cinfo, COL_INFO, " = 0x%08x",
634 proto_tree_add_uint_hidden(
635 tree, hf_printerdata_data_dword, tvb,
636 offset - size, 4, data);
640 case DCERPC_REG_BINARY:
641 if (check_col(pinfo->cinfo, COL_INFO))
643 pinfo->cinfo, COL_INFO,
652 proto_item_set_len(item, size + 4);
658 * SpoolssGetPrinterData
661 static int SpoolssGetPrinterData_q(tvbuff_t *tvb, int offset,
662 packet_info *pinfo, proto_tree *tree,
665 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
666 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
669 proto_tree_add_uint_hidden(
670 tree, hf_printerdata, tvb, offset, 0, 1);
674 offset = dissect_nt_policy_hnd(
675 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
678 value_name = dcv->private_data;
680 offset = dissect_ndr_cvstring(
681 tvb, offset, pinfo, tree, drep, sizeof(guint16),
682 hf_printerdata_value, TRUE, value_name ? NULL : &value_name);
684 dcv->private_data = value_name;
686 if (check_col(pinfo->cinfo, COL_INFO))
687 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", value_name);
689 offset = dissect_ndr_uint32(
690 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
695 static int SpoolssGetPrinterData_r(tvbuff_t *tvb, int offset,
696 packet_info *pinfo, proto_tree *tree,
699 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
700 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
703 proto_tree_add_uint_hidden(
704 tree, hf_printerdata, tvb, offset, 0, 1);
708 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
709 hf_printerdata_type, &type);
711 if (check_col(pinfo->cinfo, COL_INFO)) {
712 char *data = dcv->private_data ? dcv->private_data : "????";
714 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", data);
717 offset = dissect_printerdata_data(
718 tvb, offset, pinfo, tree, drep, type);
720 offset = dissect_ndr_uint32(
721 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
723 offset = dissect_doserror(
724 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
730 * SpoolssGetPrinterDataEx
733 static int SpoolssGetPrinterDataEx_q(tvbuff_t *tvb, int offset,
734 packet_info *pinfo, proto_tree *tree,
737 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
738 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
739 char *key_name, *value_name;
741 proto_tree_add_uint_hidden(
742 tree, hf_printerdata, tvb, offset, 0, 1);
746 offset = dissect_nt_policy_hnd(
747 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
750 offset = dissect_ndr_cvstring(
751 tvb, offset, pinfo, tree, drep, sizeof(guint16),
752 hf_printerdata_key, TRUE, &key_name);
755 * Register a cleanup function in case on of our tvbuff accesses
756 * throws an exception. We need to clean up key_name.
758 CLEANUP_PUSH(g_free, key_name);
760 offset = dissect_ndr_cvstring(
761 tvb, offset, pinfo, tree, drep, sizeof(guint16),
762 hf_printerdata_value, TRUE, &value_name);
764 if (check_col(pinfo->cinfo, COL_INFO))
765 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s/%s",
766 key_name, value_name);
768 if (!dcv->private_data)
769 dcv->private_data = g_strdup_printf(
770 "%s/%s", key_name, value_name);
773 * We're done with key_name, so we can call the cleanup handler to
774 * free it, and then pop the cleanup handler.
776 CLEANUP_CALL_AND_POP;
779 * We're also done with value_name.
783 offset = dissect_ndr_uint32(
784 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
789 static int SpoolssGetPrinterDataEx_r(tvbuff_t *tvb, int offset,
790 packet_info *pinfo, proto_tree *tree,
793 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
794 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
797 proto_tree_add_uint_hidden(
798 tree, hf_printerdata, tvb, offset, 0, 1);
802 offset = dissect_ndr_uint32(
803 tvb, offset, pinfo, tree, drep, hf_printerdata_type, &type);
805 offset = dissect_ndr_uint32(
806 tvb, offset, pinfo, tree, drep, hf_returned, &size);
808 if (check_col(pinfo->cinfo, COL_INFO)) {
809 char *data = dcv->private_data ? dcv->private_data : "????";
811 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", data);
815 dissect_printerdata_data(tvb, offset, pinfo, tree, drep, type);
819 offset = dissect_ndr_uint32(
820 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
822 offset = dissect_doserror(
823 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
829 * SpoolssSetPrinterData
832 static int SpoolssSetPrinterData_q(tvbuff_t *tvb, int offset,
833 packet_info *pinfo, proto_tree *tree,
836 char *value_name = NULL;
839 proto_tree_add_uint_hidden(
840 tree, hf_printerdata, tvb, offset, 0, 1);
844 offset = dissect_nt_policy_hnd(
845 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
848 offset = dissect_ndr_cvstring(
849 tvb, offset, pinfo, tree, drep, sizeof(guint16),
850 hf_printerdata_value, TRUE, &value_name);
852 if (check_col(pinfo->cinfo, COL_INFO))
853 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", value_name);
857 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
858 hf_printerdata_type, &type);
860 offset = dissect_printerdata_data(
861 tvb, offset, pinfo, tree, drep, type);
863 offset = dissect_ndr_uint32(
864 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
869 static int SpoolssSetPrinterData_r(tvbuff_t *tvb, int offset,
870 packet_info *pinfo, proto_tree *tree,
873 proto_tree_add_uint_hidden(
874 tree, hf_printerdata, tvb, offset, 0, 1);
878 offset = dissect_doserror(
879 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
885 * SpoolssSetPrinterDataEx
888 static int hf_setprinterdataex_max_len = -1;
889 static int hf_setprinterdataex_real_len = -1;
890 static int hf_setprinterdataex_data = -1;
892 static int SpoolssSetPrinterDataEx_q(tvbuff_t *tvb, int offset,
893 packet_info *pinfo, proto_tree *tree,
896 char *key_name, *value_name;
899 proto_tree_add_uint_hidden(
900 tree, hf_printerdata, tvb, offset, 0, 1);
904 offset = dissect_nt_policy_hnd(
905 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
908 offset = dissect_ndr_cvstring(
909 tvb, offset, pinfo, tree, drep, sizeof(guint16),
910 hf_printerdata_key, TRUE, &key_name);
912 CLEANUP_PUSH(g_free, key_name);
914 offset = dissect_ndr_cvstring(
915 tvb, offset, pinfo, tree, drep, sizeof(guint16),
916 hf_printerdata_value, TRUE, &value_name);
918 if (check_col(pinfo->cinfo, COL_INFO))
919 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s/%s",
920 key_name, value_name);
922 CLEANUP_CALL_AND_POP;
925 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
926 hf_printerdata_type, NULL);
928 offset = dissect_ndr_uint32(
929 tvb, offset, pinfo, tree, drep,
930 hf_setprinterdataex_max_len, &max_len);
932 offset = dissect_ndr_uint8s(
933 tvb, offset, pinfo, tree, drep,
934 hf_setprinterdataex_data, max_len, NULL);
936 offset = dissect_ndr_uint32(
937 tvb, offset, pinfo, tree, drep,
938 hf_setprinterdataex_real_len, NULL);
943 static int SpoolssSetPrinterDataEx_r(tvbuff_t *tvb, int offset,
944 packet_info *pinfo, proto_tree *tree,
947 proto_tree_add_uint_hidden(
948 tree, hf_printerdata, tvb, offset, 0, 1);
952 offset = dissect_doserror(
953 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
958 /* Yet another way to represent a unicode string - sheesh. This function
959 dissects a NULL terminate unicode string at the current offset and
960 returns the (char *) equivalent. This really should return UTF8 or
961 something but we use tvb_fake_unicode() instead. */
963 /* XXX - "name" should be an hf_ value for an FT_STRING. */
965 dissect_spoolss_uint16uni(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
966 proto_tree *tree, guint8 *drep _U_, char **data,
973 offset += 2 - (offset % 2);
975 /* Get remaining data in buffer as a string */
977 remaining = tvb_length_remaining(tvb, offset) / 2;
978 text = tvb_fake_unicode(tvb, offset, remaining, TRUE);
981 proto_tree_add_text(tree, tvb, offset, len * 2, "%s: %s",
982 name ? name : "String", text);
989 return offset + (len + 1) * 2;
996 /* Devicemode orientation values */
998 static const value_string devmode_orientation_vals[] =
1000 { DEVMODE_ORIENTATION_PORTRAIT, "Portrait" },
1001 { DEVMODE_ORIENTATION_LANDSCAPE, "Landscape" },
1005 /* Paper size values. International paper sizes is a fascinating
1006 topic. No seriously! (-: */
1008 static const value_string devmode_papersize_vals[] =
1010 { DEVMODE_PAPERSIZE_LETTER, "Letter" },
1011 { DEVMODE_PAPERSIZE_LETTERSMALL, "Letter (small)" },
1012 { DEVMODE_PAPERSIZE_TABLOID, "Tabloid" },
1013 { DEVMODE_PAPERSIZE_LEDGER, "Ledger" },
1014 { DEVMODE_PAPERSIZE_LEGAL, "Legal" },
1015 { DEVMODE_PAPERSIZE_STATEMENT, "Statement" },
1016 { DEVMODE_PAPERSIZE_EXECUTIVE, "Executive" },
1017 { DEVMODE_PAPERSIZE_A3, "A3" },
1018 { DEVMODE_PAPERSIZE_A4, "A4" },
1019 { DEVMODE_PAPERSIZE_A4SMALL, "A4 (small)" },
1020 { DEVMODE_PAPERSIZE_A5, "A5" },
1021 { DEVMODE_PAPERSIZE_B4, "B4" },
1022 { DEVMODE_PAPERSIZE_B5, "B5" },
1023 { DEVMODE_PAPERSIZE_FOLIO, "Folio" },
1024 { DEVMODE_PAPERSIZE_QUARTO, "Quarto" },
1025 { DEVMODE_PAPERSIZE_10X14, "10x14" },
1026 { DEVMODE_PAPERSIZE_11X17, "11x17" },
1027 { DEVMODE_PAPERSIZE_NOTE, "Note" },
1028 { DEVMODE_PAPERSIZE_ENV9, "Envelope #9" },
1029 { DEVMODE_PAPERSIZE_ENV10, "Envelope #10" },
1030 { DEVMODE_PAPERSIZE_ENV11, "Envelope #11" },
1031 { DEVMODE_PAPERSIZE_ENV12, "Envelope #12" },
1032 { DEVMODE_PAPERSIZE_ENV14, "Envelope #14" },
1033 { DEVMODE_PAPERSIZE_CSHEET, "C sheet" },
1034 { DEVMODE_PAPERSIZE_DSHEET, "D sheet" },
1035 { DEVMODE_PAPERSIZE_ESHEET, "E sheet" },
1036 { DEVMODE_PAPERSIZE_ENVDL, "Envelope DL" },
1037 { DEVMODE_PAPERSIZE_ENVC5, "Envelope C5" },
1038 { DEVMODE_PAPERSIZE_ENVC3, "Envelope C3" },
1039 { DEVMODE_PAPERSIZE_ENVC4, "Envelope C4" },
1040 { DEVMODE_PAPERSIZE_ENVC6, "Envelope C6" },
1041 { DEVMODE_PAPERSIZE_ENVC65, "Envelope C65" },
1042 { DEVMODE_PAPERSIZE_ENVB4, "Envelope B4" },
1043 { DEVMODE_PAPERSIZE_ENVB5, "Envelope B5" },
1044 { DEVMODE_PAPERSIZE_ENVB6, "Envelope B6" },
1045 { DEVMODE_PAPERSIZE_ENVITALY, "Envelope (Italy)" },
1046 { DEVMODE_PAPERSIZE_ENVMONARCH, "Envelope (Monarch)" },
1047 { DEVMODE_PAPERSIZE_ENVPERSONAL, "Envelope (Personal)" },
1048 { DEVMODE_PAPERSIZE_FANFOLDUS, "Fanfold (US)" },
1049 { DEVMODE_PAPERSIZE_FANFOLDSTDGERMAN, "Fanfold (Std German)" },
1050 { DEVMODE_PAPERSIZE_FANFOLDLGLGERMAN, "Fanfold (Legal German)" },
1051 { DEVMODE_PAPERSIZE_ISOB4, "B4 (ISO)" },
1052 { DEVMODE_PAPERSIZE_JAPANESEPOSTCARD, "Japanese postcard" },
1053 { DEVMODE_PAPERSIZE_9X11, "9x11" },
1054 { DEVMODE_PAPERSIZE_10X11, "10x11" },
1055 { DEVMODE_PAPERSIZE_15X11, "15x11" },
1056 { DEVMODE_PAPERSIZE_ENVINVITE, "Envelope (Invite)" },
1057 { DEVMODE_PAPERSIZE_RESERVED48, "Reserved (48)" },
1058 { DEVMODE_PAPERSIZE_RESERVED49, "Reserved (49)" },
1059 { DEVMODE_PAPERSIZE_LETTEREXTRA, "Letter (Extra)" },
1060 { DEVMODE_PAPERSIZE_LEGALEXTRA, "Legal (Extra)" },
1061 { DEVMODE_PAPERSIZE_TABLOIDEXTRA, "Tabloid (Extra)" },
1062 { DEVMODE_PAPERSIZE_A4EXTRA, "A4 (Extra)" },
1063 { DEVMODE_PAPERSIZE_LETTERTRANS, "Letter (Transverse)" },
1064 { DEVMODE_PAPERSIZE_A4TRANS, "A4 (Transverse)" },
1065 { DEVMODE_PAPERSIZE_LETTEREXTRATRANS, "Letter (Extra, Transverse)" },
1066 { DEVMODE_PAPERSIZE_APLUS, "A+" },
1067 { DEVMODE_PAPERSIZE_BPLUS, "B+" },
1068 { DEVMODE_PAPERSIZE_LETTERPLUS, "Letter+" },
1069 { DEVMODE_PAPERSIZE_A4PLUS, "A4+" },
1070 { DEVMODE_PAPERSIZE_A5TRANS, "A5 (Transverse)" },
1071 { DEVMODE_PAPERSIZE_B5TRANS, "B5 (Transverse)" },
1072 { DEVMODE_PAPERSIZE_A3EXTRA, "A3 (Extra)" },
1073 { DEVMODE_PAPERSIZE_A5EXTRA, "A5 (Extra)" },
1074 { DEVMODE_PAPERSIZE_B5EXTRA, "B5 (Extra)" },
1075 { DEVMODE_PAPERSIZE_A2, "A2" },
1076 { DEVMODE_PAPERSIZE_A3TRANS, "A3 (Transverse)" },
1077 { DEVMODE_PAPERSIZE_A3EXTRATRANS, "A3 (Extra, Transverse" },
1078 { DEVMODE_PAPERSIZE_DBLJAPANESEPOSTCARD, "Double Japanese Postcard" },
1079 { DEVMODE_PAPERSIZE_A6, "A6" },
1080 { DEVMODE_PAPERSIZE_JENVKAKU2, "Japanese Envelope (Kaku #2)" },
1081 { DEVMODE_PAPERSIZE_JENVKAKU3, "Japanese Envelope (Kaku #3)" },
1082 { DEVMODE_PAPERSIZE_JENVCHOU3, "Japanese Envelope (Chou #3)" },
1083 { DEVMODE_PAPERSIZE_JENVCHOU4, "Japaneve Envelope (Chou #4)" },
1084 { DEVMODE_PAPERSIZE_LETTERROT, "Letter (Rotated)" },
1085 { DEVMODE_PAPERSIZE_A3ROT, "A3 (Rotated)" },
1086 { DEVMODE_PAPERSIZE_A4ROT, "A4 (Rotated)" },
1087 { DEVMODE_PAPERSIZE_A5ROT, "A5 (Rotated)" },
1088 { DEVMODE_PAPERSIZE_B4JISROT, "B4 (JIS, Rotated)" },
1089 { DEVMODE_PAPERSIZE_B5JISROT, "B5 (JIS, Rotated)"},
1090 { DEVMODE_PAPERSIZE_JAPANESEPOSTCARDROT,
1091 "Japanese Postcard (Rotated)" },
1092 { DEVMODE_PAPERSIZE_DBLJAPANESEPOSTCARDROT82,
1093 "Double Japanese Postcard (Rotated)" },
1094 { DEVMODE_PAPERSIZE_A6ROT, "A6 (Rotated)" },
1095 { DEVMODE_PAPERSIZE_JENVKAKU2ROT,
1096 "Japanese Envelope (Kaku #2, Rotated)" },
1097 { DEVMODE_PAPERSIZE_JENVKAKU3ROT,
1098 "Japanese Envelope (Kaku #3, Rotated)" },
1099 { DEVMODE_PAPERSIZE_JENVCHOU3ROT,
1100 "Japanese Envelope (Chou #3, Rotated)" },
1101 { DEVMODE_PAPERSIZE_JENVCHOU4ROT,
1102 "Japanese Envelope (Chou #4, Rotated)" },
1103 { DEVMODE_PAPERSIZE_B6JIS, "B6 (JIS)" },
1104 { DEVMODE_PAPERSIZE_B6JISROT, "B6 (JIS, Rotated)" },
1105 { DEVMODE_PAPERSIZE_12X11, "12x11" },
1106 { DEVMODE_PAPERSIZE_JENVYOU4, "Japanese Envelope (You #4)" },
1107 { DEVMODE_PAPERSIZE_JENVYOU4ROT,
1108 "Japanese Envelope (You #4, Rotated" },
1109 { DEVMODE_PAPERSIZE_P16K, "PRC 16K" },
1110 { DEVMODE_PAPERSIZE_P32K, "PRC 32K" },
1111 { DEVMODE_PAPERSIZE_P32KBIG, "P32K (Big)" },
1112 { DEVMODE_PAPERSIZE_PENV1, "PRC Envelope #1" },
1113 { DEVMODE_PAPERSIZE_PENV2, "PRC Envelope #2" },
1114 { DEVMODE_PAPERSIZE_PENV3, "PRC Envelope #3" },
1115 { DEVMODE_PAPERSIZE_PENV4, "PRC Envelope #4" },
1116 { DEVMODE_PAPERSIZE_PENV5, "PRC Envelope #5" },
1117 { DEVMODE_PAPERSIZE_PENV6, "PRC Envelope #6" },
1118 { DEVMODE_PAPERSIZE_PENV7, "PRC Envelope #7" },
1119 { DEVMODE_PAPERSIZE_PENV8, "PRC Envelope #8" },
1120 { DEVMODE_PAPERSIZE_PENV9, "PRC Envelope #9" },
1121 { DEVMODE_PAPERSIZE_PENV10, "PRC Envelope #10" },
1122 { DEVMODE_PAPERSIZE_P16KROT, "PRC 16K (Rotated)" },
1123 { DEVMODE_PAPERSIZE_P32KROT, "PRC 32K (Rotated)" },
1124 { DEVMODE_PAPERSIZE_P32KBIGROT, "PRC 32K (Big, Rotated)" },
1125 { DEVMODE_PAPERSIZE_PENV1ROT, "PRC Envelope #1 (Rotated)" },
1126 { DEVMODE_PAPERSIZE_PENV2ROT, "PRC Envelope #2 (Rotated)" },
1127 { DEVMODE_PAPERSIZE_PENV3ROT, "PRC Envelope #3 (Rotated)" },
1128 { DEVMODE_PAPERSIZE_PENV4ROT, "PRC Envelope #4 (Rotated)" },
1129 { DEVMODE_PAPERSIZE_PENV5ROT, "PRC Envelope #5 (Rotated)" },
1130 { DEVMODE_PAPERSIZE_PENV6ROT, "PRC Envelope #6 (Rotated)" },
1131 { DEVMODE_PAPERSIZE_PENV7ROT, "PRC Envelope #7 (Rotated)" },
1132 { DEVMODE_PAPERSIZE_PENV8ROT, "PRC Envelope #8 (Rotated)" },
1133 { DEVMODE_PAPERSIZE_PENV9ROT, "PRC Envelope #9 (Rotated)" },
1134 { DEVMODE_PAPERSIZE_PENV10ROT, "PRC Envelope #10 (Rotated)" },
1138 /* List of observed specversions */
1140 static const value_string devmode_specversion_vals[] =
1142 { 0x0320, "Observed" },
1143 { 0x0400, "Observed" },
1144 { 0x0401, "Observed" },
1145 { 0x040d, "Observed" },
1151 static const value_string devmode_papersource_vals[] =
1153 { DEVMODE_PAPERSOURCE_UPPER, "Upper" },
1154 { DEVMODE_PAPERSOURCE_LOWER, "Lower" },
1155 { DEVMODE_PAPERSOURCE_MIDDLE, "Middle" },
1156 { DEVMODE_PAPERSOURCE_MANUAL, "Manual" },
1157 { DEVMODE_PAPERSOURCE_ENV, "Envelope" },
1158 { DEVMODE_PAPERSOURCE_ENVMANUAL, "Envelope Manual" },
1159 { DEVMODE_PAPERSOURCE_AUTO, "Auto" },
1160 { DEVMODE_PAPERSOURCE_TRACTOR, "Tractor" },
1161 { DEVMODE_PAPERSOURCE_SMALLFMT, "Small Format" },
1162 { DEVMODE_PAPERSOURCE_LARGEFMAT, "Large Format" },
1163 { DEVMODE_PAPERSOURCE_LARGECAP, "Large Capacity" },
1164 { DEVMODE_PAPERSOURCE_CASSETTE, "Cassette" },
1165 { DEVMODE_PAPERSOURCE_FORMSRC, "Form Source" },
1171 static const value_string devmode_printquality_vals[] =
1173 { DEVMODE_PRINTQUALITY_HIGH, "High" },
1174 { DEVMODE_PRINTQUALITY_MEDIUM, "Medium" },
1175 { DEVMODE_PRINTQUALITY_LOW, "Low" },
1176 { DEVMODE_PRINTQUALITY_DRAFT, "Draft" },
1182 static const value_string devmode_colour_vals[] =
1184 { DEVMODE_COLOUR_COLOUR, "Colour" },
1185 { DEVMODE_COLOUR_MONO, "Monochrome" },
1189 /* TrueType options */
1191 static const value_string devmode_ttoption_vals[] =
1194 { DEVMODE_TTOPTION_BITMAP, "Bitmap" },
1195 { DEVMODE_TTOPTION_DOWNLOAD, "Download" },
1196 { DEVMODE_TTOPTION_DOWNLOAD_OUTLINE, "Download outline" },
1197 { DEVMODE_TTOPTION_SUBDEV, "Substitute device fonts" },
1203 static const value_string devmode_collate_vals[] =
1205 { DEVMODE_COLLATE_FALSE, "False" },
1206 { DEVMODE_COLLATE_TRUE, "True" },
1212 static const value_string devmode_duplex_vals[] =
1214 { DEVMODE_DUPLEX_SIMPLEX, "Simplex" },
1215 { DEVMODE_DUPLEX_VERT, "Vertical" },
1216 { DEVMODE_DUPLEX_HORIZ, "Horizontal" },
1220 static const value_string devmode_displayflags_vals[] =
1223 { DEVMODE_DISPLAYFLAGS_GRAYSCALE, "Grayscale" },
1224 { DEVMODE_DISPLAYFLAGS_INTERLACED, "Interlaced" },
1228 static const value_string devmode_icmmethod_vals[] =
1230 { DEVMODE_ICMMETHOD_NONE, "None" },
1231 { DEVMODE_ICMMETHOD_SYSTEM, "System" },
1232 { DEVMODE_ICMMETHOD_DRIVER, "Driver" },
1233 { DEVMODE_ICMMETHOD_DEVICE, "Device" },
1237 static const value_string devmode_icmintent_vals[] =
1240 { DEVMODE_ICMINTENT_SATURATE, "Saturate" },
1241 { DEVMODE_ICMINTENT_CONTRAST, "Contrast" },
1242 { DEVMODE_ICMINTENT_COLORIMETRIC, "Colorimetric" },
1243 { DEVMODE_ICMINTENT_ABS_COLORIMETRIC, "Absolute colorimetric" },
1247 static const value_string devmode_mediatype_vals[] =
1250 { DEVMODE_MEDIATYPE_STANDARD, "Standard" },
1251 { DEVMODE_MEDIATYPE_TRANSPARENCY, "Transparency" },
1252 { DEVMODE_MEDIATYPE_GLOSSY, "Glossy" },
1256 static const value_string devmode_dithertype_vals[] =
1259 { DEVMODE_DITHERTYPE_NONE, "None" },
1260 { DEVMODE_DITHERTYPE_COARSE, "Coarse" },
1261 { DEVMODE_DITHERTYPE_LINE, "Line" },
1262 { DEVMODE_DITHERTYPE_LINEART, "Line art" },
1263 { DEVMODE_DITHERTYPE_ERRORDIFFUSION, "Error diffusion" },
1264 { DEVMODE_DITHERTYPE_RESERVED6, "Reserved 6" },
1265 { DEVMODE_DITHERTYPE_RESERVED7, "Reserved 7" },
1266 { DEVMODE_DITHERTYPE_GRAYSCALE, "Grayscale" },
1270 static gint ett_DEVMODE_fields;
1273 dissect_DEVMODE_fields(tvbuff_t *tvb, gint offset, packet_info *pinfo,
1274 proto_tree *tree, guint8 *drep _U_, guint32 *pdata)
1277 proto_tree *subtree;
1280 proto_tree_add_uint_hidden(
1281 tree, hf_devmode, tvb, offset, 0, 1);
1283 offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
1284 hf_devmode_fields, &fields);
1286 item = proto_tree_add_text(tree, tvb, offset - 4, 4,
1287 "Fields: 0x%08x", fields);
1289 subtree = proto_item_add_subtree(item, ett_DEVMODE_fields);
1291 proto_tree_add_boolean(
1292 subtree, hf_devmode_fields_orientation,
1293 tvb, offset - 4, 4, fields);
1295 proto_tree_add_boolean(
1296 subtree, hf_devmode_fields_papersize,
1297 tvb, offset - 4, 4, fields);
1299 proto_tree_add_boolean(
1300 subtree, hf_devmode_fields_paperlength,
1301 tvb, offset - 4, 4, fields);
1303 proto_tree_add_boolean(
1304 subtree, hf_devmode_fields_paperwidth,
1305 tvb, offset - 4, 4, fields);
1307 proto_tree_add_boolean(
1308 subtree, hf_devmode_fields_scale,
1309 tvb, offset - 4, 4, fields);
1311 proto_tree_add_boolean(
1312 subtree, hf_devmode_fields_position,
1313 tvb, offset - 4, 4, fields);
1315 proto_tree_add_boolean(
1316 subtree, hf_devmode_fields_nup,
1317 tvb, offset - 4, 4, fields);
1319 proto_tree_add_boolean(
1320 subtree, hf_devmode_fields_copies,
1321 tvb, offset - 4, 4, fields);
1323 proto_tree_add_boolean(
1324 subtree, hf_devmode_fields_defaultsource,
1325 tvb, offset - 4, 4, fields);
1327 proto_tree_add_boolean(
1328 subtree, hf_devmode_fields_printquality,
1329 tvb, offset - 4, 4, fields);
1331 proto_tree_add_boolean(
1332 subtree, hf_devmode_fields_color,
1333 tvb, offset - 4, 4, fields);
1335 proto_tree_add_boolean(
1336 subtree, hf_devmode_fields_duplex,
1337 tvb, offset - 4, 4, fields);
1339 proto_tree_add_boolean(
1340 subtree, hf_devmode_fields_yresolution,
1341 tvb, offset - 4, 4, fields);
1343 proto_tree_add_boolean(
1344 subtree, hf_devmode_fields_ttoption,
1345 tvb, offset - 4, 4, fields);
1347 proto_tree_add_boolean(
1348 subtree, hf_devmode_fields_collate,
1349 tvb, offset - 4, 4, fields);
1351 proto_tree_add_boolean(
1352 subtree, hf_devmode_fields_formname,
1353 tvb, offset - 4, 4, fields);
1355 proto_tree_add_boolean(
1356 subtree, hf_devmode_fields_logpixels,
1357 tvb, offset - 4, 4, fields);
1359 proto_tree_add_boolean(
1360 subtree, hf_devmode_fields_bitsperpel,
1361 tvb, offset - 4, 4, fields);
1363 proto_tree_add_boolean(
1364 subtree, hf_devmode_fields_pelswidth,
1365 tvb, offset - 4, 4, fields);
1367 proto_tree_add_boolean(
1368 subtree, hf_devmode_fields_pelsheight,
1369 tvb, offset - 4, 4, fields);
1371 proto_tree_add_boolean(
1372 subtree, hf_devmode_fields_displayflags,
1373 tvb, offset - 4, 4, fields);
1375 proto_tree_add_boolean(
1376 subtree, hf_devmode_fields_displayfrequency,
1377 tvb, offset - 4, 4, fields);
1379 proto_tree_add_boolean(
1380 subtree, hf_devmode_fields_icmmethod,
1381 tvb, offset - 4, 4, fields);
1383 proto_tree_add_boolean(
1384 subtree, hf_devmode_fields_icmintent,
1385 tvb, offset - 4, 4, fields);
1387 proto_tree_add_boolean(
1388 subtree, hf_devmode_fields_mediatype,
1389 tvb, offset - 4, 4, fields);
1391 proto_tree_add_boolean(
1392 subtree, hf_devmode_fields_dithertype,
1393 tvb, offset - 4, 4, fields);
1395 proto_tree_add_boolean(
1396 subtree, hf_devmode_fields_panningwidth,
1397 tvb, offset - 4, 4, fields);
1399 proto_tree_add_boolean(
1400 subtree, hf_devmode_fields_panningheight,
1401 tvb, offset - 4, 4, fields);
1409 static gint ett_DEVMODE = -1;
1411 static int dissect_DEVMODE(tvbuff_t *tvb, int offset, packet_info *pinfo,
1412 proto_tree *tree, guint8 *drep)
1414 dcerpc_info *di = pinfo->private_data;
1416 proto_tree *subtree;
1417 guint16 driver_extra;
1418 gint16 print_quality;
1420 int struct_start = offset;
1422 if (di->conformant_run)
1425 item = proto_tree_add_text(tree, tvb, offset, 0, "Devicemode");
1426 subtree = proto_item_add_subtree(item, ett_DEVMODE);
1428 offset = dissect_ndr_uint32(
1429 tvb, offset, pinfo, subtree, drep, hf_devmode_size,
1432 /* The device name is stored in a 32-wchar buffer */
1434 dissect_spoolss_uint16uni(tvb, offset, pinfo, subtree, drep, NULL,
1438 offset = dissect_ndr_uint16(
1439 tvb, offset, pinfo, subtree, drep,
1440 hf_devmode_spec_version, NULL);
1442 offset = dissect_ndr_uint16(
1443 tvb, offset, pinfo, subtree, drep,
1444 hf_devmode_driver_version, NULL);
1446 offset = dissect_ndr_uint16(
1447 tvb, offset, pinfo, subtree, drep,
1448 hf_devmode_size2, NULL);
1450 offset = dissect_ndr_uint16(
1451 tvb, offset, pinfo, subtree, drep,
1452 hf_devmode_driver_extra_len, &driver_extra);
1454 offset = dissect_DEVMODE_fields(
1455 tvb, offset, pinfo, subtree, drep, &fields);
1457 offset = dissect_ndr_uint16(
1458 tvb, offset, pinfo, subtree, drep,
1459 hf_devmode_orientation, NULL);
1461 offset = dissect_ndr_uint16(
1462 tvb, offset, pinfo, subtree, drep,
1463 hf_devmode_paper_size, NULL);
1465 offset = dissect_ndr_uint16(
1466 tvb, offset, pinfo, subtree, drep,
1467 hf_devmode_paper_length, NULL);
1469 offset = dissect_ndr_uint16(
1470 tvb, offset, pinfo, subtree, drep,
1471 hf_devmode_paper_width, NULL);
1473 offset = dissect_ndr_uint16(
1474 tvb, offset, pinfo, subtree, drep,
1475 hf_devmode_scale, NULL);
1477 offset = dissect_ndr_uint16(
1478 tvb, offset, pinfo, subtree, drep,
1479 hf_devmode_copies, NULL);
1481 offset = dissect_ndr_uint16(
1482 tvb, offset, pinfo, subtree, drep,
1483 hf_devmode_default_source, NULL);
1485 offset = dissect_ndr_uint16(
1486 tvb, offset, pinfo, NULL, drep,
1487 hf_devmode_print_quality, &print_quality);
1489 if (print_quality < 0)
1490 proto_tree_add_item(
1491 subtree, hf_devmode_print_quality, tvb,
1492 offset - 2, 2, drep[0] & 0x10);
1494 proto_tree_add_text(
1495 subtree, tvb, offset - 4, 4,
1496 "Print Quality: %d dpi", print_quality);
1498 offset = dissect_ndr_uint16(
1499 tvb, offset, pinfo, subtree, drep,
1500 hf_devmode_color, NULL);
1502 offset = dissect_ndr_uint16(
1503 tvb, offset, pinfo, subtree, drep,
1504 hf_devmode_duplex, NULL);
1506 offset = dissect_ndr_uint16(
1507 tvb, offset, pinfo, subtree, drep,
1508 hf_devmode_y_resolution, NULL);
1510 offset = dissect_ndr_uint16(
1511 tvb, offset, pinfo, subtree, drep,
1512 hf_devmode_tt_option, NULL);
1514 offset = dissect_ndr_uint16(
1515 tvb, offset, pinfo, subtree, drep,
1516 hf_devmode_collate, NULL);
1518 dissect_spoolss_uint16uni(tvb, offset, pinfo, subtree, drep, NULL,
1522 offset = dissect_ndr_uint16(
1523 tvb, offset, pinfo, subtree, drep,
1524 hf_devmode_log_pixels, NULL);
1526 offset = dissect_ndr_uint32(
1527 tvb, offset, pinfo, subtree, drep,
1528 hf_devmode_bits_per_pel, NULL);
1530 offset = dissect_ndr_uint32(
1531 tvb, offset, pinfo, subtree, drep,
1532 hf_devmode_pels_width, NULL);
1534 offset = dissect_ndr_uint32(
1535 tvb, offset, pinfo, subtree, drep,
1536 hf_devmode_pels_height, NULL);
1538 offset = dissect_ndr_uint32(
1539 tvb, offset, pinfo, subtree, drep,
1540 hf_devmode_display_flags, NULL);
1542 offset = dissect_ndr_uint32(
1543 tvb, offset, pinfo, subtree, drep,
1544 hf_devmode_display_freq, NULL);
1546 /* TODO: Some of the remaining fields are optional. See
1547 rpc_parse/parse_spoolss.c in the Samba source for details. */
1549 offset = dissect_ndr_uint32(
1550 tvb, offset, pinfo, subtree, drep,
1551 hf_devmode_icm_method, NULL);
1553 offset = dissect_ndr_uint32(
1554 tvb, offset, pinfo, subtree, drep,
1555 hf_devmode_icm_intent, NULL);
1557 offset = dissect_ndr_uint32(
1558 tvb, offset, pinfo, subtree, drep,
1559 hf_devmode_media_type, NULL);
1561 offset = dissect_ndr_uint32(
1562 tvb, offset, pinfo, subtree, drep,
1563 hf_devmode_dither_type, NULL);
1565 offset = dissect_ndr_uint32(
1566 tvb, offset, pinfo, subtree, drep,
1567 hf_devmode_reserved1, NULL);
1569 offset = dissect_ndr_uint32(
1570 tvb, offset, pinfo, subtree, drep,
1571 hf_devmode_reserved2, NULL);
1573 offset = dissect_ndr_uint32(
1574 tvb, offset, pinfo, subtree, drep,
1575 hf_devmode_panning_width, NULL);
1577 offset = dissect_ndr_uint32(
1578 tvb, offset, pinfo, subtree, drep,
1579 hf_devmode_panning_height, NULL);
1582 offset = dissect_ndr_uint8s(
1583 tvb, offset, pinfo, subtree, drep,
1584 hf_devmode_driver_extra, driver_extra, NULL);
1586 proto_item_set_len(item, offset - struct_start);
1595 static gint ett_DEVMODE_CTR = -1;
1597 static int dissect_DEVMODE_CTR(tvbuff_t *tvb, int offset, packet_info *pinfo,
1598 proto_tree *tree, guint8 *drep)
1601 proto_tree *subtree;
1604 item = proto_tree_add_text(
1605 tree, tvb, offset, 0, "Devicemode container");
1607 subtree = proto_item_add_subtree(item, ett_DEVMODE_CTR);
1609 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
1610 hf_devmodectr_size, &size);
1612 offset = dissect_ndr_pointer(
1613 tvb, offset, pinfo, subtree, drep,
1614 dissect_DEVMODE, NDR_POINTER_UNIQUE, "Devicemode", -1);
1620 * Relative string given by offset into the current buffer. Note that
1621 * the offset for subsequent relstrs are against the structure start, not
1622 * the point where the offset is parsed from.
1625 static gint ett_RELSTR = -1;
1628 dissect_spoolss_relstr(tvbuff_t *tvb, int offset, packet_info *pinfo,
1629 proto_tree *tree, guint8 *drep, int hf_index,
1630 int struct_start, char **data)
1633 proto_tree *subtree;
1634 guint32 relstr_offset, relstr_start, relstr_end;
1637 /* Peek ahead to read the string. We need this for the
1638 proto_tree_add_string() call so filtering will work. */
1640 offset = dissect_ndr_uint32(
1641 tvb, offset, pinfo, NULL, drep, hf_offset, &relstr_offset);
1643 relstr_start = relstr_offset + struct_start;
1646 relstr_end = dissect_spoolss_uint16uni(
1647 tvb, relstr_start, pinfo, NULL, drep, &text, NULL);
1648 else /* relstr_offset == 0 is a NULL string */
1649 text = g_strdup("");
1651 /* OK now add the proto item with the string value */
1653 item = proto_tree_add_string(tree, hf_index, tvb, offset, 4, text);
1654 subtree = proto_item_add_subtree(item, ett_RELSTR);
1657 tvb, offset - 4, pinfo, subtree, drep, hf_offset, NULL);
1660 dissect_spoolss_uint16uni(
1661 tvb, relstr_start, pinfo, subtree, drep, NULL, NULL);
1671 /* An array of relative strings. This is currently just a copy of the
1672 dissect_spoolss_relstr() function as I can't find an example driver that
1673 has more than one dependent file. */
1675 static gint ett_RELSTR_ARRAY = -1;
1678 dissect_spoolss_relstrarray(tvbuff_t *tvb, int offset, packet_info *pinfo,
1679 proto_tree *tree, guint8 *drep, int hf_index,
1680 int struct_start, char **data)
1683 proto_tree *subtree;
1684 guint32 relstr_offset, relstr_start, relstr_end, relstr_len;
1687 item = proto_tree_add_string(tree, hf_index, tvb, offset, 4, "");
1689 subtree = proto_item_add_subtree(item, ett_RELSTR_ARRAY);
1691 offset = dissect_ndr_uint32(
1692 tvb, offset, pinfo, subtree, drep, hf_offset, &relstr_offset);
1694 /* A relative offset of zero is a NULL string */
1696 relstr_start = relstr_offset + struct_start;
1699 relstr_end = dissect_spoolss_uint16uni(
1700 tvb, relstr_start, pinfo, subtree, drep, &text, NULL);
1702 text = g_strdup("NULL");
1703 relstr_end = offset;
1706 relstr_len = relstr_end - relstr_start;
1708 proto_item_append_text(item, text);
1722 static int hf_printer_status = -1;
1724 static const value_string printer_status_vals[] =
1726 { PRINTER_STATUS_OK, "OK" },
1727 { PRINTER_STATUS_PAUSED, "Paused" },
1728 { PRINTER_STATUS_ERROR, "Error" },
1729 { PRINTER_STATUS_PENDING_DELETION, "Pending deletion" },
1730 { PRINTER_STATUS_PAPER_JAM, "Paper jam" },
1731 { PRINTER_STATUS_PAPER_OUT, "Paper out" },
1732 { PRINTER_STATUS_MANUAL_FEED, "Manual feed" },
1733 { PRINTER_STATUS_PAPER_PROBLEM, "Paper problem" },
1734 { PRINTER_STATUS_OFFLINE, "Offline" },
1735 { PRINTER_STATUS_IO_ACTIVE, "IO active" },
1736 { PRINTER_STATUS_BUSY, "Busy" },
1737 { PRINTER_STATUS_PRINTING, "Printing" },
1738 { PRINTER_STATUS_OUTPUT_BIN_FULL, "Output bin full" },
1739 { PRINTER_STATUS_NOT_AVAILABLE, "Not available" },
1740 { PRINTER_STATUS_WAITING, "Waiting" },
1741 { PRINTER_STATUS_PROCESSING, "Processing" },
1742 { PRINTER_STATUS_INITIALIZING, "Initialising" },
1743 { PRINTER_STATUS_WARMING_UP, "Warming up" },
1744 { PRINTER_STATUS_TONER_LOW, "Toner low" },
1745 { PRINTER_STATUS_NO_TONER, "No toner" },
1746 { PRINTER_STATUS_PAGE_PUNT, "Page punt" },
1747 { PRINTER_STATUS_USER_INTERVENTION, "User intervention" },
1748 { PRINTER_STATUS_OUT_OF_MEMORY, "Out of memory" },
1749 { PRINTER_STATUS_DOOR_OPEN, "Door open" },
1750 { PRINTER_STATUS_SERVER_UNKNOWN, "Server unknown" },
1751 { PRINTER_STATUS_POWER_SAVE, "Power save" },
1755 static gint ett_PRINTER_INFO_0 = -1;
1757 static int dissect_PRINTER_INFO_0(tvbuff_t *tvb, int offset,
1758 packet_info *pinfo, proto_tree *tree,
1761 offset = dissect_spoolss_relstr(
1762 tvb, offset, pinfo, tree, drep, hf_printername,
1765 offset = dissect_spoolss_relstr(
1766 tvb, offset, pinfo, tree, drep, hf_servername,
1769 offset = dissect_ndr_uint32(
1770 tvb, offset, pinfo, tree, drep, hf_printer_cjobs, NULL);
1772 offset = dissect_ndr_uint32(
1773 tvb, offset, pinfo, tree, drep, hf_printer_total_jobs,
1776 offset = dissect_ndr_uint32(
1777 tvb, offset, pinfo, tree, drep, hf_printer_total_bytes,
1780 offset = dissect_SYSTEM_TIME(
1781 tvb, offset, pinfo, tree, drep, "Unknown time", TRUE, NULL);
1783 offset = dissect_ndr_uint32(
1784 tvb, offset, pinfo, tree, drep, hf_printer_global_counter,
1787 offset = dissect_ndr_uint32(
1788 tvb, offset, pinfo, tree, drep, hf_printer_total_pages,
1791 offset = dissect_ndr_uint16(
1792 tvb, offset, pinfo, tree, drep, hf_printer_major_version,
1795 offset = dissect_ndr_uint16(
1796 tvb, offset, pinfo, tree, drep, hf_printer_build_version,
1799 offset = dissect_ndr_uint32(
1800 tvb, offset, pinfo, tree, drep, hf_printer_unk7, NULL);
1802 offset = dissect_ndr_uint32(
1803 tvb, offset, pinfo, tree, drep, hf_printer_unk8, NULL);
1805 offset = dissect_ndr_uint32(
1806 tvb, offset, pinfo, tree, drep, hf_printer_unk9, NULL);
1808 offset = dissect_ndr_uint32(
1809 tvb, offset, pinfo, tree, drep, hf_printer_session_ctr,
1812 offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep,
1813 hf_printer_unk11, NULL);
1815 offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep,
1816 hf_printer_printer_errors, NULL);
1818 offset = dissect_ndr_uint32(
1819 tvb, offset, pinfo, tree, drep, hf_printer_unk13, NULL);
1821 offset = dissect_ndr_uint32(
1822 tvb, offset, pinfo, tree, drep, hf_printer_unk14, NULL);
1824 offset = dissect_ndr_uint32(
1825 tvb, offset, pinfo, tree, drep, hf_printer_unk15, NULL);
1827 offset = dissect_ndr_uint32(
1828 tvb, offset, pinfo, tree, drep, hf_printer_unk16, NULL);
1830 offset = dissect_ndr_uint32(
1831 tvb, offset, pinfo, tree, drep, hf_printer_changeid, NULL);
1833 offset = dissect_ndr_uint32(
1834 tvb, offset, pinfo, tree, drep, hf_printer_unk18, NULL);
1836 offset = dissect_ndr_uint32(
1837 tvb, offset, pinfo, tree, drep, hf_printer_status, NULL);
1839 offset = dissect_ndr_uint32(
1840 tvb, offset, pinfo, tree, drep, hf_printer_unk20, NULL);
1842 offset = dissect_ndr_uint32(
1843 tvb, offset, pinfo, tree, drep, hf_printer_c_setprinter,
1846 offset = dissect_ndr_uint16(
1847 tvb, offset, pinfo, tree, drep, hf_printer_unk22, NULL);
1849 offset = dissect_ndr_uint16(
1850 tvb, offset, pinfo, tree, drep, hf_printer_unk23, NULL);
1852 offset = dissect_ndr_uint16(
1853 tvb, offset, pinfo, tree, drep, hf_printer_unk24, NULL);
1855 offset = dissect_ndr_uint16(
1856 tvb, offset, pinfo, tree, drep, hf_printer_unk25, NULL);
1858 offset = dissect_ndr_uint16(
1859 tvb, offset, pinfo, tree, drep, hf_printer_unk26, NULL);
1861 offset = dissect_ndr_uint16(
1862 tvb, offset, pinfo, tree, drep, hf_printer_unk27, NULL);
1864 offset = dissect_ndr_uint16(
1865 tvb, offset, pinfo, tree, drep, hf_printer_unk28, NULL);
1867 offset = dissect_ndr_uint16(
1868 tvb, offset, pinfo, tree, drep, hf_printer_unk29, NULL);
1877 static gint ett_PRINTER_INFO_1 = -1;
1879 static int dissect_PRINTER_INFO_1(tvbuff_t *tvb, int offset,
1880 packet_info *pinfo, proto_tree *tree,
1883 offset = dissect_ndr_uint32(
1884 tvb, offset, pinfo, tree, drep,
1885 hf_printer_flags, NULL);
1887 offset = dissect_spoolss_relstr(
1888 tvb, offset, pinfo, tree, drep, hf_printerdesc,
1891 offset = dissect_spoolss_relstr(
1892 tvb, offset, pinfo, tree, drep, hf_printername,
1895 offset = dissect_spoolss_relstr(
1896 tvb, offset, pinfo, tree, drep, hf_printercomment,
1904 static const true_false_string tfs_job_status_paused = {
1909 static const true_false_string tfs_job_status_error = {
1914 static const true_false_string tfs_job_status_deleting = {
1915 "Job is being deleted",
1916 "Job is not being deleted"
1919 static const true_false_string tfs_job_status_spooling = {
1920 "Job is being spooled",
1921 "Job is not being spooled"
1924 static const true_false_string tfs_job_status_printing = {
1925 "Job is being printed",
1926 "Job is not being printed"
1929 static const true_false_string tfs_job_status_offline = {
1931 "Job is not offline"
1934 static const true_false_string tfs_job_status_paperout = {
1935 "Job is out of paper",
1936 "Job is not out of paper"
1939 static const true_false_string tfs_job_status_printed = {
1940 "Job has completed printing",
1941 "Job has not completed printing"
1944 static const true_false_string tfs_job_status_deleted = {
1945 "Job has been deleted",
1946 "Job has not been deleted"
1949 static const true_false_string tfs_job_status_blocked = {
1950 "Job has been blocked",
1951 "Job has not been blocked"
1954 static const true_false_string tfs_job_status_user_intervention = {
1955 "User intervention required",
1956 "User intervention not required"
1959 static gint ett_job_status = -1;
1962 dissect_job_status(tvbuff_t *tvb, int offset, packet_info *pinfo,
1963 proto_tree *tree, guint8 *drep)
1966 proto_tree *subtree;
1969 offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
1970 hf_job_status, &status);
1972 item = proto_tree_add_text(tree, tvb, offset - 4, 4,
1973 "Status: 0x%08x", status);
1975 subtree = proto_item_add_subtree(item, ett_job_status);
1977 proto_tree_add_boolean(
1978 subtree, hf_job_status_user_intervention, tvb, offset - 4, 4,
1981 proto_tree_add_boolean(
1982 subtree, hf_job_status_blocked, tvb, offset - 4, 4, status);
1984 proto_tree_add_boolean(
1985 subtree, hf_job_status_deleted, tvb, offset - 4, 4, status);
1987 proto_tree_add_boolean(
1988 subtree, hf_job_status_printed, tvb, offset - 4, 4, status);
1990 proto_tree_add_boolean(
1991 subtree, hf_job_status_paperout, tvb, offset - 4, 4, status);
1993 proto_tree_add_boolean(
1994 subtree, hf_job_status_offline, tvb, offset - 4, 4, status);
1996 proto_tree_add_boolean(
1997 subtree, hf_job_status_printing, tvb, offset - 4, 4, status);
1999 proto_tree_add_boolean(
2000 subtree, hf_job_status_spooling, tvb, offset - 4, 4, status);
2002 proto_tree_add_boolean(
2003 subtree, hf_job_status_deleting, tvb, offset - 4, 4, status);
2005 proto_tree_add_boolean(
2006 subtree, hf_job_status_error, tvb, offset - 4, 4, status);
2008 proto_tree_add_boolean(
2009 subtree, hf_job_status_paused, tvb, offset - 4, 4, status);
2014 /* Printer attributes */
2016 static gint ett_printer_attributes = -1;
2018 static int hf_printer_attributes = -1;
2019 static int hf_printer_attributes_queued = -1;
2020 static int hf_printer_attributes_direct = -1;
2021 static int hf_printer_attributes_default = -1;
2022 static int hf_printer_attributes_shared = -1;
2023 static int hf_printer_attributes_network = -1;
2024 static int hf_printer_attributes_hidden = -1;
2025 static int hf_printer_attributes_local = -1;
2026 static int hf_printer_attributes_enable_devq = -1;
2027 static int hf_printer_attributes_keep_printed_jobs = -1;
2028 static int hf_printer_attributes_do_complete_first = -1;
2029 static int hf_printer_attributes_work_offline = -1;
2030 static int hf_printer_attributes_enable_bidi = -1;
2031 static int hf_printer_attributes_raw_only = -1;
2032 static int hf_printer_attributes_published = -1;
2034 static const true_false_string tfs_printer_attributes_queued = {
2035 "Printer starts printing after last page spooled",
2036 "Printer starts printing while spooling"
2039 static const true_false_string tfs_printer_attributes_direct = {
2040 "Jobs sent directly to printer",
2041 "Jobs are spooled to printer before printing"
2044 static const true_false_string tfs_printer_attributes_default = {
2045 "Printer is the default printer",
2046 "Printer is not the default printer"
2049 static const true_false_string tfs_printer_attributes_shared = {
2050 "Printer is shared",
2051 "Printer is not shared"
2054 static const true_false_string tfs_printer_attributes_network = {
2055 "Printer is a network printer connection",
2056 "Printer is not a network printer connection"
2059 static const true_false_string tfs_printer_attributes_hidden = {
2064 static const true_false_string tfs_printer_attributes_local = {
2065 "Printer is a local printer",
2066 "Printer is not a local printer"
2069 static const true_false_string tfs_printer_attributes_enable_devq = {
2070 "Call DevQueryPrint",
2071 "Do not call DevQueryPrint"
2074 static const true_false_string tfs_printer_attributes_keep_printed_jobs = {
2075 "Jobs are kept after they are printed",
2076 "Jobs are deleted after printing"
2079 static const true_false_string tfs_printer_attributes_do_complete_first = {
2080 "Jobs that have completed spooling are scheduled before still spooling jobs",
2081 "Jobs are scheduled in the order they start spooling"
2084 static const true_false_string tfs_printer_attributes_work_offline = {
2085 "The printer is currently connected",
2086 "The printer is currently not connected"
2089 static const true_false_string tfs_printer_attributes_enable_bidi = {
2090 "Bidirectional communications are supported",
2091 "Bidirectional communications are not supported"
2094 static const true_false_string tfs_printer_attributes_raw_only = {
2095 "Only raw data type print jobs can be spooled",
2096 "All data type print jobs can be spooled"
2099 static const true_false_string tfs_printer_attributes_published = {
2100 "Printer is published in the directory",
2101 "Printer is not published in the directory"
2105 dissect_printer_attributes(tvbuff_t *tvb, int offset, packet_info *pinfo,
2106 proto_tree *tree, guint8 *drep)
2109 proto_tree *subtree;
2112 offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
2113 hf_printer_attributes, &attributes);
2115 item = proto_tree_add_text(tree, tvb, offset - 4, 4,
2116 "Attributes: 0x%08x", attributes);
2118 subtree = proto_item_add_subtree(item, ett_printer_attributes);
2120 proto_tree_add_boolean(
2121 subtree, hf_printer_attributes_published,
2122 tvb, offset - 4, 4, attributes);
2124 proto_tree_add_boolean(
2125 subtree, hf_printer_attributes_raw_only,
2126 tvb, offset - 4, 4, attributes);
2128 proto_tree_add_boolean(
2129 subtree, hf_printer_attributes_enable_bidi,
2130 tvb, offset - 4, 4, attributes);
2132 proto_tree_add_boolean(
2133 subtree, hf_printer_attributes_work_offline,
2134 tvb, offset - 4, 4, attributes);
2136 proto_tree_add_boolean(
2137 subtree, hf_printer_attributes_do_complete_first,
2138 tvb, offset - 4, 4, attributes);
2140 proto_tree_add_boolean(
2141 subtree, hf_printer_attributes_keep_printed_jobs,
2142 tvb, offset - 4, 4, attributes);
2144 proto_tree_add_boolean(
2145 subtree, hf_printer_attributes_enable_devq,
2146 tvb, offset - 4, 4, attributes);
2148 proto_tree_add_boolean(
2149 subtree, hf_printer_attributes_local,
2150 tvb, offset - 4, 4, attributes);
2152 proto_tree_add_boolean(
2153 subtree, hf_printer_attributes_hidden,
2154 tvb, offset - 4, 4, attributes);
2156 proto_tree_add_boolean(
2157 subtree, hf_printer_attributes_network,
2158 tvb, offset - 4, 4, attributes);
2160 proto_tree_add_boolean(
2161 subtree, hf_printer_attributes_shared,
2162 tvb, offset - 4, 4, attributes);
2164 proto_tree_add_boolean(
2165 subtree, hf_printer_attributes_default,
2166 tvb, offset - 4, 4, attributes);
2168 proto_tree_add_boolean(
2169 subtree, hf_printer_attributes_direct,
2170 tvb, offset - 4, 4, attributes);
2172 proto_tree_add_boolean(
2173 subtree, hf_printer_attributes_queued,
2174 tvb, offset - 4, 4, attributes);
2183 static gint ett_PRINTER_INFO_2 = -1;
2185 static int dissect_PRINTER_INFO_2(tvbuff_t *tvb, int offset,
2186 packet_info *pinfo, proto_tree *tree,
2189 guint32 devmode_offset, secdesc_offset;
2191 offset = dissect_spoolss_relstr(
2192 tvb, offset, pinfo, tree, drep, hf_servername,
2195 offset = dissect_spoolss_relstr(
2196 tvb, offset, pinfo, tree, drep, hf_printername,
2199 offset = dissect_spoolss_relstr(
2200 tvb, offset, pinfo, tree, drep, hf_sharename,
2203 offset = dissect_spoolss_relstr(
2204 tvb, offset, pinfo, tree, drep, hf_portname,
2207 offset = dissect_spoolss_relstr(
2208 tvb, offset, pinfo, tree, drep, hf_drivername,
2211 offset = dissect_spoolss_relstr(
2212 tvb, offset, pinfo, tree, drep, hf_printercomment,
2215 offset = dissect_spoolss_relstr(
2216 tvb, offset, pinfo, tree, drep, hf_printerlocation,
2219 offset = dissect_ndr_uint32(
2220 tvb, offset, pinfo, NULL, drep, hf_offset,
2223 dissect_DEVMODE(tvb, devmode_offset - 4, pinfo, tree, drep);
2225 offset = dissect_spoolss_relstr(
2226 tvb, offset, pinfo, tree, drep, hf_sepfile,
2229 offset = dissect_spoolss_relstr(
2230 tvb, offset, pinfo, tree, drep, hf_printprocessor,
2233 offset = dissect_spoolss_relstr(
2234 tvb, offset, pinfo, tree, drep, hf_datatype,
2237 offset = dissect_spoolss_relstr(
2238 tvb, offset, pinfo, tree, drep, hf_parameters,
2242 * XXX - what *is* the length of this security descriptor?
2243 * "prs_PRINTER_INFO_2()" is passed to "defer_ptr()", but
2244 * "defer_ptr" takes, as an argument, a function with a
2245 * different calling sequence from "prs_PRINTER_INFO_2()",
2246 * lacking the "len" argument, so that won't work.
2249 /* TODO: I think the length is only used to fix up the hex display
2250 pane. We should be able to use proto_item_set_len() to avoid
2251 having to calculate the length. -tpot */
2253 offset = dissect_ndr_uint32(
2254 tvb, offset, pinfo, NULL, drep, hf_offset,
2257 dissect_nt_sec_desc(
2258 tvb, secdesc_offset, pinfo, tree, drep,
2259 tvb_length_remaining(tvb, secdesc_offset),
2260 &spoolss_printer_access_mask_info);
2262 offset = dissect_printer_attributes(tvb, offset, pinfo, tree, drep);
2264 offset = dissect_ndr_uint32(
2265 tvb, offset, pinfo, NULL, drep, hf_printer_priority,
2268 offset = dissect_ndr_uint32(
2269 tvb, offset, pinfo, NULL, drep,
2270 hf_printer_default_priority, NULL);
2272 offset = dissect_ndr_uint32(
2273 tvb, offset, pinfo, NULL, drep, hf_start_time, NULL);
2275 offset = dissect_ndr_uint32(
2276 tvb, offset, pinfo, NULL, drep, hf_end_time, NULL);
2278 offset = dissect_ndr_uint32(
2279 tvb, offset, pinfo, tree, drep,
2280 hf_printer_status, NULL);
2282 offset = dissect_ndr_uint32(
2283 tvb, offset, pinfo, NULL, drep, hf_printer_jobs,
2286 offset = dissect_ndr_uint32(
2287 tvb, offset, pinfo, NULL, drep,
2288 hf_printer_averageppm, NULL);
2297 static gint ett_PRINTER_INFO_3 = -1;
2299 static int dissect_PRINTER_INFO_3(tvbuff_t *tvb, int offset,
2300 packet_info *pinfo, proto_tree *tree,
2303 offset = dissect_ndr_uint32(
2304 tvb, offset, pinfo, tree, drep,
2305 hf_printer_flags, NULL);
2307 offset = dissect_nt_sec_desc(
2308 tvb, offset, pinfo, tree, drep,
2309 tvb_length_remaining(tvb, offset),
2310 &spoolss_printer_access_mask_info);
2319 static gint ett_PRINTER_INFO_7 = -1;
2321 static const value_string getprinter_action_vals[] = {
2322 { DS_PUBLISH, "Publish" },
2323 { DS_UNPUBLISH, "Unpublish" },
2324 { DS_UPDATE, "Update" },
2326 /* Not sure what the constant values are here */
2328 /* { DS_PENDING, "Pending" }, */
2329 /* { DS_REPUBLISH, "Republish" }, */
2334 static int dissect_PRINTER_INFO_7(tvbuff_t *tvb, int offset,
2335 packet_info *pinfo, proto_tree *tree,
2338 offset = dissect_spoolss_relstr(
2339 tvb, offset, pinfo, tree, drep, hf_printer_guid,
2342 offset = dissect_ndr_uint32(
2343 tvb, offset, pinfo, tree, drep,
2344 hf_printer_action, NULL);
2350 * PRINTER_DATATYPE structure
2353 static gint ett_PRINTER_DATATYPE = -1;
2355 static int dissect_PRINTER_DATATYPE(tvbuff_t *tvb, int offset,
2356 packet_info *pinfo, proto_tree *tree,
2359 dcerpc_info *di = pinfo->private_data;
2361 if (di->conformant_run)
2364 offset = dissect_ndr_cvstring(
2365 tvb, offset, pinfo, tree, drep, sizeof(guint16),
2366 hf_datatype, TRUE, NULL);
2372 * USER_LEVEL_1 structure
2375 static gint ett_USER_LEVEL_1 = -1;
2377 static int hf_userlevel_size = -1;
2378 static int hf_userlevel_client = -1;
2379 static int hf_userlevel_user = -1;
2380 static int hf_userlevel_build = -1;
2381 static int hf_userlevel_major = -1;
2382 static int hf_userlevel_minor = -1;
2383 static int hf_userlevel_processor = -1;
2385 static int dissect_USER_LEVEL_1(tvbuff_t *tvb, int offset,
2386 packet_info *pinfo, proto_tree *tree,
2391 /* Guy has pointed out that this dissection looks wrong. In
2392 the ethereal output for a USER_LEVEL_1 it looks like the
2393 info level and container pointer are transposed. I'm not
2394 even sure this structure is a container. */
2396 offset = dissect_ndr_uint32(
2397 tvb, offset, pinfo, tree, drep, hf_level, &level);
2399 offset = dissect_ndr_uint32(
2400 tvb, offset, pinfo, tree, drep, hf_userlevel_size, NULL);
2402 offset = dissect_ndr_str_pointer_item(
2403 tvb, offset, pinfo, tree, drep, NDR_POINTER_UNIQUE,
2404 "Client", hf_userlevel_client, 0);
2406 offset = dissect_ndr_str_pointer_item(
2407 tvb, offset, pinfo, tree, drep, NDR_POINTER_UNIQUE,
2408 "User", hf_userlevel_user, 0);
2410 offset = dissect_ndr_uint32(
2411 tvb, offset, pinfo, tree, drep, hf_userlevel_build, NULL);
2413 offset = dissect_ndr_uint32(
2414 tvb, offset, pinfo, tree, drep, hf_userlevel_major, NULL);
2416 offset = dissect_ndr_uint32(
2417 tvb, offset, pinfo, tree, drep, hf_userlevel_minor, NULL);
2419 offset = dissect_ndr_uint32(
2420 tvb, offset, pinfo, tree, drep, hf_userlevel_processor, NULL);
2426 * USER_LEVEL_CTR structure
2429 static gint ett_USER_LEVEL_CTR = -1;
2431 static int dissect_USER_LEVEL_CTR(tvbuff_t *tvb, int offset,
2432 packet_info *pinfo, proto_tree *tree,
2435 dcerpc_info *di = pinfo->private_data;
2437 proto_tree *subtree;
2440 if (di->conformant_run)
2443 item = proto_tree_add_text(
2444 tree, tvb, offset, 0, "User level container");
2446 subtree = proto_item_add_subtree(item, ett_USER_LEVEL_CTR);
2448 offset = dissect_ndr_uint32(
2449 tvb, offset, pinfo, subtree, drep, hf_level, &level);
2453 offset = dissect_ndr_pointer(
2454 tvb, offset, pinfo, subtree, drep,
2455 dissect_USER_LEVEL_1, NDR_POINTER_UNIQUE,
2456 "User level 1", -1);
2459 proto_tree_add_text(
2460 tree, tvb, offset, 0,
2461 "[Info level %d not decoded]", level);
2469 * SpoolssOpenPrinterEx
2472 static int SpoolssOpenPrinterEx_q(tvbuff_t *tvb, int offset,
2473 packet_info *pinfo, proto_tree *tree,
2476 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2477 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
2482 offset = dissect_ndr_pointer_cb(
2483 tvb, offset, pinfo, tree, drep,
2484 dissect_ndr_wchar_cvstring, NDR_POINTER_UNIQUE,
2485 "Printer name", hf_printername, cb_wstr_postprocess,
2486 GINT_TO_POINTER(CB_STR_COL_INFO | CB_STR_SAVE | 1));
2488 offset = dissect_ndr_pointer(
2489 tvb, offset, pinfo, tree, drep,
2490 dissect_PRINTER_DATATYPE, NDR_POINTER_UNIQUE,
2491 "Printer datatype", -1);
2493 offset = dissect_DEVMODE_CTR(tvb, offset, pinfo, tree, drep);
2495 /* Luckily we can use the string stored in dcv->private_data as it
2496 appears before the printer datatype since we are at the top
2499 name = (char *)dcv->private_data;
2502 if (name[0] == '\\' && name[1] == '\\')
2505 /* Determine if we are opening a printer or a print server */
2507 if (strchr(name, '\\'))
2508 offset = dissect_nt_access_mask(
2509 tvb, offset, pinfo, tree, drep,
2511 &spoolss_printer_access_mask_info);
2513 offset = dissect_nt_access_mask(
2514 tvb, offset, pinfo, tree, drep,
2516 &spoolss_printserver_access_mask_info);
2519 /* We can't decide what type of object being opened */
2521 offset = dissect_nt_access_mask(
2522 tvb, offset, pinfo, tree, drep, hf_access_required,
2526 offset = dissect_USER_LEVEL_CTR(tvb, offset, pinfo, tree, drep);
2531 static int SpoolssOpenPrinterEx_r(tvbuff_t *tvb, int offset,
2532 packet_info *pinfo, proto_tree *tree,
2535 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2536 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
2537 e_ctx_hnd policy_hnd;
2538 proto_item *hnd_item;
2543 offset = dissect_nt_policy_hnd(
2544 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, &hnd_item,
2547 offset = dissect_doserror(
2548 tvb, offset, pinfo, tree, drep, hf_rc, &status);
2552 /* Associate the returned printer handle with a name */
2554 if (dcv->private_data) {
2557 pol_name = g_strdup_printf(
2558 "OpenPrinterEx(%s)",
2559 (char *)dcv->private_data);
2561 dcerpc_smb_store_pol_name(&policy_hnd, pinfo, pol_name);
2564 g_free(dcv->private_data);
2565 dcv->private_data = NULL;
2569 * If we have a name for the handle, attach it to the item.
2571 * XXX - we can't just do that above, as this may be called
2572 * twice (see "dissect_pipe_dcerpc()", which calls the
2573 * DCE RPC dissector twice), and in the first call we're
2574 * not building a protocol tree (so we don't have an item
2575 * to which to attach it) and in the second call
2576 * "dcv->private_data" is NULL so we don't construct a
2580 if (hnd_item != NULL) {
2583 if (dcerpc_smb_fetch_pol(&policy_hnd, &name, NULL, NULL,
2584 pinfo->fd->num) && name != NULL)
2585 proto_item_append_text(hnd_item, ": %s", name);
2592 static const value_string printer_notify_option_data_vals[] = {
2593 { PRINTER_NOTIFY_SERVER_NAME, "Server name" },
2594 { PRINTER_NOTIFY_PRINTER_NAME, "Printer name" },
2595 { PRINTER_NOTIFY_SHARE_NAME, "Share name" },
2596 { PRINTER_NOTIFY_PORT_NAME, "Port name" },
2597 { PRINTER_NOTIFY_DRIVER_NAME, "Driver name" },
2598 { PRINTER_NOTIFY_COMMENT, "Comment" },
2599 { PRINTER_NOTIFY_LOCATION, "Location" },
2600 { PRINTER_NOTIFY_DEVMODE, "Devmode" },
2601 { PRINTER_NOTIFY_SEPFILE, "Sepfile" },
2602 { PRINTER_NOTIFY_PRINT_PROCESSOR, "Print processor" },
2603 { PRINTER_NOTIFY_PARAMETERS, "Parameters" },
2604 { PRINTER_NOTIFY_DATATYPE, "Datatype" },
2605 { PRINTER_NOTIFY_SECURITY_DESCRIPTOR, "Security descriptor" },
2606 { PRINTER_NOTIFY_ATTRIBUTES, "Attributes" },
2607 { PRINTER_NOTIFY_PRIORITY, "Priority" },
2608 { PRINTER_NOTIFY_DEFAULT_PRIORITY, "Default priority" },
2609 { PRINTER_NOTIFY_START_TIME, "Start time" },
2610 { PRINTER_NOTIFY_UNTIL_TIME, "Until time" },
2611 { PRINTER_NOTIFY_STATUS, "Status" },
2612 { PRINTER_NOTIFY_STATUS_STRING, "Status string" },
2613 { PRINTER_NOTIFY_CJOBS, "Cjobs" },
2614 { PRINTER_NOTIFY_AVERAGE_PPM, "Average PPM" },
2615 { PRINTER_NOTIFY_TOTAL_PAGES, "Total pages" },
2616 { PRINTER_NOTIFY_PAGES_PRINTED, "Pages printed" },
2617 { PRINTER_NOTIFY_TOTAL_BYTES, "Total bytes" },
2618 { PRINTER_NOTIFY_BYTES_PRINTED, "Bytes printed" },
2622 static const value_string job_notify_option_data_vals[] = {
2623 { JOB_NOTIFY_PRINTER_NAME, "Printer name" },
2624 { JOB_NOTIFY_MACHINE_NAME, "Machine name" },
2625 { JOB_NOTIFY_PORT_NAME, "Port name" },
2626 { JOB_NOTIFY_USER_NAME, "User name" },
2627 { JOB_NOTIFY_NOTIFY_NAME, "Notify name" },
2628 { JOB_NOTIFY_DATATYPE, "Data type" },
2629 { JOB_NOTIFY_PRINT_PROCESSOR, "Print processor" },
2630 { JOB_NOTIFY_PARAMETERS, "Parameters" },
2631 { JOB_NOTIFY_DRIVER_NAME, "Driver name" },
2632 { JOB_NOTIFY_DEVMODE, "Devmode" },
2633 { JOB_NOTIFY_STATUS, "Status" },
2634 { JOB_NOTIFY_STATUS_STRING, "Status string" },
2635 { JOB_NOTIFY_SECURITY_DESCRIPTOR, "Security descriptor" },
2636 { JOB_NOTIFY_DOCUMENT, "Document" },
2637 { JOB_NOTIFY_PRIORITY, "Priority" },
2638 { JOB_NOTIFY_POSITION, "Position" },
2639 { JOB_NOTIFY_SUBMITTED, "Submitted" },
2640 { JOB_NOTIFY_START_TIME, "Start time" },
2641 { JOB_NOTIFY_UNTIL_TIME, "Until time" },
2642 { JOB_NOTIFY_TIME, "Time" },
2643 { JOB_NOTIFY_TOTAL_PAGES, "Total pages" },
2644 { JOB_NOTIFY_PAGES_PRINTED, "Pages printed" },
2645 { JOB_NOTIFY_TOTAL_BYTES, "Total bytes" },
2646 { JOB_NOTIFY_BYTES_PRINTED, "Bytes printed" },
2651 dissect_notify_field(tvbuff_t *tvb, int offset, packet_info *pinfo,
2652 proto_tree *tree, guint8 *drep, guint16 type,
2658 offset = dissect_ndr_uint16(
2659 tvb, offset, pinfo, NULL, drep,
2660 hf_notify_field, &field);
2663 case PRINTER_NOTIFY_TYPE:
2664 str = val_to_str(field, printer_notify_option_data_vals,
2667 case JOB_NOTIFY_TYPE:
2668 str = val_to_str(field, job_notify_option_data_vals,
2672 str = "Unknown notify type";
2676 proto_tree_add_text(tree, tvb, offset - 2, 2,
2677 "Field: %s (%d)", str, field);
2686 dissect_NOTIFY_OPTION_DATA(tvbuff_t *tvb, int offset, packet_info *pinfo,
2687 proto_tree *tree, guint8 *drep)
2689 dcerpc_info *di = pinfo->private_data;
2690 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
2694 if (di->conformant_run)
2697 offset = dissect_ndr_uint32(
2698 tvb, offset, pinfo, tree, drep,
2699 hf_notify_option_data_count, &count);
2701 type = GPOINTER_TO_INT(dcv->private_data);
2703 for (i = 0; i < count; i++)
2704 offset = dissect_notify_field(
2705 tvb, offset, pinfo, tree, drep, type, NULL);
2710 static const value_string printer_notify_types[] =
2712 { PRINTER_NOTIFY_TYPE, "Printer notify" },
2713 { JOB_NOTIFY_TYPE, "Job notify" },
2717 static char *notify_plural(int count)
2720 return "notification";
2725 static gint ett_NOTIFY_OPTION = -1;
2728 dissect_NOTIFY_OPTION(tvbuff_t *tvb, int offset, packet_info *pinfo,
2729 proto_tree *tree, guint8 *drep)
2731 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2732 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
2734 proto_tree *subtree;
2738 item = proto_tree_add_text(tree, tvb, offset, 0, "Notify Option");
2740 subtree = proto_item_add_subtree(item, ett_NOTIFY_OPTION);
2742 offset = dissect_ndr_uint16(tvb, offset, pinfo, subtree, drep,
2743 hf_notify_option_type, &type);
2745 proto_item_append_text(
2746 item, ": %s", val_to_str(type, printer_notify_types,
2749 offset = dissect_ndr_uint16(tvb, offset, pinfo, subtree, drep,
2750 hf_notify_option_reserved1, NULL);
2752 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
2753 hf_notify_option_reserved2, NULL);
2755 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
2756 hf_notify_option_reserved3, NULL);
2758 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
2759 hf_notify_option_count, &count);
2761 proto_item_append_text(
2762 item, ", %d %s", count, notify_plural(count));
2764 dcv->private_data = GINT_TO_POINTER((int)type);
2766 offset = dissect_ndr_pointer(
2767 tvb, offset, pinfo, subtree, drep,
2768 dissect_NOTIFY_OPTION_DATA, NDR_POINTER_UNIQUE,
2769 "Notify Option Data", -1);
2775 dissect_NOTIFY_OPTIONS_ARRAY(tvbuff_t *tvb, int offset,
2776 packet_info *pinfo, proto_tree *tree,
2779 /* Why is a check for di->conformant_run not required here? */
2781 offset = dissect_ndr_ucarray(
2782 tvb, offset, pinfo, tree, drep, dissect_NOTIFY_OPTION);
2787 static gint ett_notify_options_flags = -1;
2789 static const true_false_string tfs_notify_options_flags_refresh = {
2790 "Data for all monitored fields is present",
2791 "Data for all monitored fields not present"
2795 dissect_notify_options_flags(tvbuff_t *tvb, int offset, packet_info *pinfo,
2796 proto_tree *tree, guint8 *drep)
2799 proto_tree *subtree;
2802 offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
2803 hf_notify_options_flags,
2806 item = proto_tree_add_text(tree, tvb, offset - 4, 4,
2807 "Flags: 0x%08x", flags);
2809 subtree = proto_item_add_subtree(item, ett_notify_options_flags);
2811 proto_tree_add_boolean(
2812 subtree, hf_notify_options_flags_refresh,
2813 tvb, offset, 4, flags);
2819 dissect_NOTIFY_OPTIONS_ARRAY_CTR(tvbuff_t *tvb, int offset,
2820 packet_info *pinfo, proto_tree *tree,
2823 dcerpc_info *di = pinfo->private_data;
2825 if (di->conformant_run)
2828 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2829 hf_notify_options_version, NULL);
2831 offset = dissect_notify_options_flags(tvb, offset, pinfo, tree, drep);
2833 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2834 hf_notify_options_count, NULL);
2836 offset = dissect_ndr_pointer(
2837 tvb, offset, pinfo, tree, drep,
2838 dissect_NOTIFY_OPTIONS_ARRAY, NDR_POINTER_UNIQUE,
2839 "Notify Options Array", -1);
2848 static gint ett_rffpcnex_flags = -1;
2850 static int hf_rffpcnex_flags = -1;
2851 static int hf_rffpcnex_options = -1;
2853 static int hf_rffpcnex_flags_add_printer = -1;
2854 static int hf_rffpcnex_flags_set_printer = -1;
2855 static int hf_rffpcnex_flags_delete_printer = -1;
2856 static int hf_rffpcnex_flags_failed_printer_connection = -1;
2858 static const true_false_string tfs_rffpcnex_flags_add_printer = {
2859 "Notify on add printer",
2860 "Don't notify on add printer"
2863 static const true_false_string tfs_rffpcnex_flags_set_printer = {
2864 "Notify on set printer",
2865 "Don't notify on set printer"
2868 static const true_false_string tfs_rffpcnex_flags_delete_printer = {
2869 "Notify on delete printer",
2870 "Don't notify on delete printer"
2873 static const true_false_string tfs_rffpcnex_flags_failed_connection_printer = {
2874 "Notify on failed printer connection",
2875 "Don't notify on failed printer connection"
2878 static int hf_rffpcnex_flags_add_job = -1;
2879 static int hf_rffpcnex_flags_set_job = -1;
2880 static int hf_rffpcnex_flags_delete_job = -1;
2881 static int hf_rffpcnex_flags_write_job = -1;
2883 static const true_false_string tfs_rffpcnex_flags_add_job = {
2884 "Notify on add job",
2885 "Don't notify on add job"
2888 static const true_false_string tfs_rffpcnex_flags_set_job = {
2889 "Notify on set job",
2890 "Don't notify on set job"
2893 static const true_false_string tfs_rffpcnex_flags_delete_job = {
2894 "Notify on delete job",
2895 "Don't notify on delete job"
2898 static const true_false_string tfs_rffpcnex_flags_write_job = {
2899 "Notify on writejob",
2900 "Don't notify on write job"
2903 static int hf_rffpcnex_flags_add_form = -1;
2904 static int hf_rffpcnex_flags_set_form = -1;
2905 static int hf_rffpcnex_flags_delete_form = -1;
2907 static const true_false_string tfs_rffpcnex_flags_add_form = {
2908 "Notify on add form",
2909 "Don't notify on add form"
2912 static const true_false_string tfs_rffpcnex_flags_set_form = {
2913 "Notify on set form",
2914 "Don't notify on set form"
2917 static const true_false_string tfs_rffpcnex_flags_delete_form = {
2918 "Notify on delete form",
2919 "Don't notify on delete form"
2922 static int hf_rffpcnex_flags_add_port = -1;
2923 static int hf_rffpcnex_flags_configure_port = -1;
2924 static int hf_rffpcnex_flags_delete_port = -1;
2926 static const true_false_string tfs_rffpcnex_flags_add_port = {
2927 "Notify on add port",
2928 "Don't notify on add port"
2931 static const true_false_string tfs_rffpcnex_flags_configure_port = {
2932 "Notify on configure port",
2933 "Don't notify on configure port"
2936 static const true_false_string tfs_rffpcnex_flags_delete_port = {
2937 "Notify on delete port",
2938 "Don't notify on delete port"
2941 static int hf_rffpcnex_flags_add_print_processor = -1;
2942 static int hf_rffpcnex_flags_delete_print_processor = -1;
2944 static const true_false_string tfs_rffpcnex_flags_add_print_processor = {
2945 "Notify on add driver",
2946 "Don't notify on add driver"
2949 static const true_false_string tfs_rffpcnex_flags_delete_print_processor = {
2950 "Notify on add driver",
2951 "Don't notify on add driver"
2954 static int hf_rffpcnex_flags_add_driver = -1;
2955 static int hf_rffpcnex_flags_set_driver = -1;
2956 static int hf_rffpcnex_flags_delete_driver = -1;
2958 static const true_false_string tfs_rffpcnex_flags_add_driver = {
2959 "Notify on add driver",
2960 "Don't notify on add driver"
2963 static const true_false_string tfs_rffpcnex_flags_set_driver = {
2964 "Notify on set driver",
2965 "Don't notify on set driver"
2968 static const true_false_string tfs_rffpcnex_flags_delete_driver = {
2969 "Notify on delete driver",
2970 "Don't notify on delete driver"
2973 static int hf_rffpcnex_flags_timeout = -1;
2975 static const true_false_string tfs_rffpcnex_flags_timeout = {
2976 "Notify on timeout",
2977 "Don't notify on timeout"
2980 static int SpoolssRFFPCNEX_q(tvbuff_t *tvb, int offset,
2981 packet_info *pinfo, proto_tree *tree,
2985 proto_item *flags_item;
2986 proto_tree *flags_subtree;
2990 offset = dissect_nt_policy_hnd(
2991 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
2994 offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
2995 hf_rffpcnex_flags, &flags);
2997 flags_item = proto_tree_add_text(tree, tvb, offset - 4, 4,
2998 "Flags: 0x%08x", flags);
3000 flags_subtree = proto_item_add_subtree(flags_item, ett_rffpcnex_flags);
3002 proto_tree_add_boolean(
3003 flags_subtree, hf_rffpcnex_flags_timeout, tvb,
3004 offset - 4, 4, flags);
3006 proto_tree_add_boolean(
3007 flags_subtree, hf_rffpcnex_flags_delete_driver, tvb,
3008 offset - 4, 4, flags);
3010 proto_tree_add_boolean(
3011 flags_subtree, hf_rffpcnex_flags_set_driver, tvb,
3012 offset - 4, 4, flags);
3014 proto_tree_add_boolean(
3015 flags_subtree, hf_rffpcnex_flags_add_driver, tvb,
3016 offset - 4, 4, flags);
3018 proto_tree_add_boolean(
3020 hf_rffpcnex_flags_delete_print_processor, tvb,
3021 offset - 4, 4, flags);
3023 proto_tree_add_boolean(
3024 flags_subtree, hf_rffpcnex_flags_add_print_processor,
3025 tvb, offset - 4, 4, flags);
3027 proto_tree_add_boolean(
3028 flags_subtree, hf_rffpcnex_flags_delete_port, tvb,
3029 offset - 4, 4, flags);
3031 proto_tree_add_boolean(
3032 flags_subtree, hf_rffpcnex_flags_configure_port, tvb,
3033 offset - 4, 4, flags);
3035 proto_tree_add_boolean(
3036 flags_subtree, hf_rffpcnex_flags_add_port, tvb,
3037 offset - 4, 4, flags);
3039 proto_tree_add_boolean(
3040 flags_subtree, hf_rffpcnex_flags_delete_form, tvb,
3041 offset - 4, 4, flags);
3043 proto_tree_add_boolean(
3044 flags_subtree, hf_rffpcnex_flags_set_form, tvb,
3045 offset - 4, 4, flags);
3047 proto_tree_add_boolean(
3048 flags_subtree, hf_rffpcnex_flags_add_form, tvb,
3049 offset - 4, 4, flags);
3051 proto_tree_add_boolean(
3052 flags_subtree, hf_rffpcnex_flags_write_job, tvb,
3053 offset - 4, 4, flags);
3055 proto_tree_add_boolean(
3056 flags_subtree, hf_rffpcnex_flags_delete_job, tvb,
3057 offset - 4, 4, flags);
3059 proto_tree_add_boolean(
3060 flags_subtree, hf_rffpcnex_flags_set_job, tvb,
3061 offset - 4, 4, flags);
3063 proto_tree_add_boolean(
3064 flags_subtree, hf_rffpcnex_flags_add_job, tvb,
3065 offset - 4, 4, flags);
3067 proto_tree_add_boolean(
3069 hf_rffpcnex_flags_failed_printer_connection, tvb,
3070 offset - 4, 4, flags);
3072 proto_tree_add_boolean(
3073 flags_subtree, hf_rffpcnex_flags_delete_printer, tvb,
3074 offset - 4, 4, flags);
3076 proto_tree_add_boolean(
3077 flags_subtree, hf_rffpcnex_flags_set_printer, tvb,
3078 offset - 4, 4, flags);
3080 proto_tree_add_boolean(
3081 flags_subtree, hf_rffpcnex_flags_add_printer, tvb,
3082 offset - 4, 4, flags);
3084 if (flags & SPOOLSS_PRINTER_CHANGE_PRINTER)
3085 proto_item_append_text(flags_item, ", change printer");
3087 if (flags & SPOOLSS_PRINTER_CHANGE_JOB)
3088 proto_item_append_text(flags_item, ", change job");
3090 if (flags & SPOOLSS_PRINTER_CHANGE_FORM)
3091 proto_item_append_text(flags_item, ", change form");
3093 if (flags & SPOOLSS_PRINTER_CHANGE_PORT)
3094 proto_item_append_text(flags_item, ", change port");
3096 if (flags & SPOOLSS_PRINTER_CHANGE_PRINTER_DRIVER)
3097 proto_item_append_text(flags_item, ", change printer driver");
3099 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3100 hf_rffpcnex_options, NULL);
3102 offset = dissect_ndr_str_pointer_item(
3103 tvb, offset, pinfo, tree, drep, NDR_POINTER_UNIQUE,
3104 "Server", hf_servername, 0);
3106 offset = dissect_ndr_uint32(
3107 tvb, offset, pinfo, tree, drep, hf_printerlocal, NULL);
3109 offset = dissect_ndr_pointer(
3110 tvb, offset, pinfo, tree, drep,
3111 dissect_NOTIFY_OPTIONS_ARRAY_CTR, NDR_POINTER_UNIQUE,
3112 "Notify Options Container", -1);
3117 static int SpoolssRFFPCNEX_r(tvbuff_t *tvb, int offset,
3118 packet_info *pinfo, proto_tree *tree,
3123 offset = dissect_doserror(
3124 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
3130 * SpoolssReplyOpenPrinter
3133 static int SpoolssReplyOpenPrinter_q(tvbuff_t *tvb, int offset,
3134 packet_info *pinfo, proto_tree *tree,
3137 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3138 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3139 guint32 printerlocal;
3144 offset = dissect_ndr_cvstring(
3145 tvb, offset, pinfo, tree, drep, sizeof(guint16),
3146 hf_servername, TRUE, &name);
3148 if (check_col(pinfo->cinfo, COL_INFO) && name)
3149 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", name);
3151 if (!dcv->private_data && name)
3152 dcv->private_data = name;
3156 offset = dissect_ndr_uint32(
3157 tvb, offset, pinfo, tree, drep, hf_printerlocal,
3160 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3161 hf_printerdata_type, NULL);
3163 offset = dissect_ndr_uint32(
3164 tvb, offset, pinfo, tree, drep, hf_replyopenprinter_unk0,
3167 offset = dissect_ndr_uint32(
3168 tvb, offset, pinfo, tree, drep, hf_replyopenprinter_unk1,
3174 static int SpoolssReplyOpenPrinter_r(tvbuff_t *tvb, int offset,
3175 packet_info *pinfo, proto_tree *tree,
3178 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3179 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3180 e_ctx_hnd policy_hnd;
3181 proto_item *hnd_item;
3186 offset = dissect_nt_policy_hnd(
3187 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, &hnd_item,
3190 offset = dissect_doserror(
3191 tvb, offset, pinfo, tree, drep, hf_rc, &status);
3195 /* Associate the returned printer handle with a name */
3197 if (dcv->private_data) {
3200 pol_name = g_strdup_printf(
3202 (char *)dcv->private_data);
3204 dcerpc_smb_store_pol_name(&policy_hnd, pinfo, pol_name);
3207 g_free(dcv->private_data);
3208 dcv->private_data = NULL;
3212 * If we have a name for the handle, attach it to the item.
3214 * XXX - we can't just do that above, as this may be called
3215 * twice (see "dissect_pipe_dcerpc()", which calls the
3216 * DCE RPC dissector twice), and in the first call we're
3217 * not building a protocol tree (so we don't have an item
3218 * to which to attach it) and in the second call
3219 * "dcv->private_data" is NULL so we don't construct a
3223 if (hnd_item != NULL) {
3226 if (dcerpc_smb_fetch_pol(&policy_hnd, &name, NULL, NULL,
3227 pinfo->fd->num) && name != NULL)
3228 proto_item_append_text(hnd_item, ": %s", name);
3241 static int SpoolssGetPrinter_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
3242 proto_tree *tree, guint8 *drep _U_)
3244 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3245 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3250 offset = dissect_nt_policy_hnd(
3251 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
3254 offset = dissect_ndr_uint32(
3255 tvb, offset, pinfo, tree, drep, hf_level, &level);
3257 if (check_col(pinfo->cinfo, COL_INFO))
3258 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
3260 dcv->private_data = (void *)level;
3262 offset = dissect_spoolss_buffer(
3263 tvb, offset, pinfo, tree, drep, NULL);
3265 offset = dissect_ndr_uint32(
3266 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
3271 static gint ett_PRINTER_INFO = -1;
3273 static int SpoolssGetPrinter_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
3274 proto_tree *tree, guint8 *drep _U_)
3276 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3277 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3279 gint16 level = (guint32)dcv->private_data;
3281 proto_tree *subtree = NULL;
3283 if (check_col(pinfo->cinfo, COL_INFO))
3284 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
3288 offset = dissect_spoolss_buffer(
3289 tvb, offset, pinfo, tree, drep, &buffer);
3298 item = proto_tree_add_text(
3299 buffer.tree, buffer.tvb, 0, -1,
3300 "Print info level %d", level);
3302 subtree = proto_item_add_subtree(
3303 item, ett_PRINTER_INFO);
3309 dissect_PRINTER_INFO_0(
3310 buffer.tvb, 0, pinfo, subtree, drep);
3313 dissect_PRINTER_INFO_1(
3314 buffer.tvb, 0, pinfo, subtree, drep);
3317 dissect_PRINTER_INFO_2(
3318 buffer.tvb, 0, pinfo, subtree, drep);
3321 dissect_PRINTER_INFO_3(
3322 buffer.tvb, 0, pinfo, subtree, drep);
3325 dissect_PRINTER_INFO_7(
3326 buffer.tvb, 0, pinfo, subtree, drep);
3329 proto_tree_add_text(
3330 buffer.tree, buffer.tvb, 0, -1,
3331 "[Unknown printer info level %d]", level);
3336 offset = dissect_ndr_uint32(
3337 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
3339 offset = dissect_doserror(
3340 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
3349 static gint ett_SEC_DESC_BUF = -1;
3351 static int hf_secdescbuf_maxlen = -1;
3352 static int hf_secdescbuf_undoc = -1;
3353 static int hf_secdescbuf_len = -1;
3356 dissect_SEC_DESC_BUF(tvbuff_t *tvb, int offset, packet_info *pinfo,
3357 proto_tree *tree, guint8 *drep)
3360 proto_tree *subtree;
3363 /* XXX: I think this is really a array of bytes which can be
3364 dissected using dissect_ndr_cvstring(). The dissected data
3365 can be passed to dissect_nt_sec_desc(). The problem is that
3366 dissect_nt_cvstring() passes back a char * where it really
3367 should pass back a tvb. */
3369 item = proto_tree_add_text(
3370 tree, tvb, offset, 0, "Security descriptor buffer");
3372 subtree = proto_item_add_subtree(item, ett_SEC_DESC_BUF);
3374 offset = dissect_ndr_uint32(
3375 tvb, offset, pinfo, subtree, drep,
3376 hf_secdescbuf_maxlen, NULL);
3378 offset = dissect_ndr_uint32(
3379 tvb, offset, pinfo, subtree, drep,
3380 hf_secdescbuf_undoc, NULL);
3382 offset = dissect_ndr_uint32(
3383 tvb, offset, pinfo, subtree, drep,
3384 hf_secdescbuf_len, &len);
3386 dissect_nt_sec_desc(
3387 tvb, offset, pinfo, subtree, drep, len,
3388 &spoolss_printer_access_mask_info);
3396 * SPOOL_PRINTER_INFO_LEVEL
3399 static gint ett_SPOOL_PRINTER_INFO_LEVEL = -1;
3401 /* spool printer info */
3403 static int hf_spool_printer_info_devmode_ptr = -1;
3404 static int hf_spool_printer_info_secdesc_ptr = -1;
3407 dissect_SPOOL_PRINTER_INFO(tvbuff_t *tvb, int offset, packet_info *pinfo,
3408 proto_tree *tree, guint8 *drep)
3411 proto_tree *subtree;
3414 item = proto_tree_add_text(
3415 tree, tvb, offset, 0, "Spool printer info level");
3417 subtree = proto_item_add_subtree(item, ett_SPOOL_PRINTER_INFO_LEVEL);
3419 offset = dissect_ndr_uint32(
3420 tvb, offset, pinfo, subtree, drep, hf_level, &level);
3424 guint32 devmode_ptr, secdesc_ptr;
3426 /* I can't seem to get this working with the correct
3427 dissect_ndr_pointer() function so let's cheat and
3428 dissect the pointers by hand. )-: */
3430 offset = dissect_ndr_uint32(
3431 tvb, offset, pinfo, subtree, drep,
3432 hf_spool_printer_info_devmode_ptr,
3435 offset = dissect_ndr_uint32(
3436 tvb, offset, pinfo, subtree, drep,
3437 hf_spool_printer_info_secdesc_ptr,
3441 offset = dissect_DEVMODE_CTR(
3442 tvb, offset, pinfo, subtree, drep);
3445 offset = dissect_SEC_DESC_BUF(
3446 tvb, offset, pinfo, subtree, drep);
3452 proto_tree_add_text(
3453 subtree, tvb, offset, 0,
3454 "[Unknown spool printer info level %d]", level);
3465 static int hf_setprinter_cmd = -1;
3467 static const value_string setprinter_cmd_vals[] = {
3468 { SPOOLSS_PRINTER_CONTROL_UNPAUSE, "Unpause" },
3469 { SPOOLSS_PRINTER_CONTROL_PAUSE, "Pause" },
3470 { SPOOLSS_PRINTER_CONTROL_RESUME, "Resume" },
3471 { SPOOLSS_PRINTER_CONTROL_PURGE, "Purge" },
3472 { SPOOLSS_PRINTER_CONTROL_SET_STATUS, "Set status" },
3476 static int SpoolssSetPrinter_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
3477 proto_tree *tree, guint8 *drep _U_)
3483 offset = dissect_nt_policy_hnd(
3484 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
3487 offset = dissect_ndr_uint32(
3488 tvb, offset, pinfo, tree, drep, hf_level, &level);
3490 if (check_col(pinfo->cinfo, COL_INFO))
3491 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
3493 offset = dissect_SPOOL_PRINTER_INFO(
3494 tvb, offset, pinfo, tree, drep);
3496 offset = dissect_ndr_uint32(
3497 tvb, offset, pinfo, tree, drep,
3498 hf_setprinter_cmd, NULL);
3503 static int SpoolssSetPrinter_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
3504 proto_tree *tree, guint8 *drep _U_)
3508 offset = dissect_doserror(
3509 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
3518 static const value_string form_type_vals[] =
3520 { SPOOLSS_FORM_USER, "User" },
3521 { SPOOLSS_FORM_BUILTIN, "Builtin" },
3522 { SPOOLSS_FORM_PRINTER, "Printer" },
3526 static gint ett_FORM_REL = -1;
3528 static int dissect_FORM_REL(tvbuff_t *tvb, int offset, packet_info *pinfo,
3529 proto_tree *tree, guint8 *drep, int struct_start)
3532 proto_tree *subtree;
3534 int item_start = offset;
3537 item = proto_tree_add_text(tree, tvb, offset, 0, "Form");
3539 subtree = proto_item_add_subtree(item, ett_FORM_REL);
3541 offset = dissect_ndr_uint32(
3542 tvb, offset, pinfo, subtree, drep, hf_form_flags, &flags);
3544 offset = dissect_spoolss_relstr(
3545 tvb, offset, pinfo, subtree, drep, hf_form_name,
3546 struct_start, &name);
3549 proto_item_append_text(item, ": %s", name);
3553 offset = dissect_ndr_uint32(
3554 tvb, offset, pinfo, subtree, drep,
3555 hf_form_width, NULL);
3557 offset = dissect_ndr_uint32(
3558 tvb, offset, pinfo, subtree, drep,
3559 hf_form_height, NULL);
3561 offset = dissect_ndr_uint32(
3562 tvb, offset, pinfo, subtree, drep,
3563 hf_form_left_margin, NULL);
3565 offset = dissect_ndr_uint32(
3566 tvb, offset, pinfo, subtree, drep,
3567 hf_form_top_margin, NULL);
3569 offset = dissect_ndr_uint32(
3570 tvb, offset, pinfo, subtree, drep,
3571 hf_form_horiz_len, NULL);
3573 offset = dissect_ndr_uint32(
3574 tvb, offset, pinfo, subtree, drep,
3575 hf_form_vert_len, NULL);
3577 proto_item_set_len(item, offset - item_start);
3586 static int SpoolssEnumForms_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
3587 proto_tree *tree, guint8 *drep _U_)
3589 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3590 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3593 proto_tree_add_uint_hidden(
3594 tree, hf_form, tvb, offset, 0, 1);
3598 offset = dissect_nt_policy_hnd(
3599 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
3602 offset = dissect_ndr_uint32(
3603 tvb, offset, pinfo, tree, drep, hf_level, &level);
3605 dcv->private_data = (void *)level;
3607 if (check_col(pinfo->cinfo, COL_INFO))
3608 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
3610 offset = dissect_spoolss_buffer(
3611 tvb, offset, pinfo, tree, drep, NULL);
3613 offset = dissect_ndr_uint32(
3614 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
3619 static int SpoolssEnumForms_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
3620 proto_tree *tree, guint8 *drep _U_)
3622 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3623 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3625 guint32 level = (guint32)dcv->private_data, i, count;
3628 proto_tree_add_uint_hidden(
3629 tree, hf_form, tvb, offset, 0, 1);
3633 offset = dissect_spoolss_buffer(
3634 tvb, offset, pinfo, tree, drep, &buffer);
3636 offset = dissect_ndr_uint32(
3637 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
3639 if (check_col(pinfo->cinfo, COL_INFO))
3640 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
3642 offset = dissect_ndr_uint32(
3643 tvb, offset, pinfo, tree, drep, hf_enumforms_num, &count);
3645 /* Unfortunately this array isn't in NDR format so we can't
3646 use prs_array(). The other weird thing is the
3647 struct_start being inside the loop rather than outside.
3652 for (i = 0; i < count; i++) {
3653 int struct_start = buffer_offset;
3655 buffer_offset = dissect_FORM_REL(
3656 buffer.tvb, buffer_offset, pinfo, buffer.tree, drep,
3660 offset = dissect_doserror(
3661 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
3667 * SpoolssDeletePrinter
3670 static int SpoolssDeletePrinter_q(tvbuff_t *tvb, int offset,
3671 packet_info *pinfo, proto_tree *tree,
3676 offset = dissect_nt_policy_hnd(
3677 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
3683 static int SpoolssDeletePrinter_r(tvbuff_t *tvb, int offset,
3684 packet_info *pinfo, proto_tree *tree,
3689 offset = dissect_nt_policy_hnd(
3690 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
3693 offset = dissect_doserror(
3694 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
3699 static int SpoolssAddPrinterEx_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
3700 proto_tree *tree, guint8 *drep _U_)
3702 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3703 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3704 e_ctx_hnd policy_hnd;
3705 proto_item *hnd_item;
3710 offset = dissect_nt_policy_hnd(
3711 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, &hnd_item,
3714 offset = dissect_doserror(
3715 tvb, offset, pinfo, tree, drep, hf_rc, &status);
3719 /* Associate the returned printer handle with a name */
3721 if (dcv->private_data) {
3723 if (check_col(pinfo->cinfo, COL_INFO))
3725 pinfo->cinfo, COL_INFO, ", %s",
3726 (char *)dcv->private_data);
3728 dcerpc_smb_store_pol_name(
3729 &policy_hnd, pinfo, dcv->private_data);
3731 g_free(dcv->private_data);
3732 dcv->private_data = NULL;
3736 * If we have a name for the handle, attach it to the item.
3738 * XXX - we can't just do that above, as this may be called
3739 * twice (see "dissect_pipe_dcerpc()", which calls the
3740 * DCE RPC dissector twice), and in the first call we're
3741 * not building a protocol tree (so we don't have an item
3742 * to which to attach it) and in the second call
3743 * "dcv->private_data" is NULL so we don't construct a
3747 if (hnd_item != NULL) {
3750 if (dcerpc_smb_fetch_pol(&policy_hnd, &name, NULL, NULL,
3751 pinfo->fd->num) && name != NULL)
3752 proto_item_append_text(hnd_item, ": %s", name);
3760 * SpoolssEnumPrinterData
3763 static int hf_enumprinterdata_enumindex = -1;
3764 static int hf_enumprinterdata_value_offered = -1;
3765 static int hf_enumprinterdata_data_offered = -1;
3766 static int hf_enumprinterdata_value_len = -1;
3767 static int hf_enumprinterdata_value_needed = -1;
3768 static int hf_enumprinterdata_data_needed = -1;
3770 static int SpoolssEnumPrinterData_q(tvbuff_t *tvb, int offset,
3771 packet_info *pinfo, proto_tree *tree,
3776 proto_tree_add_uint_hidden(
3777 tree, hf_printerdata, tvb, offset, 0, 1);
3781 offset = dissect_nt_policy_hnd(
3782 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
3785 offset = dissect_ndr_uint32(
3786 tvb, offset, pinfo, tree, drep,
3787 hf_enumprinterdata_enumindex, &ndx);
3789 if (check_col(pinfo->cinfo, COL_INFO))
3790 col_append_fstr(pinfo->cinfo, COL_INFO, ", index %d", ndx);
3792 offset = dissect_ndr_uint32(
3793 tvb, offset, pinfo, tree, drep,
3794 hf_enumprinterdata_value_offered, NULL);
3796 offset = dissect_ndr_uint32(
3797 tvb, offset, pinfo, tree, drep,
3798 hf_enumprinterdata_data_offered, NULL);
3803 static int SpoolssEnumPrinterData_r(tvbuff_t *tvb, int offset,
3804 packet_info *pinfo, proto_tree *tree,
3807 guint32 value_len, type;
3809 proto_item *value_item;
3810 proto_tree *value_subtree;
3812 proto_tree_add_uint_hidden(
3813 tree, hf_printerdata, tvb, offset, 0, 1);
3817 value_item = proto_tree_add_text(tree, tvb, offset, 0, "Value");
3819 value_subtree = proto_item_add_subtree(
3820 value_item, ett_printerdata_value);
3822 offset = dissect_ndr_uint32(
3823 tvb, offset, pinfo, value_subtree, drep,
3824 hf_enumprinterdata_value_len, &value_len);
3827 dissect_spoolss_uint16uni(
3828 tvb, offset, pinfo, value_subtree, drep, &value,
3831 offset += value_len * 2;
3833 if (check_col(pinfo->cinfo, COL_INFO) && value && value[0])
3834 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", value);
3836 proto_item_append_text(value_item, ": %s", value);
3838 proto_tree_add_string_hidden(
3839 tree, hf_printerdata_value, tvb, offset, 0, value);
3844 proto_item_set_len(value_item, value_len * 2 + 4);
3846 offset = dissect_ndr_uint32(
3847 tvb, offset, pinfo, value_subtree, drep,
3848 hf_enumprinterdata_value_needed, NULL);
3850 offset = dissect_ndr_uint32(
3851 tvb, offset, pinfo, tree, drep, hf_printerdata_type, &type);
3853 offset = dissect_printerdata_data(
3854 tvb, offset, pinfo, tree, drep, type);
3856 offset = dissect_ndr_uint32(
3857 tvb, offset, pinfo, tree, drep,
3858 hf_enumprinterdata_data_needed, NULL);
3860 offset = dissect_doserror(
3861 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
3867 * SpoolssEnumPrinters
3870 static gint ett_enumprinters_flags = -1;
3872 static int hf_enumprinters_flags = -1;
3873 static int hf_enumprinters_flags_local = -1;
3874 static int hf_enumprinters_flags_name = -1;
3875 static int hf_enumprinters_flags_shared = -1;
3876 static int hf_enumprinters_flags_default = -1;
3877 static int hf_enumprinters_flags_connections = -1;
3878 static int hf_enumprinters_flags_network = -1;
3879 static int hf_enumprinters_flags_remote = -1;
3881 static int SpoolssEnumPrinters_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
3882 proto_tree *tree, guint8 *drep _U_)
3884 guint32 level, flags;
3885 proto_tree *flags_subtree;
3886 proto_item *flags_item;
3890 offset = dissect_ndr_uint32(
3891 tvb, offset, pinfo, NULL, drep,
3892 hf_enumprinters_flags, &flags);
3894 flags_item = proto_tree_add_text(tree, tvb, offset - 4, 4,
3895 "Flags: 0x%08x", flags);
3897 flags_subtree = proto_item_add_subtree(
3898 flags_item, ett_enumprinters_flags);
3900 proto_tree_add_boolean(
3901 flags_subtree, hf_enumprinters_flags_network, tvb,
3902 offset - 4, 4, flags);
3904 proto_tree_add_boolean(
3905 flags_subtree, hf_enumprinters_flags_shared, tvb,
3906 offset - 4, 4, flags);
3908 proto_tree_add_boolean(
3909 flags_subtree, hf_enumprinters_flags_remote, tvb,
3910 offset - 4, 4, flags);
3912 proto_tree_add_boolean(
3913 flags_subtree, hf_enumprinters_flags_name, tvb,
3914 offset - 4, 4, flags);
3916 proto_tree_add_boolean(
3917 flags_subtree, hf_enumprinters_flags_connections, tvb,
3918 offset - 4, 4, flags);
3920 proto_tree_add_boolean(
3921 flags_subtree, hf_enumprinters_flags_local, tvb,
3922 offset - 4, 4, flags);
3924 proto_tree_add_boolean(
3925 flags_subtree, hf_enumprinters_flags_default, tvb,
3926 offset - 4, 4, flags);
3928 offset = dissect_ndr_str_pointer_item(
3929 tvb, offset, pinfo, tree, drep,
3930 NDR_POINTER_UNIQUE, "Server name", hf_servername, 0);
3932 offset = dissect_ndr_uint32(
3933 tvb, offset, pinfo, tree, drep, hf_level, &level);
3935 if (check_col(pinfo->cinfo, COL_INFO))
3936 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
3938 offset = dissect_spoolss_buffer(
3939 tvb, offset, pinfo, tree, drep, NULL);
3941 offset = dissect_ndr_uint32(
3942 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
3947 static int SpoolssEnumPrinters_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
3948 proto_tree *tree, guint8 *drep _U_)
3950 guint32 num_drivers;
3954 offset = dissect_spoolss_buffer(
3955 tvb, offset, pinfo, tree, drep, NULL);
3957 offset = dissect_ndr_uint32(
3958 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
3960 offset = dissect_ndr_uint32(
3961 tvb, offset, pinfo, tree, drep, hf_returned,
3964 offset = dissect_doserror(
3965 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
3974 static int SpoolssAddPrinterDriver_q(tvbuff_t *tvb, int offset,
3975 packet_info *pinfo, proto_tree *tree,
3978 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3979 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3983 offset = dissect_ndr_str_pointer_item(
3984 tvb, offset, pinfo, tree, drep, NDR_POINTER_UNIQUE,
3985 "Server", hf_servername, 0);
3987 offset = dissect_spoolss_DRIVER_INFO_CTR(
3988 tvb, offset, pinfo, tree, drep);
3993 static int SpoolssAddPrinterDriver_r(tvbuff_t *tvb, int offset,
3994 packet_info *pinfo, proto_tree *tree,
3999 offset = dissect_doserror(
4000 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4009 static gint ett_FORM_1 = -1;
4011 static int dissect_FORM_1(tvbuff_t *tvb, int offset, packet_info *pinfo,
4012 proto_tree *tree, guint8 *drep)
4015 proto_tree *subtree;
4018 item = proto_tree_add_text(tree, tvb, offset, 0, "Form level 1");
4020 subtree = proto_item_add_subtree(item, ett_FORM_1);
4022 offset = dissect_ndr_str_pointer_item(
4023 tvb, offset, pinfo, subtree, drep, NDR_POINTER_UNIQUE,
4024 "Name", hf_form_name, 0);
4026 /* Eek - we need to know whether this pointer was NULL or not.
4027 Currently there is not any way to do this. */
4029 if (tvb_length_remaining(tvb, offset) == 0)
4032 offset = dissect_ndr_uint32(
4033 tvb, offset, pinfo, subtree, drep, hf_form_flags, &flags);
4035 offset = dissect_ndr_uint32(
4036 tvb, offset, pinfo, subtree, drep,
4037 hf_form_unknown, NULL);
4039 offset = dissect_ndr_uint32(
4040 tvb, offset, pinfo, subtree, drep,
4041 hf_form_width, NULL);
4043 offset = dissect_ndr_uint32(
4044 tvb, offset, pinfo, subtree, drep,
4045 hf_form_height, NULL);
4047 offset = dissect_ndr_uint32(
4048 tvb, offset, pinfo, subtree, drep,
4049 hf_form_left_margin, NULL);
4051 offset = dissect_ndr_uint32(
4052 tvb, offset, pinfo, subtree, drep,
4053 hf_form_top_margin, NULL);
4055 offset = dissect_ndr_uint32(
4056 tvb, offset, pinfo, subtree, drep,
4057 hf_form_horiz_len, NULL);
4059 offset = dissect_ndr_uint32(
4060 tvb, offset, pinfo, subtree, drep,
4061 hf_form_vert_len, NULL);
4071 static gint ett_FORM_CTR = -1;
4073 static int dissect_FORM_CTR(tvbuff_t *tvb, int offset,
4074 packet_info *pinfo, proto_tree *tree,
4078 proto_tree *subtree;
4081 item = proto_tree_add_text(tree, tvb, offset, 0, "Form container");
4083 subtree = proto_item_add_subtree(item, ett_FORM_CTR);
4085 offset = dissect_ndr_uint32(
4086 tvb, offset, pinfo, subtree, drep, hf_form_level, &level);
4090 offset = dissect_FORM_1(tvb, offset, pinfo, subtree, drep);
4094 proto_tree_add_text(
4095 subtree, tvb, offset, 0,
4096 "[Unknown form info level %d]", level);
4107 static int SpoolssAddForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
4108 proto_tree *tree, guint8 *drep _U_)
4110 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4111 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
4114 proto_tree_add_uint_hidden(
4115 tree, hf_form, tvb, offset, 0, 1);
4119 offset = dissect_nt_policy_hnd(
4120 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
4123 offset = dissect_ndr_uint32(
4124 tvb, offset, pinfo, tree, drep, hf_form_level, &level);
4126 if (check_col(pinfo->cinfo, COL_INFO))
4127 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
4129 /* Store info level to match with reply packet */
4131 dcv->private_data = (void *)level;
4133 offset = dissect_FORM_CTR(tvb, offset, pinfo, tree, drep);
4138 static int SpoolssAddForm_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4139 proto_tree *tree, guint8 *drep _U_)
4141 proto_tree_add_uint_hidden(
4142 tree, hf_form, tvb, offset, 0, 1);
4146 offset = dissect_doserror(
4147 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4156 static int SpoolssDeleteForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
4157 proto_tree *tree, guint8 *drep _U_)
4161 proto_tree_add_uint_hidden(
4162 tree, hf_form, tvb, offset, 0, 1);
4166 offset = dissect_nt_policy_hnd(
4167 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
4170 offset = dissect_ndr_cvstring(
4171 tvb, offset, pinfo, tree, drep,
4172 sizeof(guint16), hf_form_name, TRUE, &name);
4174 if (check_col(pinfo->cinfo, COL_INFO) && name)
4175 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", name);
4182 static int SpoolssDeleteForm_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4183 proto_tree *tree, guint8 *drep _U_)
4185 proto_tree_add_uint_hidden(
4186 tree, hf_form, tvb, offset, 0, 1);
4190 offset = dissect_doserror(
4191 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4200 static int SpoolssSetForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
4201 proto_tree *tree, guint8 *drep _U_)
4206 proto_tree_add_uint_hidden(
4207 tree, hf_form, tvb, offset, 0, 1);
4211 offset = dissect_nt_policy_hnd(
4212 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
4215 offset = dissect_ndr_cvstring(
4216 tvb, offset, pinfo, tree, drep,
4217 sizeof(guint16), hf_form_name, TRUE, &name);
4219 if (check_col(pinfo->cinfo, COL_INFO) && name)
4220 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", name);
4224 offset = dissect_ndr_uint32(
4225 tvb, offset, pinfo, tree, drep, hf_form_level, &level);
4227 if (check_col(pinfo->cinfo, COL_INFO))
4228 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
4230 offset = dissect_FORM_CTR(tvb, offset, pinfo, tree, drep);
4235 static int SpoolssSetForm_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4236 proto_tree *tree, guint8 *drep _U_)
4238 proto_tree_add_uint_hidden(
4239 tree, hf_form, tvb, offset, 0, 1);
4243 offset = dissect_doserror(
4244 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4253 static int SpoolssGetForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
4254 proto_tree *tree, guint8 *drep _U_)
4256 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4257 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
4261 proto_tree_add_uint_hidden(
4262 tree, hf_form, tvb, offset, 0, 1);
4266 offset = dissect_nt_policy_hnd(
4267 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
4270 offset = dissect_ndr_cvstring(
4271 tvb, offset, pinfo, tree, drep,
4272 sizeof(guint16), hf_form_name, TRUE, &name);
4274 if (check_col(pinfo->cinfo, COL_INFO))
4275 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", name);
4277 offset = dissect_ndr_uint32(
4278 tvb, offset, pinfo, tree, drep, hf_form_level, &level);
4280 dcv->private_data = (void *)level;
4282 if (check_col(pinfo->cinfo, COL_INFO))
4283 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d",
4286 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL);
4288 offset = dissect_ndr_uint32(
4289 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
4294 static int SpoolssGetForm_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4295 proto_tree *tree, guint8 *drep _U_)
4297 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4298 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
4300 guint32 level = (guint32)dcv->private_data;
4302 proto_tree_add_uint_hidden(
4303 tree, hf_form, tvb, offset, 0, 1);
4307 offset = dissect_spoolss_buffer(
4308 tvb, offset, pinfo, tree, drep, &buffer);
4310 offset = dissect_ndr_uint32(
4311 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
4313 if (check_col(pinfo->cinfo, COL_INFO))
4314 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
4317 int buffer_offset = 0;
4321 int struct_start = buffer_offset;
4323 buffer_offset = dissect_FORM_REL(
4324 buffer.tvb, buffer_offset, pinfo, tree, drep,
4330 proto_tree_add_text(
4331 buffer.tree, buffer.tvb, buffer_offset, -1,
4332 "[Unknown form info level %d]", level);
4337 offset = dissect_doserror(
4338 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4343 /* A generic reply function that just parses the status code. Useful for
4344 unimplemented dissectors so the status code can be inserted into the
4347 static int SpoolssGeneric_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4348 proto_tree *tree, guint8 *drep _U_)
4350 int len = tvb_length(tvb);
4352 proto_tree_add_text(tree, tvb, offset, 0,
4353 "[Unimplemented dissector: SPOOLSS]");
4355 offset = dissect_doserror(
4356 tvb, len - 4, pinfo, tree, drep, hf_rc, NULL);
4365 static gint ett_JOB_INFO_1;
4368 dissect_spoolss_JOB_INFO_1(tvbuff_t *tvb, int offset, packet_info *pinfo,
4369 proto_tree *tree, guint8 *drep)
4372 proto_tree *subtree;
4373 int struct_start = offset;
4374 char *document_name;
4376 item = proto_tree_add_text(tree, tvb, offset, 0, "Job info level 1");
4378 subtree = proto_item_add_subtree(item, ett_JOB_INFO_1);
4380 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
4383 offset = dissect_spoolss_relstr(
4384 tvb, offset, pinfo, subtree, drep, hf_printername,
4385 struct_start, NULL);
4387 offset = dissect_spoolss_relstr(
4388 tvb, offset, pinfo, subtree, drep, hf_servername,
4389 struct_start, NULL);
4391 offset = dissect_spoolss_relstr(
4392 tvb, offset, pinfo, subtree, drep, hf_username,
4393 struct_start, NULL);
4395 offset = dissect_spoolss_relstr(
4396 tvb, offset, pinfo, subtree, drep, hf_documentname,
4397 struct_start, &document_name);
4399 proto_item_append_text(item, ": %s", document_name);
4400 g_free(document_name);
4402 offset = dissect_spoolss_relstr(
4403 tvb, offset, pinfo, subtree, drep, hf_datatype,
4404 struct_start, NULL);
4406 offset = dissect_spoolss_relstr(
4407 tvb, offset, pinfo, subtree, drep, hf_textstatus,
4408 struct_start, NULL);
4410 offset = dissect_job_status(tvb, offset, pinfo, subtree, drep);
4412 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
4413 hf_job_priority, NULL);
4415 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
4416 hf_job_position, NULL);
4418 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
4419 hf_job_totalpages, NULL);
4421 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
4422 hf_job_pagesprinted, NULL);
4424 offset = dissect_SYSTEM_TIME(
4425 tvb, offset, pinfo, subtree, drep, "Job Submission Time",
4428 proto_item_set_len(item, offset - struct_start);
4437 static gint ett_JOB_INFO_2;
4440 dissect_spoolss_JOB_INFO_2(tvbuff_t *tvb, int offset, packet_info *pinfo,
4441 proto_tree *tree, guint8 *drep)
4444 proto_tree *subtree;
4445 int struct_start = offset;
4446 char *document_name;
4447 guint32 devmode_offset, secdesc_offset;
4449 item = proto_tree_add_text(tree, tvb, offset, 0, "Job info level 2");
4451 subtree = proto_item_add_subtree(item, ett_JOB_INFO_2);
4453 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
4456 offset = dissect_spoolss_relstr(
4457 tvb, offset, pinfo, subtree, drep, hf_printername,
4458 struct_start, NULL);
4460 offset = dissect_spoolss_relstr(
4461 tvb, offset, pinfo, subtree, drep, hf_machinename,
4462 struct_start, NULL);
4464 offset = dissect_spoolss_relstr(
4465 tvb, offset, pinfo, subtree, drep, hf_username,
4466 struct_start, NULL);
4468 offset = dissect_spoolss_relstr(
4469 tvb, offset, pinfo, subtree, drep, hf_documentname,
4470 struct_start, &document_name);
4472 proto_item_append_text(item, ": %s", document_name);
4473 g_free(document_name);
4475 offset = dissect_spoolss_relstr(
4476 tvb, offset, pinfo, subtree, drep, hf_notifyname,
4477 struct_start, NULL);
4479 offset = dissect_spoolss_relstr(
4480 tvb, offset, pinfo, subtree, drep, hf_datatype,
4481 struct_start, NULL);
4483 offset = dissect_spoolss_relstr(
4484 tvb, offset, pinfo, subtree, drep, hf_printprocessor,
4485 struct_start, NULL);
4487 offset = dissect_spoolss_relstr(
4488 tvb, offset, pinfo, subtree, drep, hf_parameters,
4489 struct_start, NULL);
4491 offset = dissect_spoolss_relstr(
4492 tvb, offset, pinfo, subtree, drep, hf_drivername,
4493 struct_start, NULL);
4495 offset = dissect_ndr_uint32(
4496 tvb, offset, pinfo, NULL, drep, hf_offset,
4500 tvb, devmode_offset - 4 + struct_start, pinfo, subtree, drep);
4502 offset = dissect_spoolss_relstr(
4503 tvb, offset, pinfo, subtree, drep, hf_textstatus,
4504 struct_start, NULL);
4506 offset = dissect_ndr_uint32(
4507 tvb, offset, pinfo, NULL, drep, hf_offset,
4510 dissect_nt_sec_desc(
4511 tvb, secdesc_offset, pinfo, subtree, drep,
4512 tvb_length_remaining(tvb, secdesc_offset),
4513 &spoolss_job_access_mask_info);
4515 offset = dissect_job_status(tvb, offset, pinfo, subtree, drep);
4517 offset = dissect_ndr_uint32(
4518 tvb, offset, pinfo, subtree, drep, hf_job_priority, NULL);
4520 offset = dissect_ndr_uint32(
4521 tvb, offset, pinfo, subtree, drep, hf_job_position, NULL);
4523 offset = dissect_ndr_uint32(
4524 tvb, offset, pinfo, NULL, drep, hf_start_time, NULL);
4526 offset = dissect_ndr_uint32(
4527 tvb, offset, pinfo, NULL, drep, hf_end_time, NULL);
4529 offset = dissect_ndr_uint32(
4530 tvb, offset, pinfo, subtree, drep, hf_job_totalpages, NULL);
4532 offset = dissect_ndr_uint32(
4533 tvb, offset, pinfo, subtree, drep, hf_job_size, NULL);
4535 offset = dissect_SYSTEM_TIME(
4536 tvb, offset, pinfo, subtree, drep, "Job Submission Time",
4539 offset = dissect_ndr_uint32(
4540 tvb, offset, pinfo, NULL, drep, hf_elapsed_time, NULL);
4542 offset = dissect_ndr_uint32(
4543 tvb, offset, pinfo, subtree, drep, hf_job_pagesprinted, NULL);
4545 proto_item_set_len(item, offset - struct_start);
4554 static int hf_enumjobs_firstjob = -1;
4555 static int hf_enumjobs_numjobs = -1;
4557 static int SpoolssEnumJobs_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
4558 proto_tree *tree, guint8 *drep _U_)
4560 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4561 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
4566 offset = dissect_nt_policy_hnd(
4567 tvb, offset, pinfo, tree, drep,
4568 hf_hnd, NULL, NULL, FALSE, FALSE);
4570 offset = dissect_ndr_uint32(
4571 tvb, offset, pinfo, tree, drep, hf_enumjobs_firstjob, NULL);
4573 offset = dissect_ndr_uint32(
4574 tvb, offset, pinfo, tree, drep, hf_enumjobs_numjobs, NULL);
4576 offset = dissect_ndr_uint32(
4577 tvb, offset, pinfo, tree, drep, hf_level, &level);
4579 dcv->private_data = (void *)level;
4581 if (check_col(pinfo->cinfo, COL_INFO))
4582 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
4584 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL);
4586 offset = dissect_ndr_uint32(
4587 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
4592 static int SpoolssEnumJobs_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4593 proto_tree *tree, guint8 *drep _U_)
4595 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4596 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
4597 gint16 level = (guint32)dcv->private_data;
4599 guint32 num_jobs, i;
4604 offset = dissect_spoolss_buffer(
4605 tvb, offset, pinfo, tree, drep, &buffer);
4607 offset = dissect_ndr_uint32(
4608 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
4610 offset = dissect_ndr_uint32(
4611 tvb, offset, pinfo, tree, drep, hf_enumjobs_numjobs,
4616 for (i = 0; i < num_jobs; i++) {
4619 buffer_offset = dissect_spoolss_JOB_INFO_1(
4620 buffer.tvb, buffer_offset, pinfo,
4624 buffer_offset = dissect_spoolss_JOB_INFO_2(
4625 buffer.tvb, buffer_offset, pinfo,
4629 proto_tree_add_text(
4630 buffer.tree, buffer.tvb, 0, -1,
4631 "[Unknown job info level %d]", level);
4637 offset = dissect_doserror(
4638 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4647 static const value_string setjob_commands[] = {
4648 { JOB_CONTROL_PAUSE, "Pause" },
4649 { JOB_CONTROL_RESUME, "Resume" },
4650 { JOB_CONTROL_CANCEL, "Cancel" },
4651 { JOB_CONTROL_RESTART, "Restart" },
4652 { JOB_CONTROL_DELETE, "Delete" },
4656 static int hf_setjob_cmd = -1;
4658 static int SpoolssSetJob_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
4659 proto_tree *tree, guint8 *drep)
4665 offset = dissect_nt_policy_hnd(
4666 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
4669 offset = dissect_ndr_uint32(
4670 tvb, offset, pinfo, tree, drep, hf_job_id, &jobid);
4672 offset = dissect_ndr_uint32(
4673 tvb, offset, pinfo, tree, drep, hf_level, NULL);
4675 offset = dissect_ndr_uint32(
4676 tvb, offset, pinfo, tree, drep, hf_setjob_cmd, &cmd);
4678 if (check_col(pinfo->cinfo, COL_INFO))
4680 pinfo->cinfo, COL_INFO, ", %s jobid %d",
4681 val_to_str(cmd, setjob_commands, "Unknown (%d)"),
4687 static int SpoolssSetJob_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4688 proto_tree *tree, guint8 *drep)
4692 offset = dissect_doserror(
4693 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4702 static int SpoolssGetJob_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
4703 proto_tree *tree, guint8 *drep)
4705 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4706 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
4707 guint32 level, jobid;
4711 offset = dissect_nt_policy_hnd(
4712 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
4715 offset = dissect_ndr_uint32(
4716 tvb, offset, pinfo, tree, drep, hf_job_id, &jobid);
4718 offset = dissect_ndr_uint32(
4719 tvb, offset, pinfo, tree, drep, hf_level, &level);
4721 dcv->private_data = (void *)level;
4723 if (check_col(pinfo->cinfo, COL_INFO))
4724 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d, jobid %d",
4727 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL);
4729 offset = dissect_ndr_uint32(
4730 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
4735 static int SpoolssGetJob_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4736 proto_tree *tree, guint8 *drep)
4738 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4739 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
4740 gint32 level = (guint32)dcv->private_data;
4745 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep,
4749 int buffer_offset = 0;
4753 buffer_offset = dissect_spoolss_JOB_INFO_1(
4754 buffer.tvb, buffer_offset, pinfo,
4759 proto_tree_add_text(
4760 buffer.tree, buffer.tvb, buffer_offset, -1,
4761 "[Unknown job info level %d]", level);
4766 offset = dissect_ndr_uint32(
4767 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
4769 offset = dissect_doserror(
4770 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4779 static int SpoolssStartPagePrinter_q(tvbuff_t *tvb, int offset,
4780 packet_info *pinfo, proto_tree *tree,
4783 e_ctx_hnd policy_hnd;
4788 offset = dissect_nt_policy_hnd(
4789 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, NULL,
4792 dcerpc_smb_fetch_pol(&policy_hnd, &pol_name, NULL, NULL,
4795 if (check_col(pinfo->cinfo, COL_INFO) && pol_name)
4796 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
4802 static int SpoolssStartPagePrinter_r(tvbuff_t *tvb, int offset,
4803 packet_info *pinfo, proto_tree *tree,
4808 offset = dissect_doserror(
4809 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4818 static int SpoolssEndPagePrinter_q(tvbuff_t *tvb, int offset,
4819 packet_info *pinfo, proto_tree *tree,
4822 e_ctx_hnd policy_hnd;
4827 offset = dissect_nt_policy_hnd(
4828 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, NULL,
4831 dcerpc_smb_fetch_pol(&policy_hnd, &pol_name, NULL, NULL,
4834 if (check_col(pinfo->cinfo, COL_INFO) && pol_name)
4835 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
4841 static int SpoolssEndPagePrinter_r(tvbuff_t *tvb, int offset,
4842 packet_info *pinfo, proto_tree *tree,
4847 offset = dissect_doserror(
4848 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4857 static gint ett_DOC_INFO_1 = -1;
4860 dissect_spoolss_doc_info_1(tvbuff_t *tvb, int offset, packet_info *pinfo,
4861 proto_tree *tree, guint8 *drep)
4864 proto_tree *subtree;
4866 item = proto_tree_add_text(
4867 tree, tvb, offset, 0, "Document info level 1");
4869 subtree = proto_item_add_subtree(item, ett_DOC_INFO_1);
4871 offset = dissect_ndr_str_pointer_item(
4872 tvb, offset, pinfo, subtree, drep, NDR_POINTER_UNIQUE,
4873 "Document name", hf_documentname, 0);
4875 offset = dissect_ndr_str_pointer_item(
4876 tvb, offset, pinfo, subtree, drep, NDR_POINTER_UNIQUE,
4877 "Output file", hf_outputfile, 0);
4879 offset = dissect_ndr_str_pointer_item(
4880 tvb, offset, pinfo, subtree, drep, NDR_POINTER_UNIQUE,
4881 "Data type", hf_datatype, 0);
4887 dissect_spoolss_doc_info_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
4888 proto_tree *tree, guint8 *drep)
4890 dcerpc_info *di = pinfo->private_data;
4891 guint32 info_level = 1; /* XXX */
4893 if (di->conformant_run)
4896 switch(info_level) {
4898 offset = dissect_spoolss_doc_info_1(
4899 tvb, offset, pinfo, tree, drep);
4902 proto_tree_add_text(
4903 tree, tvb, offset, 0,
4904 "[Unknown documentinfo level %d]", info_level);
4915 static gint ett_DOC_INFO = -1;
4918 dissect_spoolss_doc_info(tvbuff_t *tvb, int offset, packet_info *pinfo,
4919 proto_tree *tree, guint8 *drep)
4922 proto_tree *subtree;
4925 item = proto_tree_add_text(
4926 tree, tvb, offset, 0, "Document info");
4928 subtree = proto_item_add_subtree(item, ett_DOC_INFO);
4930 offset = dissect_ndr_uint32(
4931 tvb, offset, pinfo, subtree, drep, hf_level, &level);
4933 offset = dissect_ndr_pointer(
4934 tvb, offset, pinfo, subtree, drep,
4935 dissect_spoolss_doc_info_data,
4936 NDR_POINTER_UNIQUE, "Document info", -1);
4945 static gint ett_DOC_INFO_CTR = -1;
4948 dissect_spoolss_doc_info_ctr(tvbuff_t *tvb, int offset, packet_info *pinfo,
4949 proto_tree *tree, guint8 *drep)
4952 proto_tree *subtree;
4954 item = proto_tree_add_text(
4955 tree, tvb, offset, 0, "Document info container");
4957 subtree = proto_item_add_subtree(item, ett_DOC_INFO_CTR);
4959 offset = dissect_ndr_uint32(
4960 tvb, offset, pinfo, subtree, drep, hf_level, NULL);
4962 offset = dissect_spoolss_doc_info(
4963 tvb, offset, pinfo, subtree, drep);
4972 static int SpoolssStartDocPrinter_q(tvbuff_t *tvb, int offset,
4973 packet_info *pinfo, proto_tree *tree,
4976 e_ctx_hnd policy_hnd;
4981 offset = dissect_nt_policy_hnd(
4982 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, NULL,
4985 dcerpc_smb_fetch_pol(&policy_hnd, &pol_name, NULL, NULL,
4988 if (check_col(pinfo->cinfo, COL_INFO) && pol_name)
4989 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
4992 offset = dissect_spoolss_doc_info_ctr(tvb, offset, pinfo, tree, drep);
4997 static int SpoolssStartDocPrinter_r(tvbuff_t *tvb, int offset,
4998 packet_info *pinfo, proto_tree *tree,
5003 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5006 offset = dissect_doserror(
5007 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
5016 static int SpoolssEndDocPrinter_q(tvbuff_t *tvb, int offset,
5017 packet_info *pinfo, proto_tree *tree,
5020 e_ctx_hnd policy_hnd;
5025 offset = dissect_nt_policy_hnd(
5026 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, NULL,
5029 dcerpc_smb_fetch_pol(&policy_hnd, &pol_name, NULL, NULL,
5032 if (check_col(pinfo->cinfo, COL_INFO) && pol_name)
5033 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
5040 static int SpoolssEndDocPrinter_r(tvbuff_t *tvb, int offset,
5041 packet_info *pinfo, proto_tree *tree,
5046 offset = dissect_doserror(
5047 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
5056 static gint ett_writeprinter_buffer = -1;
5058 static int hf_writeprinter_numwritten = -1;
5060 static int SpoolssWritePrinter_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
5061 proto_tree *tree, guint8 *drep)
5063 e_ctx_hnd policy_hnd;
5067 proto_tree *subtree;
5071 offset = dissect_nt_policy_hnd(
5072 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, NULL,
5075 dcerpc_smb_fetch_pol(&policy_hnd, &pol_name, NULL, NULL,
5078 if (check_col(pinfo->cinfo, COL_INFO) && pol_name)
5079 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
5082 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5083 hf_buffer_size, &size);
5085 if (check_col(pinfo->cinfo, COL_INFO))
5086 col_append_fstr(pinfo->cinfo, COL_INFO, ", %d bytes", size);
5088 item = proto_tree_add_text(tree, tvb, offset, 0, "Buffer");
5090 subtree = proto_item_add_subtree(item, ett_writeprinter_buffer);
5092 offset = dissect_ndr_uint8s(tvb, offset, pinfo, subtree, drep,
5093 hf_buffer_data, size, NULL);
5095 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
5096 hf_buffer_size, NULL);
5098 proto_item_set_len(item, size + 4);
5103 static int SpoolssWritePrinter_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
5104 proto_tree *tree, guint8 *drep)
5110 offset = dissect_ndr_uint32(
5111 tvb, offset, pinfo, tree, drep, hf_writeprinter_numwritten,
5114 if (check_col(pinfo->cinfo, COL_INFO))
5116 pinfo->cinfo, COL_INFO, ", %d bytes written", size);
5118 offset = dissect_doserror(
5119 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
5128 static int SpoolssDeletePrinterData_q(tvbuff_t *tvb, int offset,
5129 packet_info *pinfo, proto_tree *tree,
5134 proto_tree_add_uint_hidden(
5135 tree, hf_printerdata, tvb, offset, 0, 1);
5139 offset = dissect_nt_policy_hnd(
5140 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
5143 offset = dissect_ndr_cvstring(
5144 tvb, offset, pinfo, tree, drep, sizeof(guint16),
5145 hf_printerdata_value, TRUE, &value_name);
5147 if (check_col(pinfo->cinfo, COL_INFO))
5148 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", value_name);
5155 static int SpoolssDeletePrinterData_r(tvbuff_t *tvb, int offset,
5156 packet_info *pinfo, proto_tree *tree,
5159 proto_tree_add_uint_hidden(
5160 tree, hf_printerdata, tvb, offset, 0, 1);
5164 offset = dissect_doserror(
5165 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
5175 static gint ett_DRIVER_INFO_1 = -1;
5177 static int dissect_DRIVER_INFO_1(tvbuff_t *tvb, int offset,
5178 packet_info *pinfo, proto_tree *tree,
5182 proto_tree *subtree;
5183 int struct_start = offset;
5185 item = proto_tree_add_text(
5186 tree, tvb, offset, 0, "Driver info level 1");
5188 subtree = proto_item_add_subtree(item, ett_DRIVER_INFO_1);
5190 offset = dissect_spoolss_relstr(
5191 tvb, offset, pinfo, subtree, drep, hf_drivername,
5192 struct_start, NULL);
5201 static const value_string driverinfo_cversion_vals[] =
5203 { 0, "Windows 95/98/Me" },
5204 { 2, "Windows NT 4.0" },
5205 { 3, "Windows 2000/XP" },
5209 static gint ett_DRIVER_INFO_3 = -1;
5211 static int dissect_DRIVER_INFO_3(tvbuff_t *tvb, int offset,
5212 packet_info *pinfo, proto_tree *tree,
5216 proto_tree *subtree;
5217 int struct_start = offset;
5219 item = proto_tree_add_text(
5220 tree, tvb, offset, 0, "Driver info level 3");
5222 subtree = proto_item_add_subtree(item, ett_DRIVER_INFO_3);
5224 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
5225 hf_driverinfo_cversion, NULL);
5227 offset = dissect_spoolss_relstr(
5228 tvb, offset, pinfo, subtree, drep, hf_drivername,
5229 struct_start, NULL);
5231 offset = dissect_spoolss_relstr(
5232 tvb, offset, pinfo, subtree, drep, hf_architecture,
5233 struct_start, NULL);
5235 offset = dissect_spoolss_relstr(
5236 tvb, offset, pinfo, subtree, drep, hf_driverpath,
5237 struct_start, NULL);
5239 offset = dissect_spoolss_relstr(
5240 tvb, offset, pinfo, subtree, drep, hf_datafile,
5241 struct_start, NULL);
5243 offset = dissect_spoolss_relstr(
5244 tvb, offset, pinfo, subtree, drep, hf_configfile,
5245 struct_start, NULL);
5247 offset = dissect_spoolss_relstr(
5248 tvb, offset, pinfo, subtree, drep, hf_helpfile,
5249 struct_start, NULL);
5251 offset = dissect_spoolss_relstrarray(
5252 tvb, offset, pinfo, subtree, drep, hf_dependentfiles,
5253 struct_start, NULL);
5255 offset = dissect_spoolss_relstr(
5256 tvb, offset, pinfo, subtree, drep, hf_monitorname,
5257 struct_start, NULL);
5259 offset = dissect_spoolss_relstr(
5260 tvb, offset, pinfo, subtree, drep, hf_defaultdatatype,
5261 struct_start, NULL);
5267 * EnumPrinterDrivers
5270 static int SpoolssEnumPrinterDrivers_q(tvbuff_t *tvb, int offset,
5271 packet_info *pinfo, proto_tree *tree,
5274 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5275 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
5280 offset = dissect_ndr_str_pointer_item(
5281 tvb, offset, pinfo, tree, drep, NDR_POINTER_UNIQUE,
5282 "Name", hf_servername, 0);
5284 offset = dissect_ndr_str_pointer_item(
5285 tvb, offset, pinfo, tree, drep, NDR_POINTER_UNIQUE,
5286 "Environment", hf_servername, 0);
5288 offset = dissect_ndr_uint32(
5289 tvb, offset, pinfo, tree, drep, hf_level, &level);
5291 dcv->private_data = (void *)level;
5293 if (check_col(pinfo->cinfo, COL_INFO))
5294 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
5296 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL);
5298 offset = dissect_ndr_uint32(
5299 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
5304 static int SpoolssEnumPrinterDrivers_r(tvbuff_t *tvb, int offset,
5305 packet_info *pinfo, proto_tree *tree,
5308 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5309 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
5310 guint32 level = (guint32)dcv->private_data, num_drivers, i;
5316 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep,
5319 offset = dissect_ndr_uint32(
5320 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
5322 offset = dissect_ndr_uint32(
5323 tvb, offset, pinfo, tree, drep, hf_returned,
5328 for (i = 0; i < num_drivers; i++) {
5331 buffer_offset = dissect_DRIVER_INFO_1(
5332 buffer.tvb, buffer_offset, pinfo,
5336 buffer_offset = dissect_DRIVER_INFO_3(
5337 buffer.tvb, buffer_offset, pinfo,
5341 proto_tree_add_text(
5342 buffer.tree, buffer.tvb, buffer_offset, -1,
5343 "[Unknown driver info level %d]", level);
5349 offset = dissect_doserror(
5350 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
5359 static int SpoolssGetPrinterDriver2_q(tvbuff_t *tvb, int offset,
5360 packet_info *pinfo, proto_tree *tree,
5363 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5364 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
5365 e_ctx_hnd policy_hnd;
5371 offset = dissect_nt_policy_hnd(
5372 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, NULL,
5375 dcerpc_smb_fetch_pol(&policy_hnd, &pol_name, NULL, NULL,
5378 if (check_col(pinfo->cinfo, COL_INFO) && pol_name)
5379 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
5382 offset = dissect_ndr_str_pointer_item(
5383 tvb, offset, pinfo, tree, drep, NDR_POINTER_UNIQUE,
5384 "Architecture", hf_architecture, 0);
5386 offset = dissect_ndr_uint32(
5387 tvb, offset, pinfo, tree, drep, hf_level, &level);
5389 dcv->private_data = (void *)level;
5391 if (check_col(pinfo->cinfo, COL_INFO))
5392 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
5394 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL);
5396 offset = dissect_ndr_uint32(
5397 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
5399 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5400 hf_clientmajorversion, NULL);
5402 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5403 hf_clientminorversion, NULL);
5408 static int SpoolssGetPrinterDriver2_r(tvbuff_t *tvb, int offset,
5409 packet_info *pinfo, proto_tree *tree,
5412 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5413 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
5414 guint32 level = (guint32)dcv->private_data;
5419 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep,
5425 dissect_DRIVER_INFO_1(
5426 buffer.tvb, 0, pinfo, buffer.tree, drep);
5429 dissect_DRIVER_INFO_3(
5430 buffer.tvb, 0, pinfo, buffer.tree, drep);
5433 proto_tree_add_text(
5434 buffer.tree, buffer.tvb, 0, -1,
5435 "[Unknown driver info level %d]", level);
5440 offset = dissect_ndr_uint32(
5441 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
5443 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5444 hf_servermajorversion, NULL);
5446 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5447 hf_serverminorversion, NULL);
5449 offset = dissect_doserror(
5450 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
5456 dissect_notify_info_data_buffer(tvbuff_t *tvb, int offset, packet_info *pinfo,
5457 proto_tree *tree, guint8 *drep)
5461 offset = dissect_ndr_uint32(
5462 tvb, offset, pinfo, tree, drep,
5463 hf_notify_info_data_buffer_len, &len);
5465 offset = dissect_ndr_uint16s(
5466 tvb, offset, pinfo, tree, drep,
5467 hf_notify_info_data_buffer_data, len);
5472 static void cb_notify_str_postprocess(packet_info *pinfo _U_,
5473 proto_tree *tree _U_,
5474 proto_item *item, tvbuff_t *tvb,
5475 int start_offset, int end_offset,
5476 void *callback_args)
5478 gint levels, hf_index = GPOINTER_TO_INT(callback_args);
5482 /* Align start_offset on 4-byte boundary. */
5484 if (start_offset % 4)
5485 start_offset += 4 - (start_offset % 4);
5487 /* Get string length */
5489 len = tvb_get_letohl(tvb, start_offset);
5491 s = tvb_fake_unicode(
5492 tvb, start_offset + 4, (end_offset - start_offset - 4) / 2, TRUE);
5494 /* Append string to upper-level proto_items */
5498 if (levels > 0 && item && s && s[0]) {
5499 proto_item_append_text(item, ": %s", s);
5500 item = item->parent;
5503 proto_item_append_text(item, ": %s", s);
5504 item = item->parent;
5506 while (levels > 0) {
5507 proto_item_append_text(item, " %s", s);
5508 item = item->parent;
5514 /* Add hidden field so filter brings up any notify data */
5517 proto_tree_add_string_hidden(
5518 tree, hf_index, tvb, start_offset, len, s);
5523 /* Return the hf_index for a printer notify field. This is used to
5524 add a hidden string to the display so that filtering will bring
5525 up relevant notify data. */
5528 printer_notify_hf_index(int field)
5533 case PRINTER_NOTIFY_SERVER_NAME:
5534 result = hf_servername;
5536 case PRINTER_NOTIFY_PRINTER_NAME:
5537 result = hf_printername;
5539 case PRINTER_NOTIFY_SHARE_NAME:
5540 result = hf_sharename;
5542 case PRINTER_NOTIFY_PORT_NAME:
5543 result = hf_portname;
5545 case PRINTER_NOTIFY_DRIVER_NAME:
5546 result = hf_drivername;
5548 case PRINTER_NOTIFY_COMMENT:
5549 result = hf_printercomment;
5551 case PRINTER_NOTIFY_LOCATION:
5552 result = hf_printerlocation;
5554 case PRINTER_NOTIFY_SEPFILE:
5555 result = hf_sepfile;
5557 case PRINTER_NOTIFY_PRINT_PROCESSOR:
5558 result = hf_printprocessor;
5560 case PRINTER_NOTIFY_PARAMETERS:
5561 result = hf_parameters;
5563 case PRINTER_NOTIFY_DATATYPE:
5564 result = hf_parameters;
5572 job_notify_hf_index(int field)
5577 case JOB_NOTIFY_PRINTER_NAME:
5578 result = hf_printername;
5580 case JOB_NOTIFY_MACHINE_NAME:
5581 result = hf_machinename;
5583 case JOB_NOTIFY_PORT_NAME:
5584 result = hf_portname;
5586 case JOB_NOTIFY_USER_NAME:
5587 result = hf_username;
5589 case JOB_NOTIFY_NOTIFY_NAME:
5590 result = hf_notifyname;
5592 case JOB_NOTIFY_DATATYPE:
5593 result = hf_datatype;
5595 case JOB_NOTIFY_PRINT_PROCESSOR:
5596 result = hf_printprocessor;
5598 case JOB_NOTIFY_DRIVER_NAME:
5599 result = hf_drivername;
5601 case JOB_NOTIFY_DOCUMENT:
5602 result = hf_documentname;
5604 case JOB_NOTIFY_PRIORITY:
5605 result = hf_job_priority;
5607 case JOB_NOTIFY_POSITION:
5608 result = hf_job_position;
5610 case JOB_NOTIFY_TOTAL_PAGES:
5611 result = hf_job_totalpages;
5613 case JOB_NOTIFY_PAGES_PRINTED:
5614 result = hf_job_pagesprinted;
5616 case JOB_NOTIFY_TOTAL_BYTES:
5617 result = hf_job_totalbytes;
5619 case JOB_NOTIFY_BYTES_PRINTED:
5620 result = hf_job_bytesprinted;
5628 dissect_NOTIFY_INFO_DATA_printer(tvbuff_t *tvb, int offset, packet_info *pinfo,
5629 proto_tree *tree, proto_item *item,
5630 guint8 *drep, guint16 field)
5636 /* String notify data */
5638 case PRINTER_NOTIFY_SERVER_NAME:
5639 case PRINTER_NOTIFY_PRINTER_NAME:
5640 case PRINTER_NOTIFY_SHARE_NAME:
5641 case PRINTER_NOTIFY_DRIVER_NAME:
5642 case PRINTER_NOTIFY_COMMENT:
5643 case PRINTER_NOTIFY_LOCATION:
5644 case PRINTER_NOTIFY_SEPFILE:
5645 case PRINTER_NOTIFY_PRINT_PROCESSOR:
5646 case PRINTER_NOTIFY_PARAMETERS:
5647 case PRINTER_NOTIFY_DATATYPE:
5648 case PRINTER_NOTIFY_PORT_NAME:
5650 offset = dissect_ndr_uint32(
5651 tvb, offset, pinfo, tree, drep,
5652 hf_notify_info_data_bufsize, &value1);
5654 offset = dissect_ndr_pointer_cb(
5655 tvb, offset, pinfo, tree, drep,
5656 dissect_notify_info_data_buffer,
5657 NDR_POINTER_UNIQUE, "String",
5658 hf_notify_info_data_buffer,
5659 cb_notify_str_postprocess,
5660 GINT_TO_POINTER(printer_notify_hf_index(field)));
5664 case PRINTER_NOTIFY_ATTRIBUTES:
5666 /* Value 1 is the printer attributes */
5668 offset = dissect_printer_attributes(
5669 tvb, offset, pinfo, tree, drep);
5671 offset = dissect_ndr_uint32(
5672 tvb, offset, pinfo, NULL, drep,
5673 hf_notify_info_data_value2, NULL);
5677 case PRINTER_NOTIFY_STATUS: {
5680 /* Value 1 is the printer status */
5682 offset = dissect_ndr_uint32(
5683 tvb, offset, pinfo, tree, drep,
5684 hf_printer_status, &status);
5686 offset = dissect_ndr_uint32(
5687 tvb, offset, pinfo, NULL, drep,
5688 hf_notify_info_data_value2, NULL);
5690 proto_item_append_text(
5692 val_to_str(status, printer_status_vals, "Unknown"));
5697 /* Unknown notify data */
5699 case PRINTER_NOTIFY_SECURITY_DESCRIPTOR: /* Secdesc */
5700 case PRINTER_NOTIFY_DEVMODE: /* Devicemode */
5702 offset = dissect_ndr_uint32(
5703 tvb, offset, pinfo, tree, drep,
5704 hf_notify_info_data_bufsize, &value1);
5706 offset = dissect_ndr_pointer(
5707 tvb, offset, pinfo, tree, drep,
5708 dissect_notify_info_data_buffer,
5709 NDR_POINTER_UNIQUE, "Buffer",
5710 hf_notify_info_data_buffer);
5715 offset = dissect_ndr_uint32(
5716 tvb, offset, pinfo, tree, drep,
5717 hf_notify_info_data_value1, NULL);
5719 offset = dissect_ndr_uint32(
5720 tvb, offset, pinfo, tree, drep,
5721 hf_notify_info_data_value2, NULL);
5728 static void notify_job_time_cb(packet_info *pinfo, proto_tree *tree _U_,
5729 proto_item *item, tvbuff_t *tvb _U_,
5730 int start_offset _U_, int end_offset _U_,
5731 void *callback_args _U_)
5733 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5734 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
5735 char *str = (char *)dcv->private_data;
5737 /* Append job string stored in dcv->private_data by
5738 dissect_SYSTEM_TIME_ptr() in the current item as well
5741 proto_item_append_text(item, ": %s", str);
5744 proto_item_append_text(item->parent, ": %s", str);
5748 dissect_NOTIFY_INFO_DATA_job(tvbuff_t *tvb, int offset, packet_info *pinfo,
5749 proto_tree *tree, proto_item *item, guint8 *drep,
5756 /* String notify data */
5758 case JOB_NOTIFY_PRINTER_NAME:
5759 case JOB_NOTIFY_MACHINE_NAME:
5760 case JOB_NOTIFY_PORT_NAME:
5761 case JOB_NOTIFY_USER_NAME:
5762 case JOB_NOTIFY_NOTIFY_NAME:
5763 case JOB_NOTIFY_DATATYPE:
5764 case JOB_NOTIFY_PRINT_PROCESSOR:
5765 case JOB_NOTIFY_PARAMETERS:
5766 case JOB_NOTIFY_DRIVER_NAME:
5767 case JOB_NOTIFY_STATUS_STRING:
5768 case JOB_NOTIFY_DOCUMENT:
5770 offset = dissect_ndr_uint32(
5771 tvb, offset, pinfo, tree, drep,
5772 hf_notify_info_data_bufsize, &value1);
5774 offset = dissect_ndr_pointer_cb(
5775 tvb, offset, pinfo, tree, drep,
5776 dissect_notify_info_data_buffer,
5777 NDR_POINTER_UNIQUE, "String",
5778 hf_notify_info_data_buffer,
5779 cb_notify_str_postprocess,
5780 GINT_TO_POINTER(job_notify_hf_index(field)));
5784 case JOB_NOTIFY_STATUS:
5785 offset = dissect_job_status(
5786 tvb, offset, pinfo, tree, drep);
5788 offset = dissect_ndr_uint32(
5789 tvb, offset, pinfo, NULL, drep,
5790 hf_notify_info_data_value2, NULL);
5794 case JOB_NOTIFY_SUBMITTED:
5798 offset = dissect_ndr_uint32(
5799 tvb, offset, pinfo, tree, drep,
5800 hf_notify_info_data_buffer_len, NULL);
5802 offset = dissect_ndr_pointer_cb(
5803 tvb, offset, pinfo, tree, drep,
5804 dissect_SYSTEM_TIME_ptr, NDR_POINTER_UNIQUE,
5805 "Time submitted", -1, notify_job_time_cb, NULL);
5809 case JOB_NOTIFY_PRIORITY:
5810 case JOB_NOTIFY_POSITION:
5811 case JOB_NOTIFY_TOTAL_PAGES:
5812 case JOB_NOTIFY_PAGES_PRINTED:
5813 case JOB_NOTIFY_TOTAL_BYTES:
5814 case JOB_NOTIFY_BYTES_PRINTED: {
5817 offset = dissect_ndr_uint32(
5818 tvb, offset, pinfo, tree, drep,
5819 hf_notify_info_data_value1, &value);
5821 offset = dissect_ndr_uint32(
5822 tvb, offset, pinfo, tree, drep,
5823 hf_notify_info_data_value2, NULL);
5825 proto_item_append_text(item, ": %d", value);
5827 proto_tree_add_uint_hidden(
5828 tree, job_notify_hf_index(field), tvb,
5834 /* Unknown notify data */
5836 case JOB_NOTIFY_DEVMODE:
5838 offset = dissect_ndr_uint32(
5839 tvb, offset, pinfo, tree, drep,
5840 hf_notify_info_data_bufsize, &value1);
5842 offset = dissect_ndr_pointer(
5843 tvb, offset, pinfo, tree, drep,
5844 dissect_notify_info_data_buffer,
5845 NDR_POINTER_UNIQUE, "Buffer",
5846 hf_notify_info_data_buffer);
5851 offset = dissect_ndr_uint32(
5852 tvb, offset, pinfo, tree, drep,
5853 hf_notify_info_data_value1, NULL);
5855 offset = dissect_ndr_uint32(
5856 tvb, offset, pinfo, tree, drep,
5857 hf_notify_info_data_value2, NULL);
5862 static gint ett_NOTIFY_INFO_DATA;
5865 dissect_NOTIFY_INFO_DATA(tvbuff_t *tvb, int offset, packet_info *pinfo,
5866 proto_tree *tree, guint8 *drep)
5869 proto_tree *subtree;
5871 guint16 type, field;
5874 item = proto_tree_add_text(tree, tvb, offset, 0, "%s", "");
5876 subtree = proto_item_add_subtree(item, ett_NOTIFY_INFO_DATA);
5878 offset = dissect_ndr_uint16(
5879 tvb, offset, pinfo, subtree, drep,
5880 hf_notify_info_data_type, &type);
5882 offset = dissect_notify_field(
5883 tvb, offset, pinfo, subtree, drep, type, &field);
5886 case PRINTER_NOTIFY_TYPE:
5887 field_string = val_to_str(
5888 field, printer_notify_option_data_vals,
5891 case JOB_NOTIFY_TYPE:
5892 field_string = val_to_str(
5893 field, job_notify_option_data_vals,
5897 field_string = "Unknown field";
5901 proto_item_append_text(
5903 val_to_str(type, printer_notify_types, "Unknown (%d)"),
5906 offset = dissect_ndr_uint32(
5907 tvb, offset, pinfo, subtree, drep,
5908 hf_notify_info_data_count, &count);
5910 offset = dissect_ndr_uint32(
5911 tvb, offset, pinfo, subtree, drep,
5912 hf_notify_info_data_id, NULL);
5914 offset = dissect_ndr_uint32(
5915 tvb, offset, pinfo, subtree, drep,
5916 hf_notify_info_data_count, NULL);
5918 /* The value here depends on (type, field) */
5921 case PRINTER_NOTIFY_TYPE:
5922 offset = dissect_NOTIFY_INFO_DATA_printer(
5923 tvb, offset, pinfo, subtree, item, drep, field);
5925 case JOB_NOTIFY_TYPE:
5926 offset = dissect_NOTIFY_INFO_DATA_job(
5927 tvb, offset, pinfo, subtree, item, drep, field);
5930 proto_tree_add_text(
5931 tree, tvb, offset, 0,
5932 "[Unknown notify type %d]", type);
5940 dissect_NOTIFY_INFO(tvbuff_t *tvb, int offset, packet_info *pinfo,
5941 proto_tree *tree, guint8 *drep)
5943 dcerpc_info *di = pinfo->private_data;
5946 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5947 hf_notify_info_version, NULL);
5949 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5950 hf_notify_info_flags, NULL);
5952 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5953 hf_notify_info_count, &count);
5955 if (!di->conformant_run && check_col(pinfo->cinfo, COL_INFO))
5957 pinfo->cinfo, COL_INFO, ", %d %s", count,
5958 notify_plural(count));
5960 offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
5961 dissect_NOTIFY_INFO_DATA);
5970 static int SpoolssRFNPCNEX_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
5971 proto_tree *tree, guint8 *drep)
5977 offset = dissect_nt_policy_hnd(
5978 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
5981 offset = dissect_ndr_uint32(
5982 tvb, offset, pinfo, tree, drep, hf_rrpcn_changelow, &changeid);
5984 if (check_col(pinfo->cinfo, COL_INFO))
5986 pinfo->cinfo, COL_INFO, ", changeid %d", changeid);
5988 offset = dissect_ndr_pointer(
5989 tvb, offset, pinfo, tree, drep,
5990 dissect_NOTIFY_OPTIONS_ARRAY_CTR, NDR_POINTER_UNIQUE,
5991 "Notify Options Array Container", -1);
5996 static int SpoolssRFNPCNEX_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
5997 proto_tree *tree, guint8 *drep)
6001 offset = dissect_ndr_pointer(
6002 tvb, offset, pinfo, tree, drep,
6003 dissect_NOTIFY_INFO, NDR_POINTER_UNIQUE,
6006 offset = dissect_doserror(
6007 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6016 static int SpoolssRRPCN_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
6017 proto_tree *tree, guint8 *drep)
6023 offset = dissect_nt_policy_hnd(
6024 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6027 offset = dissect_ndr_uint32(
6028 tvb, offset, pinfo, tree, drep, hf_rrpcn_changelow, &changeid);
6030 if (check_col(pinfo->cinfo, COL_INFO))
6032 pinfo->cinfo, COL_INFO, ", changeid %d", changeid);
6034 offset = dissect_ndr_uint32(
6035 tvb, offset, pinfo, tree, drep, hf_rrpcn_changehigh, NULL);
6037 offset = dissect_ndr_uint32(
6038 tvb, offset, pinfo, tree, drep, hf_rrpcn_unk0, NULL);
6040 offset = dissect_ndr_uint32(
6041 tvb, offset, pinfo, tree, drep, hf_rrpcn_unk1, NULL);
6043 offset = dissect_ndr_pointer(
6044 tvb, offset, pinfo, tree, drep,
6045 dissect_NOTIFY_INFO, NDR_POINTER_UNIQUE,
6053 static int SpoolssRRPCN_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
6054 proto_tree *tree, guint8 *drep)
6058 offset = dissect_ndr_uint32(
6059 tvb, offset, pinfo, tree, drep, hf_rrpcn_unk0, NULL);
6061 offset = dissect_doserror(
6062 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6071 static int SpoolssReplyClosePrinter_q(tvbuff_t *tvb, int offset,
6072 packet_info *pinfo, proto_tree *tree,
6077 offset = dissect_nt_policy_hnd(
6078 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6084 static int SpoolssReplyClosePrinter_r(tvbuff_t *tvb, int offset,
6085 packet_info *pinfo, proto_tree *tree,
6090 offset = dissect_nt_policy_hnd(
6091 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6094 offset = dissect_doserror(
6095 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6104 static int SpoolssFCPN_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
6105 proto_tree *tree, guint8 *drep)
6109 offset = dissect_nt_policy_hnd(
6110 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6116 static int SpoolssFCPN_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
6117 proto_tree *tree, guint8 *drep)
6121 offset = dissect_doserror(
6122 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6128 * RouterReplyPrinter
6131 static int hf_routerreplyprinter_condition = -1;
6132 static int hf_routerreplyprinter_unknown1 = -1;
6133 static int hf_routerreplyprinter_changeid = -1;
6135 static int SpoolssRouterReplyPrinter_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
6136 proto_tree *tree, guint8 *drep)
6140 offset = dissect_nt_policy_hnd(
6141 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6144 offset = dissect_ndr_uint32(
6145 tvb, offset, pinfo, tree, drep,
6146 hf_routerreplyprinter_condition, NULL);
6148 offset = dissect_ndr_uint32(
6149 tvb, offset, pinfo, tree, drep,
6150 hf_routerreplyprinter_unknown1, NULL);
6152 offset = dissect_ndr_uint32(
6153 tvb, offset, pinfo, tree, drep,
6154 hf_routerreplyprinter_changeid, NULL);
6159 static int SpoolssRouterReplyPrinter_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
6160 proto_tree *tree, guint8 *drep)
6164 offset = dissect_doserror(
6165 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6170 static int hf_keybuffer_size = -1;
6171 static int hf_keybuffer_data = -1;
6174 dissect_spoolss_keybuffer(tvbuff_t *tvb, int offset, packet_info *pinfo,
6175 proto_tree *tree, guint8 *drep)
6177 dcerpc_info *di = pinfo->private_data;
6181 if (di->conformant_run)
6184 /* Dissect size and data */
6186 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6187 hf_keybuffer_size, &size);
6189 end_offset = offset + (size*2);
6190 if (end_offset < offset) {
6192 * Overflow - make the end offset one past the end of
6193 * the packet data, so we throw an exception (as the
6194 * size is almost certainly too big).
6196 end_offset = tvb_reported_length_remaining(tvb, offset) + 1;
6199 while (offset < end_offset)
6200 offset = dissect_spoolss_uint16uni(
6201 tvb, offset, pinfo, tree, drep, NULL, "Key");
6207 static int SpoolssEnumPrinterKey_q(tvbuff_t *tvb, int offset,
6208 packet_info *pinfo, proto_tree *tree,
6215 offset = dissect_nt_policy_hnd(
6216 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6219 offset = dissect_ndr_cvstring(
6220 tvb, offset, pinfo, tree, drep, sizeof(guint16),
6221 hf_printerdata_key, TRUE, &key_name);
6223 if (check_col(pinfo->cinfo, COL_INFO)) {
6224 char *kn = key_name;
6229 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", kn);
6234 offset = dissect_ndr_uint32(
6235 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
6240 static int SpoolssEnumPrinterKey_r(tvbuff_t *tvb, int offset,
6241 packet_info *pinfo, proto_tree *tree,
6246 offset = dissect_spoolss_keybuffer(tvb, offset, pinfo, tree, drep);
6248 offset = dissect_ndr_uint32(
6249 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
6251 offset = dissect_doserror(
6252 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6257 static int hf_enumprinterdataex_num_values = -1;
6258 static int hf_enumprinterdataex_name_offset = -1;
6259 static int hf_enumprinterdataex_name_len = -1;
6260 static int hf_enumprinterdataex_name = -1;
6261 static int hf_enumprinterdataex_val_type = -1;
6262 static int hf_enumprinterdataex_val_offset = -1;
6263 static int hf_enumprinterdataex_val_len = -1;
6264 static int hf_enumprinterdataex_val_dword_low = -1;
6265 static int hf_enumprinterdataex_val_dword_high = -1;
6266 static int hf_enumprinterdataex_val_sz = -1;
6268 static int SpoolssEnumPrinterDataEx_q(tvbuff_t *tvb, int offset,
6269 packet_info *pinfo, proto_tree *tree,
6274 proto_tree_add_uint_hidden(
6275 tree, hf_printerdata, tvb, offset, 0, 1);
6279 offset = dissect_nt_policy_hnd(
6280 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6283 offset = dissect_ndr_cvstring(
6284 tvb, offset, pinfo, tree, drep, sizeof(guint16),
6285 hf_printerdata_key, TRUE, &key_name);
6287 if (check_col(pinfo->cinfo, COL_INFO))
6288 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", key_name);
6292 offset = dissect_ndr_uint32(
6293 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
6298 static gint ett_printer_enumdataex_value = -1;
6301 dissect_spoolss_printer_enum_values(tvbuff_t *tvb, int offset,
6302 packet_info *pinfo, proto_tree *tree,
6305 guint32 start_offset = offset;
6306 guint32 name_offset, name_len, val_offset, val_len, val_type;
6309 proto_tree *subtree;
6311 /* Get offset of value name */
6313 offset = dissect_ndr_uint32(
6314 tvb, offset, pinfo, NULL, drep,
6315 hf_enumprinterdataex_name_offset, &name_offset);
6317 offset = dissect_ndr_uint32(
6318 tvb, offset, pinfo, NULL, drep,
6319 hf_enumprinterdataex_name_len, &name_len);
6321 dissect_spoolss_uint16uni(
6322 tvb, start_offset + name_offset, pinfo, NULL, drep,
6325 item = proto_tree_add_text(tree, tvb, offset, 0, "Name: ");
6327 subtree = proto_item_add_subtree(item, ett_printer_enumdataex_value);
6329 proto_item_append_text(item, name);
6331 proto_tree_add_text(
6332 subtree, tvb, offset - 8, 4, "Name offset: %d", name_offset);
6334 proto_tree_add_text(
6335 subtree, tvb, offset - 4, 4, "Name len: %d", name_len);
6337 proto_tree_add_text(
6338 subtree, tvb, start_offset + name_offset, (strlen(name) + 1) * 2,
6341 offset = dissect_ndr_uint32(
6342 tvb, offset, pinfo, subtree, drep, hf_printerdata_type,
6345 offset = dissect_ndr_uint32(
6346 tvb, offset, pinfo, subtree, drep,
6347 hf_enumprinterdataex_val_offset, &val_offset);
6349 offset = dissect_ndr_uint32(
6350 tvb, offset, pinfo, subtree, drep,
6351 hf_enumprinterdataex_val_len, &val_len);
6354 proto_tree_add_text(subtree, tvb, start_offset + val_offset, 4,
6360 case DCERPC_REG_DWORD: {
6363 int offset2 = start_offset + val_offset;
6365 /* Needs to be broken into two 16-byte ints because it may
6368 offset2 = dissect_ndr_uint16(
6369 tvb, offset2, pinfo, subtree, drep,
6370 hf_enumprinterdataex_val_dword_low, &low);
6372 offset2 = dissect_ndr_uint16(
6373 tvb, offset2, pinfo, subtree, drep,
6374 hf_enumprinterdataex_val_dword_high, &high);
6376 value = (high << 16) | low;
6378 proto_tree_add_text(subtree, tvb, start_offset + val_offset, 4,
6379 "Value: %d", value);
6381 proto_item_append_text(item, ", Value: %d", value);
6385 case DCERPC_REG_SZ: {
6388 dissect_spoolss_uint16uni(
6389 tvb, start_offset + val_offset, pinfo, subtree, drep,
6392 proto_item_append_text(item, ", Value: %s", value);
6398 case DCERPC_REG_BINARY:
6400 /* FIXME: nicer way to display this */
6402 proto_tree_add_text(
6403 subtree, tvb, start_offset + val_offset, val_len,
6404 "Value: <binary data>");
6407 case DCERPC_REG_MULTI_SZ:
6409 /* FIXME: implement REG_MULTI_SZ support */
6411 proto_tree_add_text(
6412 subtree, tvb, start_offset + val_offset, val_len,
6413 "Value: <REG_MULTI_SZ not implemented>");
6417 proto_tree_add_text(
6418 subtree, tvb, start_offset + val_offset, val_len,
6419 "%s: unknown type %d", name, val_type);
6428 static gint ett_PRINTER_DATA_CTR;
6430 static int SpoolssEnumPrinterDataEx_r(tvbuff_t *tvb, int offset,
6431 packet_info *pinfo, proto_tree *tree,
6434 guint32 size, num_values;
6436 proto_tree_add_uint_hidden(
6437 tree, hf_printerdata, tvb, offset, 0, 1);
6441 offset = dissect_ndr_uint32(
6442 tvb, offset, pinfo, tree, drep,
6443 hf_buffer_size, &size);
6446 tvb, offset + size + 4, pinfo, NULL, drep, hf_returned,
6451 proto_tree *subtree;
6452 int offset2 = offset;
6455 item = proto_tree_add_text(
6456 tree, tvb, offset, 0, "Printer data");
6458 subtree = proto_item_add_subtree(item, ett_PRINTER_DATA_CTR);
6460 for (i=0; i < num_values; i++)
6461 offset2 = dissect_spoolss_printer_enum_values(
6462 tvb, offset2, pinfo, subtree, drep);
6467 offset = dissect_ndr_uint32(
6468 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
6470 offset = dissect_ndr_uint32(
6471 tvb, offset, pinfo, tree, drep, hf_returned, NULL);
6473 offset = dissect_doserror(
6474 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6481 /* Templates for new subdissectors */
6487 static int SpoolssFoo_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
6488 proto_tree *tree, guint8 *drep)
6490 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
6491 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
6498 static int SpoolssFoo_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
6499 proto_tree *tree, guint8 *drep)
6501 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
6502 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
6506 offset = dissect_doserror(
6507 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6515 * List of subdissectors for this pipe.
6518 static dcerpc_sub_dissector dcerpc_spoolss_dissectors[] = {
6519 { SPOOLSS_ENUMPRINTERS, "EnumPrinters",
6520 SpoolssEnumPrinters_q, SpoolssEnumPrinters_r },
6521 { SPOOLSS_OPENPRINTER, "OpenPrinter",
6522 NULL, SpoolssGeneric_r },
6523 { SPOOLSS_SETJOB, "SetJob",
6524 SpoolssSetJob_q, SpoolssSetJob_r },
6525 { SPOOLSS_GETJOB, "GetJob",
6526 SpoolssGetJob_q, SpoolssGetJob_r },
6527 { SPOOLSS_ENUMJOBS, "EnumJobs",
6528 SpoolssEnumJobs_q, SpoolssEnumJobs_r },
6529 { SPOOLSS_ADDPRINTER, "AddPrinter",
6530 NULL, SpoolssGeneric_r },
6531 { SPOOLSS_DELETEPRINTER, "DeletePrinter",
6532 SpoolssDeletePrinter_q, SpoolssDeletePrinter_r },
6533 { SPOOLSS_SETPRINTER, "SetPrinter",
6534 SpoolssSetPrinter_q, SpoolssSetPrinter_r },
6535 { SPOOLSS_GETPRINTER, "GetPrinter",
6536 SpoolssGetPrinter_q, SpoolssGetPrinter_r },
6537 { SPOOLSS_ADDPRINTERDRIVER, "AddPrinterDriver",
6538 NULL, SpoolssAddPrinterDriver_r },
6539 { SPOOLSS_ENUMPRINTERDRIVERS, "EnumPrinterDrivers",
6540 SpoolssEnumPrinterDrivers_q, SpoolssEnumPrinterDrivers_r },
6541 { SPOOLSS_GETPRINTERDRIVER, "GetPrinterDriver",
6542 NULL, SpoolssGeneric_r },
6543 { SPOOLSS_GETPRINTERDRIVERDIRECTORY, "GetPrinterDriverDirectory",
6544 NULL, SpoolssGeneric_r },
6545 { SPOOLSS_DELETEPRINTERDRIVER, "DeletePrinterDriver",
6546 NULL, SpoolssGeneric_r },
6547 { SPOOLSS_ADDPRINTPROCESSOR, "AddPrintProcessor",
6548 NULL, SpoolssGeneric_r },
6549 { SPOOLSS_ENUMPRINTPROCESSORS, "EnumPrintProcessor",
6550 NULL, SpoolssGeneric_r },
6551 { SPOOLSS_GETPRINTPROCESSORDIRECTORY, "GetPrintProcessorDirectory",
6552 NULL, SpoolssGeneric_r },
6553 { SPOOLSS_STARTDOCPRINTER, "StartDocPrinter",
6554 SpoolssStartDocPrinter_q, SpoolssStartDocPrinter_r },
6555 { SPOOLSS_STARTPAGEPRINTER, "StartPagePrinter",
6556 SpoolssStartPagePrinter_q, SpoolssStartPagePrinter_r },
6557 { SPOOLSS_WRITEPRINTER, "WritePrinter",
6558 SpoolssWritePrinter_q, SpoolssWritePrinter_r },
6559 { SPOOLSS_ENDPAGEPRINTER, "EndPagePrinter",
6560 SpoolssEndPagePrinter_q, SpoolssEndPagePrinter_r },
6561 { SPOOLSS_ABORTPRINTER, "AbortPrinter",
6562 NULL, SpoolssGeneric_r },
6563 { SPOOLSS_READPRINTER, "ReadPrinter",
6564 NULL, SpoolssGeneric_r },
6565 { SPOOLSS_ENDDOCPRINTER, "EndDocPrinter",
6566 SpoolssEndDocPrinter_q, SpoolssEndDocPrinter_r },
6567 { SPOOLSS_ADDJOB, "AddJob",
6568 NULL, SpoolssGeneric_r },
6569 { SPOOLSS_SCHEDULEJOB, "ScheduleJob",
6570 NULL, SpoolssGeneric_r },
6571 { SPOOLSS_GETPRINTERDATA, "GetPrinterData",
6572 SpoolssGetPrinterData_q, SpoolssGetPrinterData_r },
6573 { SPOOLSS_SETPRINTERDATA, "SetPrinterData",
6574 SpoolssSetPrinterData_q, SpoolssSetPrinterData_r },
6575 { SPOOLSS_WAITFORPRINTERCHANGE, "WaitForPrinterChange",
6576 NULL, SpoolssGeneric_r },
6577 { SPOOLSS_CLOSEPRINTER, "ClosePrinter",
6578 SpoolssClosePrinter_q, SpoolssClosePrinter_r },
6579 { SPOOLSS_ADDFORM, "AddForm",
6580 SpoolssAddForm_q, SpoolssAddForm_r },
6581 { SPOOLSS_DELETEFORM, "DeleteForm",
6582 SpoolssDeleteForm_q, SpoolssDeleteForm_r },
6583 { SPOOLSS_GETFORM, "GetForm",
6584 SpoolssGetForm_q, SpoolssGetForm_r },
6585 { SPOOLSS_SETFORM, "SetForm",
6586 SpoolssSetForm_q, SpoolssSetForm_r },
6587 { SPOOLSS_ENUMFORMS, "EnumForms",
6588 SpoolssEnumForms_q, SpoolssEnumForms_r },
6589 { SPOOLSS_ENUMPORTS, "EnumPorts",
6590 NULL, SpoolssGeneric_r },
6591 { SPOOLSS_ENUMMONITORS, "EnumMonitors",
6592 NULL, SpoolssGeneric_r },
6593 { SPOOLSS_ADDPORT, "AddPort",
6594 NULL, SpoolssGeneric_r },
6595 { SPOOLSS_CONFIGUREPORT, "ConfigurePort",
6596 NULL, SpoolssGeneric_r },
6597 { SPOOLSS_DELETEPORT, "DeletePort",
6598 NULL, SpoolssGeneric_r },
6599 { SPOOLSS_CREATEPRINTERIC, "CreatePrinterIC",
6600 NULL, SpoolssGeneric_r },
6601 { SPOOLSS_PLAYGDISCRIPTONPRINTERIC, "PlayDiscriptOnPrinterIC",
6602 NULL, SpoolssGeneric_r },
6603 { SPOOLSS_DELETEPRINTERIC, "DeletePrinterIC",
6604 NULL, SpoolssGeneric_r },
6605 { SPOOLSS_ADDPRINTERCONNECTION, "AddPrinterConnection",
6606 NULL, SpoolssGeneric_r },
6607 { SPOOLSS_DELETEPRINTERCONNECTION, "DeletePrinterConnection",
6608 NULL, SpoolssGeneric_r },
6609 { SPOOLSS_PRINTERMESSAGEBOX, "PrinterMessageBox",
6610 NULL, SpoolssGeneric_r },
6611 { SPOOLSS_ADDMONITOR, "AddMonitor",
6612 NULL, SpoolssGeneric_r },
6613 { SPOOLSS_DELETEMONITOR, "DeleteMonitor",
6614 NULL, SpoolssGeneric_r },
6615 { SPOOLSS_DELETEPRINTPROCESSOR, "DeletePrintProcessor",
6616 NULL, SpoolssGeneric_r },
6617 { SPOOLSS_ADDPRINTPROVIDER, "AddPrintProvider",
6618 NULL, SpoolssGeneric_r },
6619 { SPOOLSS_DELETEPRINTPROVIDER, "DeletePrintProvider",
6620 NULL, SpoolssGeneric_r },
6621 { SPOOLSS_ENUMPRINTPROCDATATYPES, "EnumPrintProcDataTypes",
6622 NULL, SpoolssGeneric_r },
6623 { SPOOLSS_RESETPRINTER, "ResetPrinter",
6624 NULL, SpoolssGeneric_r },
6625 { SPOOLSS_GETPRINTERDRIVER2, "GetPrinterDriver2",
6626 SpoolssGetPrinterDriver2_q, SpoolssGetPrinterDriver2_r },
6627 { SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION,
6628 "FindFirstPrinterChangeNotification",
6629 NULL, SpoolssGeneric_r },
6630 { SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION,
6631 "FindNextPrinterChangeNotification",
6632 NULL, SpoolssGeneric_r },
6633 { SPOOLSS_FCPN, "FCPN",
6634 SpoolssFCPN_q, SpoolssFCPN_r },
6635 { SPOOLSS_ROUTERFINDFIRSTPRINTERNOTIFICATIONOLD,
6636 "RouterFindFirstPrinterNotificationOld",
6637 NULL, SpoolssGeneric_r },
6638 { SPOOLSS_REPLYOPENPRINTER, "ReplyOpenPrinter",
6639 SpoolssReplyOpenPrinter_q, SpoolssReplyOpenPrinter_r },
6640 { SPOOLSS_ROUTERREPLYPRINTER, "RouterReplyPrinter",
6641 SpoolssRouterReplyPrinter_q, SpoolssRouterReplyPrinter_r },
6642 { SPOOLSS_REPLYCLOSEPRINTER, "ReplyClosePrinter",
6643 SpoolssReplyClosePrinter_q, SpoolssReplyClosePrinter_r },
6644 { SPOOLSS_ADDPORTEX, "AddPortEx",
6645 NULL, SpoolssGeneric_r },
6646 { SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFICATION,
6647 "RemoteFindFirstPrinterChangeNotification",
6648 NULL, SpoolssGeneric_r },
6649 { SPOOLSS_SPOOLERINIT, "SpoolerInit",
6650 NULL, SpoolssGeneric_r },
6651 { SPOOLSS_RESETPRINTEREX, "ResetPrinterEx",
6652 NULL, SpoolssGeneric_r },
6653 { SPOOLSS_RFFPCNEX, "RFFPCNEX",
6654 SpoolssRFFPCNEX_q, SpoolssRFFPCNEX_r },
6655 { SPOOLSS_RRPCN, "RRPCN",
6656 SpoolssRRPCN_q, SpoolssRRPCN_r },
6657 { SPOOLSS_RFNPCNEX, "RFNPCNEX",
6658 SpoolssRFNPCNEX_q, SpoolssRFNPCNEX_r },
6659 { SPOOLSS_OPENPRINTEREX, "OpenPrinterEx",
6660 SpoolssOpenPrinterEx_q, SpoolssOpenPrinterEx_r },
6661 { SPOOLSS_ADDPRINTEREX, "AddPrinterEx",
6662 NULL, SpoolssAddPrinterEx_r },
6663 { SPOOLSS_ENUMPRINTERDATA, "EnumPrinterData",
6664 SpoolssEnumPrinterData_q, SpoolssEnumPrinterData_r },
6665 { SPOOLSS_DELETEPRINTERDATA, "DeletePrinterData",
6666 SpoolssDeletePrinterData_q, SpoolssDeletePrinterData_r },
6667 { SPOOLSS_GETPRINTERDATAEX, "GetPrinterDataEx",
6668 SpoolssGetPrinterDataEx_q, SpoolssGetPrinterDataEx_r },
6669 { SPOOLSS_SETPRINTERDATAEX, "SetPrinterDataEx",
6670 SpoolssSetPrinterDataEx_q, SpoolssSetPrinterDataEx_r },
6671 { SPOOLSS_ENUMPRINTERDATAEX, "EnumPrinterDataEx",
6672 SpoolssEnumPrinterDataEx_q, SpoolssEnumPrinterDataEx_r },
6673 { SPOOLSS_ENUMPRINTERKEY, "EnumPrinterKey",
6674 SpoolssEnumPrinterKey_q, SpoolssEnumPrinterKey_r },
6675 { SPOOLSS_DELETEPRINTERDATAEX, "DeletePrinterDataEx",
6676 NULL, SpoolssGeneric_r },
6677 { SPOOLSS_DELETEPRINTERDRIVEREX, "DeletePrinterDriverEx",
6678 NULL, SpoolssGeneric_r },
6679 { SPOOLSS_ADDPRINTERDRIVEREX, "AddPrinterDriverEx",
6680 NULL, SpoolssGeneric_r },
6682 { 0, NULL, NULL, NULL },
6686 * Dissector initialisation function
6689 /* Protocol registration */
6691 static int proto_dcerpc_spoolss = -1;
6692 static gint ett_dcerpc_spoolss = -1;
6695 proto_register_dcerpc_spoolss(void)
6697 static hf_register_info hf[] = {
6699 /* GetPrinterDriver2 */
6701 { &hf_clientmajorversion,
6702 { "Client major version", "spoolss.clientmajorversion", FT_UINT32, BASE_DEC,
6703 NULL, 0x0, "Client printer driver major version", HFILL }},
6704 { &hf_clientminorversion,
6705 { "Client minor version", "spoolss.clientminorversion", FT_UINT32, BASE_DEC,
6706 NULL, 0x0, "Client printer driver minor version", HFILL }},
6707 { &hf_servermajorversion,
6708 { "Server major version", "spoolss.servermajorversion", FT_UINT32, BASE_DEC,
6709 NULL, 0x0, "Server printer driver major version", HFILL }},
6710 { &hf_serverminorversion,
6711 { "Server minor version", "spoolss.serverminorversion", FT_UINT32, BASE_DEC,
6712 NULL, 0x0, "Server printer driver minor version", HFILL }},
6714 { "Driver path", "spoolss.driverpath", FT_STRING, BASE_NONE,
6715 NULL, 0, "Driver path", HFILL }},
6717 { "Data file", "spoolss.datafile", FT_STRING, BASE_NONE,
6718 NULL, 0, "Data file", HFILL }},
6720 { "Config file", "spoolss.configfile", FT_STRING, BASE_NONE,
6721 NULL, 0, "Printer name", HFILL }},
6723 { "Help file", "spoolss.helpfile", FT_STRING, BASE_NONE,
6724 NULL, 0, "Help file", HFILL }},
6726 { "Monitor name", "spoolss.monitorname", FT_STRING, BASE_NONE,
6727 NULL, 0, "Monitor name", HFILL }},
6728 { &hf_defaultdatatype,
6729 { "Default data type", "spoolss.defaultdatatype", FT_STRING, BASE_NONE,
6730 NULL, 0, "Default data type", HFILL }},
6731 { &hf_driverinfo_cversion,
6732 { "Driver version", "spoolss.driverversion", FT_UINT32, BASE_DEC,
6733 VALS(driverinfo_cversion_vals), 0, "Printer name", HFILL }},
6734 { &hf_dependentfiles,
6735 { "Dependent files", "spoolss.dependentfiles", FT_STRING, BASE_NONE,
6736 NULL, 0, "Dependent files", HFILL }},
6738 { &hf_printer_status,
6739 { "Status", "spoolss.printer_status", FT_UINT32, BASE_DEC,
6740 VALS(printer_status_vals), 0, "Status", HFILL }},
6742 /* Setprinter RPC */
6744 { &hf_setprinter_cmd,
6745 { "Command", "spoolss.setprinter_cmd", FT_UINT32, BASE_DEC,
6746 VALS(setprinter_cmd_vals), 0, "Command", HFILL }},
6750 { &hf_enumprinters_flags,
6751 { "Flags", "spoolss.enumprinters.flags",
6752 FT_UINT32, BASE_HEX, NULL, 0, "Flags", HFILL }},
6754 { &hf_enumprinters_flags_local,
6755 { "Enum local", "spoolss.enumprinters.flags.enum_local",
6756 FT_BOOLEAN, 32, TFS(&flags_set_truth),
6757 PRINTER_ENUM_LOCAL, "Enum local", HFILL }},
6759 { &hf_enumprinters_flags_name,
6760 { "Enum name", "spoolss.enumprinters.flags.enum_name",
6761 FT_BOOLEAN, 32, TFS(&flags_set_truth),
6762 PRINTER_ENUM_NAME, "Enum name", HFILL }},
6764 { &hf_enumprinters_flags_shared,
6765 { "Enum shared", "spoolss.enumprinters.flags.enum_shared",
6766 FT_BOOLEAN, 32, TFS(&flags_set_truth),
6767 PRINTER_ENUM_SHARED, "Enum shared", HFILL }},
6769 { &hf_enumprinters_flags_default,
6770 { "Enum default", "spoolss.enumprinters.flags.enum_default",
6771 FT_BOOLEAN, 32, TFS(&flags_set_truth),
6772 PRINTER_ENUM_DEFAULT, "Enum default", HFILL }},
6774 { &hf_enumprinters_flags_connections,
6775 { "Enum connections", "spoolss.enumprinters.flags.enum_connections",
6776 FT_BOOLEAN, 32, TFS(&flags_set_truth),
6777 PRINTER_ENUM_CONNECTIONS, "Enum connections", HFILL }},
6779 { &hf_enumprinters_flags_network,
6780 { "Enum network", "spoolss.enumprinters.flags.enum_network",
6781 FT_BOOLEAN, 32, TFS(&flags_set_truth),
6782 PRINTER_ENUM_NETWORK, "Enum network", HFILL }},
6784 { &hf_enumprinters_flags_remote,
6785 { "Enum remote", "spoolss.enumprinters.flags.enum_remote",
6786 FT_BOOLEAN, 32, TFS(&flags_set_truth),
6787 PRINTER_ENUM_REMOTE, "Enum remote", HFILL }},
6792 { "Start time", "spoolss.start_time",
6793 FT_UINT32, BASE_DEC, NULL, 0, "Start time", HFILL }},
6796 { "End time", "spoolss.end_time",
6797 FT_UINT32, BASE_DEC, NULL, 0, "End time", HFILL }},
6800 { "Elapsed time", "spoolss.elapsed_time",
6801 FT_UINT32, BASE_DEC, NULL, 0, "Elapsed time", HFILL }},
6804 * New hf index values
6808 { "Operation", "spoolss.opnum", FT_UINT16, BASE_DEC,
6809 NULL, 0x0, "Operation", HFILL }},
6812 { "Context handle", "spoolss.hnd", FT_BYTES, BASE_NONE,
6813 NULL, 0x0, "SPOOLSS policy handle", HFILL }},
6816 { "Return code", "spoolss.rc", FT_UINT32, BASE_HEX,
6817 VALS(DOS_errors), 0x0, "SPOOLSS return code", HFILL }},
6820 { "Offered", "spoolss.offered", FT_UINT32, BASE_DEC,
6821 NULL, 0x0, "Size of buffer offered in this request",
6825 { "Needed", "spoolss.needed", FT_UINT32, BASE_DEC,
6826 NULL, 0x0, "Size of buffer required for request", HFILL }},
6829 { "Returned", "spoolss.returned", FT_UINT32, BASE_DEC,
6830 NULL, 0x0, "Number of items returned", HFILL }},
6833 { "Buffer size", "spoolss.buffer.size", FT_UINT32, BASE_DEC,
6834 NULL, 0x0, "Size of buffer", HFILL }},
6837 { "Buffer data", "spoolss.buffer.data", FT_BYTES, BASE_HEX,
6838 NULL, 0x0, "Contents of buffer", HFILL }},
6841 { "Offset", "spoolss.offset", FT_UINT32, BASE_DEC,
6842 NULL, 0x0, "Offset of data", HFILL }},
6845 { "Info level", "spoolss.enumjobs.level", FT_UINT32,
6846 BASE_DEC, NULL, 0x0, "Info level", HFILL }},
6850 { "Printer name", "spoolss.printername", FT_STRING,
6851 BASE_NONE, NULL, 0, "Printer name", HFILL }},
6854 { "Machine name", "spoolss.machinename", FT_STRING,
6855 BASE_NONE, NULL, 0, "Machine name", HFILL }},
6858 { "Notify name", "spoolss.notifyname", FT_STRING,
6859 BASE_NONE, NULL, 0, "Notify name", HFILL }},
6862 { "Printer description", "spoolss.printerdesc", FT_STRING,
6863 BASE_NONE, NULL, 0, "Printer description", HFILL }},
6865 { &hf_printercomment,
6866 { "Printer comment", "spoolss.printercomment", FT_STRING,
6867 BASE_NONE, NULL, 0, "Printer comment", HFILL }},
6870 { "Server name", "spoolss.servername", FT_STRING, BASE_NONE,
6871 NULL, 0, "Server name", HFILL }},
6874 { "Share name", "spoolss.sharename", FT_STRING, BASE_NONE,
6875 NULL, 0, "Share name", HFILL }},
6878 { "Port name", "spoolss.portname", FT_STRING, BASE_NONE,
6879 NULL, 0, "Port name", HFILL }},
6881 { &hf_printerlocation,
6882 { "Printer location", "spoolss.printerlocation", FT_STRING,
6883 BASE_NONE, NULL, 0, "Printer location", HFILL }},
6886 { "Architecture name", "spoolss.architecture", FT_STRING,
6887 BASE_NONE, NULL, 0, "Architecture name", HFILL }},
6890 { "Driver name", "spoolss.drivername", FT_STRING, BASE_NONE,
6891 NULL, 0, "Driver name", HFILL }},
6894 { "User name", "spoolss.username", FT_STRING, BASE_NONE,
6895 NULL, 0, "User name", HFILL }},
6898 { "Document name", "spoolss.document", FT_STRING, BASE_NONE,
6899 NULL, 0, "Document name", HFILL }},
6902 { "Output file", "spoolss.outputfile", FT_STRING, BASE_NONE,
6903 NULL, 0, "Output File", HFILL }},
6906 { "Datatype", "spoolss.Datatype", FT_STRING, BASE_NONE,
6907 NULL, 0, "Datatype", HFILL }},
6910 { "Text status", "spoolss.textstatus", FT_STRING, BASE_NONE,
6911 NULL, 0, "Text status", HFILL }},
6914 { "Separator file", "spoolss.setpfile", FT_STRING, BASE_NONE,
6915 NULL, 0, "Separator file", HFILL }},
6918 { "Parameters", "spoolss.parameters", FT_STRING, BASE_NONE,
6919 NULL, 0, "Parameters", HFILL }},
6921 { &hf_printprocessor,
6922 { "Print processor", "spoolss.printprocessor", FT_STRING,
6923 BASE_NONE, NULL, 0, "Print processor", HFILL }},
6928 { "Data", "spoolss.printerdata", FT_UINT32,
6929 BASE_HEX, NULL, 0, "Data", HFILL }},
6931 { &hf_printerdata_key,
6932 { "Key", "spoolss.printerdata.key", FT_STRING,
6933 BASE_NONE, NULL, 0, "Printer data key", HFILL }},
6935 { &hf_printerdata_value,
6936 { "Value", "spoolss.printerdata.value",
6937 FT_STRING, BASE_NONE, NULL, 0, "Printer data value",
6940 { &hf_printerdata_type,
6941 { "Type", "spoolss.printerdata.type",
6942 FT_UINT32, BASE_DEC, VALS(reg_datatypes), 0,
6943 "Printer data type", HFILL }},
6945 { &hf_printerdata_size,
6946 { "Size", "spoolss.printerdata.size",
6947 FT_UINT32, BASE_DEC, NULL, 0, "Printer data size",
6950 { &hf_printerdata_data,
6951 { "Data", "spoolss.printerdata.data", FT_BYTES, BASE_HEX,
6952 NULL, 0x0, "Printer data", HFILL }},
6954 { &hf_printerdata_data_dword,
6955 { "DWORD data", "spoolss.printerdata.data.dword",
6956 FT_UINT32, BASE_HEX, NULL, 0, "DWORD data", HFILL }},
6958 { &hf_printerdata_data_sz,
6959 { "String data", "spoolss.printerdata.data.sz",
6960 FT_STRING, BASE_NONE, NULL, 0, "String data",
6965 { &hf_devmodectr_size,
6966 { "Devicemode ctr size", "spoolss.devicemodectr.size",
6967 FT_UINT32, BASE_DEC, NULL, 0, "Devicemode ctr size",
6971 { "Devicemode", "spoolss.devmode", FT_UINT32,
6972 BASE_HEX, NULL, 0, "Devicemode", HFILL }},
6975 { "Size", "spoolss.devmode.size",
6976 FT_UINT32, BASE_DEC, NULL, 0, "Size", HFILL }},
6978 { &hf_devmode_spec_version,
6979 { "Spec version", "spoolss.devmode.spec_version",
6980 FT_UINT16, BASE_DEC, VALS(devmode_specversion_vals),
6981 0, "Spec version", HFILL }},
6983 { &hf_devmode_driver_version,
6984 { "Driver version", "spoolss.devmode.driver_version",
6985 FT_UINT16, BASE_DEC, NULL, 0, "Driver version", HFILL }},
6987 { &hf_devmode_size2,
6988 { "Size2", "spoolss.devmode.size2",
6989 FT_UINT16, BASE_DEC, NULL, 0, "Size2", HFILL }},
6991 { &hf_devmode_fields,
6992 { "Fields", "spoolss.devmode.fields",
6993 FT_UINT32, BASE_HEX, NULL, 0, "Fields", HFILL }},
6995 { &hf_devmode_orientation,
6996 { "Orientation", "spoolss.devmode.orientation",
6997 FT_UINT16, BASE_DEC, VALS(devmode_orientation_vals),
6998 0, "Orientation", HFILL }},
7000 { &hf_devmode_paper_size,
7001 { "Paper size", "spoolss.devmode.paper_size",
7002 FT_UINT16, BASE_DEC, VALS(devmode_papersize_vals),
7003 0, "Paper size", HFILL }},
7005 { &hf_devmode_paper_width,
7006 { "Paper width", "spoolss.devmode.paper_width",
7007 FT_UINT16, BASE_DEC, NULL, 0, "Paper width", HFILL }},
7009 { &hf_devmode_paper_length,
7010 { "Paper length", "spoolss.devmode.paper_length",
7011 FT_UINT16, BASE_DEC, NULL, 0, "Paper length", HFILL }},
7013 { &hf_devmode_scale,
7014 { "Scale", "spoolss.devmode.scale",
7015 FT_UINT16, BASE_DEC, NULL, 0, "Scale", HFILL }},
7017 { &hf_devmode_copies,
7018 { "Copies", "spoolss.devmode.copies",
7019 FT_UINT16, BASE_DEC, NULL, 0, "Copies", HFILL }},
7021 { &hf_devmode_default_source,
7022 { "Default source", "spoolss.devmode.default_source",
7023 FT_UINT16, BASE_DEC, VALS(devmode_papersource_vals),
7024 0, "Default source", HFILL }},
7026 { &hf_devmode_print_quality,
7027 { "Print quality", "spoolss.devmode.print_quality",
7028 FT_UINT16, BASE_DEC, VALS(devmode_printquality_vals),
7029 0, "Print quality", HFILL }},
7031 { &hf_devmode_color,
7032 { "Color", "spoolss.devmode.color",
7033 FT_UINT16, BASE_DEC, VALS(devmode_colour_vals), 0,
7036 { &hf_devmode_duplex,
7037 { "Duplex", "spoolss.devmode.duplex",
7038 FT_UINT16, BASE_DEC, VALS(devmode_duplex_vals), 0,
7041 { &hf_devmode_y_resolution,
7042 { "Y resolution", "spoolss.devmode.y_resolution",
7043 FT_UINT16, BASE_DEC, NULL, 0, "Y resolution", HFILL }},
7045 { &hf_devmode_tt_option,
7046 { "TT option", "spoolss.devmode.tt_option",
7047 FT_UINT16, BASE_DEC, VALS(devmode_ttoption_vals), 0,
7048 "TT option", HFILL }},
7050 { &hf_devmode_collate,
7051 { "Collate", "spoolss.devmode.collate",
7052 FT_UINT16, BASE_DEC, VALS(devmode_collate_vals), 0,
7053 "Collate", HFILL }},
7055 { &hf_devmode_log_pixels,
7056 { "Log pixels", "spoolss.devmode.log_pixels",
7057 FT_UINT16, BASE_DEC, NULL, 0, "Log pixels", HFILL }},
7059 { &hf_devmode_bits_per_pel,
7060 { "Bits per pel", "spoolss.devmode.bits_per_pel",
7061 FT_UINT32, BASE_DEC, NULL, 0, "Bits per pel", HFILL }},
7063 { &hf_devmode_pels_width,
7064 { "Pels width", "spoolss.devmode.pels_width",
7065 FT_UINT32, BASE_DEC, NULL, 0, "Pels width", HFILL }},
7067 { &hf_devmode_pels_height,
7068 { "Pels height", "spoolss.devmode.pels_height",
7069 FT_UINT32, BASE_DEC, NULL, 0, "Pels height", HFILL }},
7071 { &hf_devmode_display_flags,
7072 { "Display flags", "spoolss.devmode.display_flags",
7073 FT_UINT32, BASE_DEC, VALS(devmode_displayflags_vals), 0,
7074 "Display flags", HFILL }},
7076 { &hf_devmode_display_freq,
7077 { "Display frequency", "spoolss.devmode.display_freq",
7078 FT_UINT32, BASE_DEC, NULL, 0, "Display frequency",
7081 { &hf_devmode_icm_method,
7082 { "ICM method", "spoolss.devmode.icm_method",
7083 FT_UINT32, BASE_DEC, VALS(devmode_icmmethod_vals), 0,
7084 "ICM method", HFILL }},
7086 { &hf_devmode_icm_intent,
7087 { "ICM intent", "spoolss.devmode.icm_intent",
7088 FT_UINT32, BASE_DEC, VALS(devmode_icmintent_vals), 0,
7089 "ICM intent", HFILL }},
7091 { &hf_devmode_media_type,
7092 { "Media type", "spoolss.devmode.media_type",
7093 FT_UINT32, BASE_DEC, VALS(devmode_mediatype_vals), 0,
7094 "Media type", HFILL }},
7096 { &hf_devmode_dither_type,
7097 { "Dither type", "spoolss.devmode.dither_type",
7098 FT_UINT32, BASE_DEC, VALS(devmode_dithertype_vals), 0,
7099 "Dither type", HFILL }},
7101 { &hf_devmode_reserved1,
7102 { "Reserved1", "spoolss.devmode.reserved1",
7103 FT_UINT32, BASE_DEC, NULL, 0, "Reserved1", HFILL }},
7105 { &hf_devmode_reserved2,
7106 { "Reserved2", "spoolss.devmode.reserved2",
7107 FT_UINT32, BASE_DEC, NULL, 0, "Reserved2", HFILL }},
7109 { &hf_devmode_panning_width,
7110 { "Panning width", "spoolss.devmode.panning_width",
7111 FT_UINT32, BASE_DEC, NULL, 0, "Panning width", HFILL }},
7113 { &hf_devmode_panning_height,
7114 { "Panning height", "spoolss.devmode.panning_height",
7115 FT_UINT32, BASE_DEC, NULL, 0, "Panning height", HFILL }},
7117 { &hf_devmode_driver_extra_len,
7118 { "Driver extra length",
7119 "spoolss.devmode.driver_extra_len",
7120 FT_UINT32, BASE_DEC, NULL, 0, "Driver extra length",
7123 { &hf_devmode_driver_extra,
7124 { "Driver extra", "spoolss.devmode.driver_extra",
7125 FT_BYTES, BASE_NONE, NULL, 0, "Driver extra", HFILL }},
7127 /* Devicemode fields */
7129 { &hf_devmode_fields_orientation,
7130 { "Orientation", "spoolss.devmode.fields.orientation",
7131 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7132 DEVMODE_ORIENTATION, "Orientation", HFILL }},
7134 { &hf_devmode_fields_papersize,
7135 { "Paper size", "spoolss.devmode.fields.paper_size",
7136 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7137 DEVMODE_PAPERSIZE, "Paper size", HFILL }},
7139 { &hf_devmode_fields_paperlength,
7140 { "Paper length", "spoolss.devmode.fields.paper_length",
7141 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7142 DEVMODE_PAPERLENGTH, "Paper length", HFILL }},
7144 { &hf_devmode_fields_paperwidth,
7145 { "Paper width", "spoolss.devmode.fields.paper_width",
7146 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7147 DEVMODE_PAPERWIDTH, "Paper width", HFILL }},
7149 { &hf_devmode_fields_scale,
7150 { "Scale", "spoolss.devmode.fields.scale",
7151 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7152 DEVMODE_SCALE, "Scale", HFILL }},
7154 { &hf_devmode_fields_position,
7155 { "Position", "spoolss.devmode.fields.position",
7156 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7157 DEVMODE_POSITION, "Position", HFILL }},
7159 { &hf_devmode_fields_nup,
7160 { "N-up", "spoolss.devmode.fields.nup",
7161 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7162 DEVMODE_NUP, "N-up", HFILL }},
7164 { &hf_devmode_fields_copies,
7165 { "Copies", "spoolss.devmode.fields.copies",
7166 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7167 DEVMODE_COPIES, "Copies", HFILL }},
7169 { &hf_devmode_fields_defaultsource,
7170 { "Default source", "spoolss.devmode.fields.default_source",
7171 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7172 DEVMODE_DEFAULTSOURCE, "Default source", HFILL }},
7174 { &hf_devmode_fields_printquality,
7175 { "Print quality", "spoolss.devmode.fields.print_quality",
7176 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7177 DEVMODE_PRINTQUALITY, "Print quality", HFILL }},
7179 { &hf_devmode_fields_color,
7180 { "Color", "spoolss.devmode.fields.color",
7181 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7182 DEVMODE_COLOR, "Color", HFILL }},
7184 { &hf_devmode_fields_duplex,
7185 { "Duplex", "spoolss.devmode.fields.duplex",
7186 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7187 DEVMODE_DUPLEX, "Duplex", HFILL }},
7189 { &hf_devmode_fields_yresolution,
7190 { "Y resolution", "spoolss.devmode.fields.y_resolution",
7191 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7192 DEVMODE_YRESOLUTION, "Y resolution", HFILL }},
7194 { &hf_devmode_fields_ttoption,
7195 { "TT option", "spoolss.devmode.fields.tt_option",
7196 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7197 DEVMODE_TTOPTION, "TT option", HFILL }},
7199 { &hf_devmode_fields_collate,
7200 { "Collate", "spoolss.devmode.fields.collate",
7201 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7202 DEVMODE_COLLATE, "Collate", HFILL }},
7204 { &hf_devmode_fields_formname,
7205 { "Form name", "spoolss.devmode.fields.form_name",
7206 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7207 DEVMODE_FORMNAME, "Form name", HFILL }},
7209 { &hf_devmode_fields_logpixels,
7210 { "Log pixels", "spoolss.devmode.fields.log_pixels",
7211 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7212 DEVMODE_LOGPIXELS, "Log pixels", HFILL }},
7214 { &hf_devmode_fields_bitsperpel,
7215 { "Bits per pel", "spoolss.devmode.fields.bits_per_pel",
7216 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7217 DEVMODE_BITSPERPEL, "Bits per pel", HFILL }},
7219 { &hf_devmode_fields_pelswidth,
7220 { "Pels width", "spoolss.devmode.fields.pels_width",
7221 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7222 DEVMODE_PELSWIDTH, "Pels width", HFILL }},
7224 { &hf_devmode_fields_pelsheight,
7225 { "Pels height", "spoolss.devmode.fields.pels_height",
7226 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7227 DEVMODE_PELSHEIGHT, "Pels height", HFILL }},
7229 { &hf_devmode_fields_displayflags,
7230 { "Display flags", "spoolss.devmode.fields.display_flags",
7231 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7232 DEVMODE_DISPLAYFLAGS, "Display flags", HFILL }},
7234 { &hf_devmode_fields_displayfrequency,
7235 { "Display frequency",
7236 "spoolss.devmode.fields.display_frequency",
7237 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7238 DEVMODE_DISPLAYFREQUENCY, "Display frequency", HFILL }},
7240 { &hf_devmode_fields_icmmethod,
7241 { "ICM method", "spoolss.devmode.fields.icm_method",
7242 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7243 DEVMODE_ICMMETHOD, "ICM method", HFILL }},
7245 { &hf_devmode_fields_icmintent,
7246 { "ICM intent", "spoolss.devmode.fields.icm_intent",
7247 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7248 DEVMODE_ICMINTENT, "ICM intent", HFILL }},
7250 { &hf_devmode_fields_mediatype,
7251 { "Media type", "spoolss.devmode.fields.media_type",
7252 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7253 DEVMODE_MEDIATYPE, "Media type", HFILL }},
7255 { &hf_devmode_fields_dithertype,
7256 { "Dither type", "spoolss.devmode.fields.dither_type",
7257 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7258 DEVMODE_DITHERTYPE, "Dither type", HFILL }},
7260 { &hf_devmode_fields_panningwidth,
7261 { "Panning width", "spoolss.devmode.fields.panning_width",
7262 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7263 DEVMODE_PANNINGWIDTH, "Panning width", HFILL }},
7265 { &hf_devmode_fields_panningheight,
7266 { "Panning height", "spoolss.devmode.fields.panning_height",
7267 FT_BOOLEAN, 32, TFS(&flags_set_truth),
7268 DEVMODE_PANNINGHEIGHT, "Panning height", HFILL }},
7270 /* EnumPrinterData RPC */
7272 { &hf_enumprinterdata_enumindex,
7273 { "Enum index", "spoolss.enumprinterdata.enumindex",
7274 FT_UINT32, BASE_DEC, NULL, 0x0,
7275 "Index for start of enumeration", HFILL }},
7277 { &hf_enumprinterdata_value_offered,
7278 { "Value size offered",
7279 "spoolss.enumprinterdata.value_offered", FT_UINT32,
7280 BASE_DEC, NULL, 0x0,
7281 "Buffer size offered for printerdata value", HFILL }},
7283 { &hf_enumprinterdata_data_offered,
7284 { "Data size offered",
7285 "spoolss.enumprinterdata.data_offered", FT_UINT32,
7286 BASE_DEC, NULL, 0x0,
7287 "Buffer size offered for printerdata data", HFILL }},
7289 { &hf_enumprinterdata_value_len,
7291 "spoolss.enumprinterdata.value_len", FT_UINT32,
7292 BASE_DEC, NULL, 0x0,
7293 "Size of printerdata value", HFILL }},
7295 { &hf_enumprinterdata_value_needed,
7296 { "Value size needed",
7297 "spoolss.enumprinterdata.value_needed", FT_UINT32,
7298 BASE_DEC, NULL, 0x0,
7299 "Buffer size needed for printerdata value", HFILL }},
7301 { &hf_enumprinterdata_data_needed,
7302 { "Data size needed",
7303 "spoolss.enumprinterdata.data_needed", FT_UINT32, BASE_DEC,
7304 NULL, 0x0, "Buffer size needed for printerdata data",
7310 { "Job ID", "spoolss.job.id", FT_UINT32, BASE_DEC,
7311 NULL, 0x0, "Job identification number", HFILL }},
7314 { "Job status", "spoolss.job.status", FT_UINT32, BASE_DEC,
7315 NULL, 0x0, "Job status", HFILL }},
7317 { &hf_job_status_paused,
7318 { "Paused", "spoolss.job.status.paused", FT_BOOLEAN, 32,
7319 TFS(&tfs_job_status_paused), JOB_STATUS_PAUSED,
7322 { &hf_job_status_error,
7323 { "Error", "spoolss.job.status.error", FT_BOOLEAN, 32,
7324 TFS(&tfs_job_status_error), JOB_STATUS_ERROR,
7327 { &hf_job_status_deleting,
7328 { "Deleting", "spoolss.job.status.deleting", FT_BOOLEAN, 32,
7329 TFS(&tfs_job_status_deleting), JOB_STATUS_DELETING,
7330 "Deleting", HFILL }},
7332 { &hf_job_status_spooling,
7333 { "Spooling", "spoolss.job.status.spooling", FT_BOOLEAN, 32,
7334 TFS(&tfs_job_status_spooling), JOB_STATUS_SPOOLING,
7335 "Spooling", HFILL }},
7337 { &hf_job_status_printing,
7338 { "Printing", "spoolss.job.status.printing", FT_BOOLEAN, 32,
7339 TFS(&tfs_job_status_printing), JOB_STATUS_PRINTING,
7340 "Printing", HFILL }},
7342 { &hf_job_status_offline,
7343 { "Offline", "spoolss.job.status.offline", FT_BOOLEAN, 32,
7344 TFS(&tfs_job_status_offline), JOB_STATUS_OFFLINE,
7345 "Offline", HFILL }},
7347 { &hf_job_status_paperout,
7348 { "Paperout", "spoolss.job.status.paperout", FT_BOOLEAN, 32,
7349 TFS(&tfs_job_status_paperout), JOB_STATUS_PAPEROUT,
7350 "Paperout", HFILL }},
7352 { &hf_job_status_printed,
7353 { "Printed", "spoolss.job.status.printed", FT_BOOLEAN, 32,
7354 TFS(&tfs_job_status_printed), JOB_STATUS_PRINTED,
7355 "Printed", HFILL }},
7357 { &hf_job_status_deleted,
7358 { "Deleted", "spoolss.job.status.deleted", FT_BOOLEAN, 32,
7359 TFS(&tfs_job_status_deleted), JOB_STATUS_DELETED,
7360 "Deleted", HFILL }},
7362 { &hf_job_status_blocked,
7363 { "Blocked", "spoolss.job.status.blocked", FT_BOOLEAN, 32,
7364 TFS(&tfs_job_status_blocked), JOB_STATUS_BLOCKED,
7365 "Blocked", HFILL }},
7367 { &hf_job_status_user_intervention,
7368 { "User intervention",
7369 "spoolss.job.status.user_intervention", FT_BOOLEAN, 32,
7370 TFS(&tfs_job_status_user_intervention),
7371 JOB_STATUS_USER_INTERVENTION, "User intervention",
7375 { "Job priority", "spoolss.job.priority", FT_UINT32,
7376 BASE_DEC, NULL, 0x0, "Job priority", HFILL }},
7379 { "Job position", "spoolss.job.position", FT_UINT32,
7380 BASE_DEC, NULL, 0x0, "Job position", HFILL }},
7382 { &hf_job_totalpages,
7383 { "Job total pages", "spoolss.job.totalpages", FT_UINT32,
7384 BASE_DEC, NULL, 0x0, "Job total pages", HFILL }},
7386 { &hf_job_totalbytes,
7387 { "Job total bytes", "spoolss.job.totalbytes", FT_UINT32,
7388 BASE_DEC, NULL, 0x0, "Job total bytes", HFILL }},
7390 { &hf_job_bytesprinted,
7391 { "Job bytes printed", "spoolss.job.bytesprinted",
7392 FT_UINT32, BASE_DEC, NULL, 0x0, "Job bytes printed",
7395 { &hf_job_pagesprinted,
7396 { "Job pages printed", "spoolss.job.pagesprinted",
7397 FT_UINT32, BASE_DEC, NULL, 0x0, "Job pages printed",
7401 { "Job size", "spoolss.job.size", FT_UINT32, BASE_DEC,
7402 NULL, 0x0, "Job size", HFILL }},
7407 { "Data", "spoolss.form", FT_UINT32,
7408 BASE_HEX, NULL, 0, "Data", HFILL }},
7411 { "Level", "spoolss.form.level", FT_UINT32,
7412 BASE_DEC, NULL, 0, "Level", HFILL }},
7415 { "Name", "spoolss.form.name", FT_STRING, BASE_NONE,
7416 NULL, 0, "Name", HFILL }},
7419 { "Flags", "spoolss.form.flags", FT_UINT32,
7420 BASE_DEC, VALS(form_type_vals), 0, "Flags", HFILL }},
7423 { "Unknown", "spoolss.form.unknown", FT_UINT32,
7424 BASE_HEX, NULL, 0, "Unknown", HFILL }},
7427 { "Width", "spoolss.form.width", FT_UINT32,
7428 BASE_DEC, NULL, 0, "Width", HFILL }},
7431 { "Height", "spoolss.form.height", FT_UINT32,
7432 BASE_DEC, NULL, 0, "Height", HFILL }},
7434 { &hf_form_left_margin,
7435 { "Left margin", "spoolss.form.left", FT_UINT32,
7436 BASE_DEC, NULL, 0, "Left", HFILL }},
7438 { &hf_form_top_margin,
7439 { "Top", "spoolss.form.top", FT_UINT32,
7440 BASE_DEC, NULL, 0, "Top", HFILL }},
7442 { &hf_form_horiz_len,
7443 { "Horizontal", "spoolss.form.horiz", FT_UINT32,
7444 BASE_DEC, NULL, 0, "Horizontal", HFILL }},
7446 { &hf_form_vert_len,
7447 { "Vertical", "spoolss.form.vert", FT_UINT32,
7448 BASE_DEC, NULL, 0, "Vertical", HFILL }},
7450 { &hf_enumforms_num,
7451 { "Num", "spoolss.enumforms.num", FT_UINT32,
7452 BASE_DEC, NULL, 0, "Num", HFILL }},
7456 { &hf_notify_options_version,
7457 { "Version", "spoolss.notify_options.version", FT_UINT32,
7458 BASE_DEC, NULL, 0, "Version", HFILL }},
7460 { &hf_notify_options_flags,
7461 { "Flags", "spoolss.notify_options.flags", FT_UINT32,
7462 BASE_DEC, NULL, 0, "Flags", HFILL }},
7464 { &hf_notify_options_count,
7465 { "Count", "spoolss.notify_options.count", FT_UINT32,
7466 BASE_DEC, NULL, 0, "Count", HFILL }},
7468 { &hf_notify_option_type,
7469 { "Type", "spoolss.notify_option.type", FT_UINT16, BASE_DEC,
7470 VALS(printer_notify_types), 0, "Type", HFILL }},
7472 { &hf_notify_option_reserved1,
7473 { "Reserved1", "spoolss.notify_option.reserved1", FT_UINT16,
7474 BASE_DEC, NULL, 0, "Reserved1", HFILL }},
7476 { &hf_notify_option_reserved2,
7477 { "Reserved2", "spoolss.notify_option.reserved2", FT_UINT32,
7478 BASE_DEC, NULL, 0, "Reserved2", HFILL }},
7480 { &hf_notify_option_reserved3,
7481 { "Reserved3", "spoolss.notify_option.reserved3", FT_UINT32,
7482 BASE_DEC, NULL, 0, "Reserved3", HFILL }},
7484 { &hf_notify_option_count,
7485 { "Count", "spoolss.notify_option.count", FT_UINT32,
7486 BASE_DEC, NULL, 0, "Count", HFILL }},
7488 { &hf_notify_option_data_count,
7489 { "Count", "spoolss.notify_option_data.count", FT_UINT32,
7490 BASE_DEC, NULL, 0, "Count", HFILL }},
7492 { &hf_notify_options_flags_refresh,
7493 { "Refresh", "spoolss.notify_options.flags", FT_BOOLEAN, 32,
7494 TFS(&tfs_notify_options_flags_refresh),
7495 PRINTER_NOTIFY_OPTIONS_REFRESH, "Refresh", HFILL }},
7497 { &hf_notify_info_count,
7498 { "Count", "spoolss.notify_info.count", FT_UINT32, BASE_DEC,
7499 NULL, 0, "Count", HFILL }},
7501 { &hf_notify_info_version,
7502 { "Version", "spoolss.notify_info.version", FT_UINT32,
7503 BASE_DEC, NULL, 0, "Version", HFILL }},
7505 { &hf_notify_info_flags,
7506 { "Flags", "spoolss.notify_info.flags", FT_UINT32, BASE_HEX,
7507 NULL, 0, "Flags", HFILL }},
7509 { &hf_notify_info_data_type,
7510 { "Type", "spoolss.notify_info_data.type", FT_UINT16,
7511 BASE_DEC, VALS(printer_notify_types), 0, "Type", HFILL }},
7514 { "Field", "spoolss.notify_field", FT_UINT16, BASE_DEC,
7515 NULL, 0, "Field", HFILL }},
7517 { &hf_notify_info_data_count,
7518 { "Count", "spoolss.notify_info_data.count", FT_UINT32,
7519 BASE_DEC, NULL, 0, "Count", HFILL }},
7521 { &hf_notify_info_data_id,
7522 { "Job Id", "spoolss.notify_info_data.jobid", FT_UINT32,
7523 BASE_DEC, NULL, 0, "Job Id", HFILL }},
7525 { &hf_notify_info_data_value1,
7526 { "Value1", "spoolss.notify_info_data.value1", FT_UINT32,
7527 BASE_HEX, NULL, 0, "Value1", HFILL }},
7529 { &hf_notify_info_data_value2,
7530 { "Value2", "spoolss.notify_info_data.value2", FT_UINT32,
7531 BASE_HEX, NULL, 0, "Value2", HFILL }},
7533 { &hf_notify_info_data_bufsize,
7534 { "Buffer size", "spoolss.notify_info_data.bufsize",
7535 FT_UINT32, BASE_DEC, NULL, 0, "Buffer size", HFILL }},
7537 { &hf_notify_info_data_buffer,
7538 { "Buffer", "spoolss.notify_info_data.buffer", FT_UINT32,
7539 BASE_HEX, NULL, 0, "Buffer", HFILL }},
7541 { &hf_notify_info_data_buffer_len,
7542 { "Buffer length", "spoolss.notify_info_data.buffer.len",
7543 FT_UINT32, BASE_HEX, NULL, 0, "Buffer length", HFILL }},
7545 { &hf_notify_info_data_buffer_data,
7546 { "Buffer data", "spoolss.notify_info_data.buffer.data",
7547 FT_BYTES, BASE_HEX, NULL, 0, "Buffer data", HFILL }},
7551 { &hf_rffpcnex_options,
7552 { "Options", "spoolss.rffpcnex.options", FT_UINT32, BASE_DEC,
7553 NULL, 0, "RFFPCNEX options", HFILL }},
7555 { &hf_printerlocal, /* XXX: move me */
7556 { "Printer local", "spoolss.printer_local", FT_UINT32,
7557 BASE_DEC, NULL, 0, "Printer local", HFILL }},
7559 { &hf_rffpcnex_flags,
7560 { "RFFPCNEX flags", "spoolss.rffpcnex.flags", FT_UINT32,
7561 BASE_DEC, NULL, 0, "RFFPCNEX flags", HFILL }},
7563 { &hf_rffpcnex_flags_add_printer,
7564 { "Add printer", "spoolss.rffpcnex.flags.add_printer",
7565 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_add_printer),
7566 SPOOLSS_PRINTER_CHANGE_ADD_PRINTER, "Add printer",
7569 { &hf_rffpcnex_flags_set_printer,
7570 { "Set printer", "spoolss.rffpcnex.flags.set_printer",
7571 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_set_printer),
7572 SPOOLSS_PRINTER_CHANGE_SET_PRINTER, "Set printer",
7575 { &hf_rffpcnex_flags_delete_printer,
7576 { "Delete printer", "spoolss.rffpcnex.flags.delete_printer",
7577 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_delete_printer),
7578 SPOOLSS_PRINTER_CHANGE_DELETE_PRINTER, "Delete printer",
7581 { &hf_rffpcnex_flags_add_job,
7582 { "Add job", "spoolss.rffpcnex.flags.add_job",
7583 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_add_job),
7584 SPOOLSS_PRINTER_CHANGE_ADD_JOB, "Add job", HFILL }},
7586 { &hf_rffpcnex_flags_set_job,
7587 { "Set job", "spoolss.rffpcnex.flags.set_job",
7588 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_set_job),
7589 SPOOLSS_PRINTER_CHANGE_SET_JOB, "Set job", HFILL }},
7591 { &hf_rffpcnex_flags_delete_job,
7592 { "Delete job", "spoolss.rffpcnex.flags.delete_job",
7593 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_delete_job),
7594 SPOOLSS_PRINTER_CHANGE_DELETE_JOB, "Delete job", HFILL }},
7596 { &hf_rffpcnex_flags_write_job,
7597 { "Write job", "spoolss.rffpcnex.flags.write_job",
7598 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_write_job),
7599 SPOOLSS_PRINTER_CHANGE_WRITE_JOB, "Write job", HFILL }},
7601 { &hf_rffpcnex_flags_add_form,
7602 { "Add form", "spoolss.rffpcnex.flags.add_form",
7603 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_add_form),
7604 SPOOLSS_PRINTER_CHANGE_ADD_FORM, "Add form", HFILL }},
7606 { &hf_rffpcnex_flags_set_form,
7607 { "Set form", "spoolss.rffpcnex.flags.set_form",
7608 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_set_form),
7609 SPOOLSS_PRINTER_CHANGE_SET_FORM, "Set form", HFILL }},
7611 { &hf_rffpcnex_flags_delete_form,
7612 { "Delete form", "spoolss.rffpcnex.flags.delete_form",
7613 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_delete_form),
7614 SPOOLSS_PRINTER_CHANGE_DELETE_FORM, "Delete form",
7617 { &hf_rffpcnex_flags_add_port,
7618 { "Add port", "spoolss.rffpcnex.flags.add_port",
7619 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_add_port),
7620 SPOOLSS_PRINTER_CHANGE_ADD_PORT, "Add port", HFILL }},
7622 { &hf_rffpcnex_flags_configure_port,
7623 { "Configure port", "spoolss.rffpcnex.flags.configure_port",
7624 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_configure_port),
7625 SPOOLSS_PRINTER_CHANGE_CONFIGURE_PORT, "Configure port",
7628 { &hf_rffpcnex_flags_delete_port,
7629 { "Delete port", "spoolss.rffpcnex.flags.delete_port",
7630 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_delete_port),
7631 SPOOLSS_PRINTER_CHANGE_DELETE_PORT, "Delete port",
7634 { &hf_rffpcnex_flags_add_print_processor,
7635 { "Add processor", "spoolss.rffpcnex.flags.add_processor",
7637 TFS(&tfs_rffpcnex_flags_add_print_processor),
7638 SPOOLSS_PRINTER_CHANGE_ADD_PRINT_PROCESSOR,
7639 "Add processor", HFILL }},
7641 { &hf_rffpcnex_flags_delete_print_processor,
7642 { "Delete processor",
7643 "spoolss.rffpcnex.flags.delete_processor", FT_BOOLEAN, 32,
7644 TFS(&tfs_rffpcnex_flags_delete_print_processor),
7645 SPOOLSS_PRINTER_CHANGE_DELETE_PRINT_PROCESSOR,
7646 "Delete processor", HFILL }},
7648 { &hf_rffpcnex_flags_add_driver,
7649 { "Add driver", "spoolss.rffpcnex.flags.add_driver",
7650 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_add_driver),
7651 SPOOLSS_PRINTER_CHANGE_ADD_PRINTER_DRIVER, "Add driver",
7654 { &hf_rffpcnex_flags_set_driver,
7655 { "Set driver", "spoolss.rffpcnex.flags.set_driver",
7656 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_set_driver),
7657 SPOOLSS_PRINTER_CHANGE_SET_PRINTER_DRIVER, "Set driver",
7660 { &hf_rffpcnex_flags_delete_driver,
7661 { "Delete driver", "spoolss.rffpcnex.flags.delete_driver",
7662 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_delete_driver),
7663 SPOOLSS_PRINTER_CHANGE_DELETE_PRINTER_DRIVER,
7664 "Delete driver", HFILL }},
7666 { &hf_rffpcnex_flags_timeout,
7667 { "Timeout", "spoolss.rffpcnex.flags.timeout",
7668 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_timeout),
7669 SPOOLSS_PRINTER_CHANGE_TIMEOUT, "Timeout", HFILL }},
7671 { &hf_rffpcnex_flags_failed_printer_connection,
7672 { "Failed printer connection",
7673 "spoolss.rffpcnex.flags.failed_connection_printer",
7675 TFS(&tfs_rffpcnex_flags_failed_connection_printer),
7676 SPOOLSS_PRINTER_CHANGE_FAILED_CONNECTION_PRINTER,
7677 "Failed printer connection", HFILL }},
7681 { &hf_rrpcn_changelow,
7682 { "Change low", "spoolss.rrpcn.changelow", FT_UINT32,
7683 BASE_DEC, NULL, 0, "Change low", HFILL }},
7685 { &hf_rrpcn_changehigh,
7686 { "Change high", "spoolss.rrpcn.changehigh", FT_UINT32,
7687 BASE_DEC, NULL, 0, "Change high", HFILL }},
7690 { "Unknown 0", "spoolss.rrpcn.unk0", FT_UINT32, BASE_DEC,
7691 NULL, 0, "Unknown 0", HFILL }},
7694 { "Unknown 1", "spoolss.rrpcn.unk1", FT_UINT32, BASE_DEC,
7695 NULL, 0, "Unknown 1", HFILL }},
7697 /* ReplyOpenPrinter RPC */
7699 { &hf_replyopenprinter_unk0,
7700 { "Unknown 0", "spoolss.replyopenprinter.unk0", FT_UINT32,
7701 BASE_DEC, NULL, 0, "Unknown 0", HFILL }},
7703 { &hf_replyopenprinter_unk1,
7704 { "Unknown 1", "spoolss.replyopenprinter.unk1", FT_UINT32,
7705 BASE_DEC, NULL, 0, "Unknown 1", HFILL }},
7707 /* Printer attributes */
7709 { &hf_printer_attributes,
7710 { "Attributes", "spoolss.printer_attributes", FT_UINT32,
7711 BASE_HEX, NULL, 0, "Attributes", HFILL }},
7713 { &hf_printer_attributes_queued,
7714 { "Queued", "spoolss.printer_attributes.queued", FT_BOOLEAN,
7715 32, TFS(&tfs_printer_attributes_queued),
7716 PRINTER_ATTRIBUTE_QUEUED, "Queued", HFILL }},
7718 { &hf_printer_attributes_direct,
7719 { "Direct", "spoolss.printer_attributes.direct", FT_BOOLEAN,
7720 32, TFS(&tfs_printer_attributes_direct),
7721 PRINTER_ATTRIBUTE_DIRECT, "Direct", HFILL }},
7723 { &hf_printer_attributes_default,
7724 { "Default (9x/ME only)",
7725 "spoolss.printer_attributes.default",FT_BOOLEAN,
7726 32, TFS(&tfs_printer_attributes_default),
7727 PRINTER_ATTRIBUTE_DEFAULT, "Default", HFILL }},
7729 { &hf_printer_attributes_shared,
7730 { "Shared", "spoolss.printer_attributes.shared", FT_BOOLEAN,
7731 32, TFS(&tfs_printer_attributes_shared),
7732 PRINTER_ATTRIBUTE_SHARED, "Shared", HFILL }},
7734 { &hf_printer_attributes_network,
7735 { "Network", "spoolss.printer_attributes.network",
7736 FT_BOOLEAN, 32, TFS(&tfs_printer_attributes_network),
7737 PRINTER_ATTRIBUTE_NETWORK, "Network", HFILL }},
7739 { &hf_printer_attributes_hidden,
7740 { "Hidden", "spoolss.printer_attributes.hidden", FT_BOOLEAN,
7741 32, TFS(&tfs_printer_attributes_hidden),
7742 PRINTER_ATTRIBUTE_HIDDEN, "Hidden", HFILL }},
7744 { &hf_printer_attributes_local,
7745 { "Local", "spoolss.printer_attributes.local", FT_BOOLEAN,
7746 32, TFS(&tfs_printer_attributes_local),
7747 PRINTER_ATTRIBUTE_LOCAL, "Local", HFILL }},
7749 { &hf_printer_attributes_enable_devq,
7750 { "Enable devq", "spoolss.printer_attributes.enable_devq",
7751 FT_BOOLEAN, 32, TFS(&tfs_printer_attributes_enable_devq),
7752 PRINTER_ATTRIBUTE_ENABLE_DEVQ, "Enable evq", HFILL }},
7754 { &hf_printer_attributes_keep_printed_jobs,
7755 { "Keep printed jobs",
7756 "spoolss.printer_attributes.keep_printed_jobs", FT_BOOLEAN,
7757 32, TFS(&tfs_printer_attributes_keep_printed_jobs),
7758 PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS, "Keep printed jobs",
7761 { &hf_printer_attributes_do_complete_first,
7762 { "Do complete first",
7763 "spoolss.printer_attributes.do_complete_first", FT_BOOLEAN,
7764 32, TFS(&tfs_printer_attributes_do_complete_first),
7765 PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST, "Do complete first",
7768 { &hf_printer_attributes_work_offline,
7769 { "Work offline (9x/ME only)",
7770 "spoolss.printer_attributes.work_offline", FT_BOOLEAN,
7771 32, TFS(&tfs_printer_attributes_work_offline),
7772 PRINTER_ATTRIBUTE_WORK_OFFLINE, "Work offline", HFILL }},
7774 { &hf_printer_attributes_enable_bidi,
7775 { "Enable bidi (9x/ME only)",
7776 "spoolss.printer_attributes.enable_bidi", FT_BOOLEAN,
7777 32, TFS(&tfs_printer_attributes_enable_bidi),
7778 PRINTER_ATTRIBUTE_ENABLE_BIDI, "Enable bidi", HFILL }},
7780 { &hf_printer_attributes_raw_only,
7781 { "Raw only", "spoolss.printer_attributes.raw_only",
7782 FT_BOOLEAN, 32, TFS(&tfs_printer_attributes_raw_only),
7783 PRINTER_ATTRIBUTE_RAW_ONLY, "Raw only", HFILL }},
7785 { &hf_printer_attributes_published,
7786 { "Published", "spoolss.printer_attributes.published",
7787 FT_BOOLEAN, 32, TFS(&tfs_printer_attributes_published),
7788 PRINTER_ATTRIBUTE_PUBLISHED, "Published", HFILL }},
7793 { "Year", "spoolss.time.year", FT_UINT32, BASE_DEC,
7794 NULL, 0x0, "Year", HFILL }},
7797 { "Month", "spoolss.time.month", FT_UINT32, BASE_DEC,
7798 NULL, 0x0, "Month", HFILL }},
7801 { "Day of week", "spoolss.time.dow", FT_UINT32, BASE_DEC,
7802 NULL, 0x0, "Day of week", HFILL }},
7805 { "Day", "spoolss.time.day", FT_UINT32, BASE_DEC,
7806 NULL, 0x0, "Day", HFILL }},
7809 { "Hour", "spoolss.time.hour", FT_UINT32, BASE_DEC,
7810 NULL, 0x0, "Hour", HFILL }},
7813 { "Minute", "spoolss.time.minute", FT_UINT32, BASE_DEC,
7814 NULL, 0x0, "Minute", HFILL }},
7817 { "Second", "spoolss.time.second", FT_UINT32, BASE_DEC,
7818 NULL, 0x0, "Second", HFILL }},
7821 { "Millisecond", "spoolss.time.msec", FT_UINT32, BASE_DEC,
7822 NULL, 0x0, "Millisecond", HFILL }},
7826 { &hf_userlevel_size,
7827 { "Size", "spoolss.userlevel.size",
7828 FT_UINT32, BASE_DEC, NULL, 0, "Size", HFILL }},
7830 { &hf_userlevel_client,
7831 { "Client", "spoolss.userlevel.client", FT_STRING,
7832 BASE_NONE, NULL, 0, "Client", HFILL }},
7834 { &hf_userlevel_user,
7835 { "User", "spoolss.userlevel.user", FT_STRING,
7836 BASE_NONE, NULL, 0, "User", HFILL }},
7838 { &hf_userlevel_build,
7839 { "Build", "spoolss.userlevel.build",
7840 FT_UINT32, BASE_DEC, NULL, 0, "Build", HFILL }},
7842 { &hf_userlevel_major,
7843 { "Major", "spoolss.userlevel.major",
7844 FT_UINT32, BASE_DEC, NULL, 0, "Major", HFILL }},
7846 { &hf_userlevel_minor,
7847 { "Minor", "spoolss.userlevel.minor",
7848 FT_UINT32, BASE_DEC, NULL, 0, "Minor", HFILL }},
7850 { &hf_userlevel_processor,
7851 { "Processor", "spoolss.userlevel.processor",
7852 FT_UINT32, BASE_DEC, NULL, 0, "Processor", HFILL }},
7854 /* EnumprinterdataEx RPC */
7856 { &hf_enumprinterdataex_num_values,
7857 { "Num values", "spoolss.enumprinterdataex.num_values",
7858 FT_UINT32, BASE_DEC, NULL, 0x0,
7859 "Number of values returned", HFILL }},
7861 { &hf_enumprinterdataex_name_offset,
7862 { "Name offset", "spoolss.enumprinterdataex.name_offset",
7863 FT_UINT32, BASE_DEC, NULL, 0x0,
7864 "Name offset", HFILL }},
7866 { &hf_enumprinterdataex_name_len,
7867 { "Name len", "spoolss.enumprinterdataex.name_len",
7868 FT_UINT32, BASE_DEC, NULL, 0x0,
7869 "Name len", HFILL }},
7871 { &hf_enumprinterdataex_name,
7872 { "Name", "spoolss.enumprinterdataex.name",
7873 FT_STRING, BASE_NONE, NULL, 0, "Name", HFILL }},
7875 { &hf_enumprinterdataex_val_type,
7876 { "Value type", "spoolss.enumprinterdataex.value_type",
7877 FT_UINT32, BASE_DEC, NULL, 0x0,
7878 "Value type", HFILL }},
7880 { &hf_enumprinterdataex_val_offset,
7881 { "Value offset", "spoolss.enumprinterdataex.value_offset",
7882 FT_UINT32, BASE_DEC, NULL, 0x0,
7883 "Value offset", HFILL }},
7885 { &hf_enumprinterdataex_val_len,
7886 { "Value len", "spoolss.enumprinterdataex.value_len",
7887 FT_UINT32, BASE_DEC, NULL, 0x0,
7888 "Value len", HFILL }},
7890 { &hf_enumprinterdataex_val_dword_high,
7891 { "DWORD value (high)",
7892 "spoolss.enumprinterdataex.val_dword.high",
7893 FT_UINT16, BASE_DEC, NULL, 0x0,
7894 "DWORD value (high)", HFILL }},
7896 { &hf_enumprinterdataex_val_dword_low,
7897 { "DWORD value (low)",
7898 "spoolss.enumprinterdataex.val_dword.low",
7899 FT_UINT16, BASE_DEC, NULL, 0x0,
7900 "DWORD value (low)", HFILL }},
7902 { &hf_enumprinterdataex_val_sz,
7903 { "SZ value", "spoolss.printerdata.val_sz",
7904 FT_STRING, BASE_NONE, NULL, 0, "SZ value", HFILL }},
7906 /* RouterReplyPrinter RPC */
7908 { &hf_routerreplyprinter_condition,
7909 { "Condition", "spoolss.routerreplyprinter.condition",
7910 FT_UINT32, BASE_DEC, NULL, 0, "Condition", HFILL }},
7912 { &hf_routerreplyprinter_unknown1,
7913 { "Unknown1", "spoolss.routerreplyprinter.unknown1",
7914 FT_UINT32, BASE_DEC, NULL, 0, "Unknown1", HFILL }},
7916 { &hf_routerreplyprinter_changeid,
7917 { "Change id", "spoolss.routerreplyprinter.changeid",
7918 FT_UINT32, BASE_DEC, NULL, 0, "Change id", HFILL }},
7920 /* EnumPrinterKey RPC */
7922 { &hf_keybuffer_size,
7923 { "Key Buffer size", "spoolss.keybuffer.size", FT_UINT32,
7924 BASE_DEC, NULL, 0x0, "Size of buffer", HFILL }},
7926 { &hf_keybuffer_data,
7927 { "Key Buffer data", "spoolss.keybuffer.data", FT_BYTES,
7928 BASE_HEX, NULL, 0x0, "Contents of buffer", HFILL }},
7933 { "Set job command", "spoolss.setjob.cmd", FT_UINT32,
7934 BASE_DEC, VALS(setjob_commands), 0x0, "Printer data name",
7939 { &hf_enumjobs_firstjob,
7940 { "First job", "spoolss.enumjobs.firstjob", FT_UINT32,
7941 BASE_DEC, NULL, 0x0, "Index of first job to return",
7944 { &hf_enumjobs_numjobs,
7945 { "Num jobs", "spoolss.enumjobs.numjobs", FT_UINT32,
7946 BASE_DEC, NULL, 0x0, "Number of jobs to return", HFILL }},
7948 /* Security descriptor buffer */
7950 { &hf_secdescbuf_maxlen,
7951 { "Max len", "secdescbuf.max_len",
7952 FT_UINT32, BASE_DEC, NULL, 0, "Max len", HFILL }},
7954 { &hf_secdescbuf_undoc,
7955 { "Undocumented", "secdescbuf.undoc",
7956 FT_UINT32, BASE_DEC, NULL, 0, "Undocumented", HFILL }},
7958 { &hf_secdescbuf_len,
7959 { "Length", "secdescbuf.len",
7960 FT_UINT32, BASE_DEC, NULL, 0, "Length", HFILL }},
7962 /* Spool printer info */
7964 { &hf_spool_printer_info_devmode_ptr,
7965 { "Devmode pointer", "spoolprinterinfo.devmode_ptr",
7966 FT_UINT32, BASE_HEX, NULL, 0, "Devmode pointer", HFILL }},
7968 { &hf_spool_printer_info_secdesc_ptr,
7969 { "Secdesc pointer", "spoolprinterinfo.secdesc_ptr",
7970 FT_UINT32, BASE_HEX, NULL, 0, "Secdesc pointer", HFILL }},
7972 /* WritePrinter RPC */
7974 { &hf_writeprinter_numwritten,
7975 { "Num written", "spoolss.writeprinter.numwritten",
7976 FT_UINT32, BASE_DEC, NULL, 0x0, "Number of bytes written",
7979 /* Setprinterdataex RPC */
7981 { &hf_setprinterdataex_max_len,
7982 { "Max len", "setprinterdataex.max_len",
7983 FT_UINT32, BASE_DEC, NULL, 0, "Max len", HFILL }},
7985 { &hf_setprinterdataex_real_len,
7986 { "Real len", "setprinterdataex.real_len",
7987 FT_UINT32, BASE_DEC, NULL, 0, "Real len", HFILL }},
7989 { &hf_setprinterdataex_data,
7990 { "Data", "setprinterdataex.data",
7991 FT_BYTES, BASE_HEX, NULL, 0, "Data", HFILL }},
7993 /* Specific access rights */
7995 { &hf_access_required,
7996 { "Access required", "spoolss.access_required",
7997 FT_UINT32, BASE_HEX, NULL, 0x0, "Access required",
8000 { &hf_server_access_admin,
8001 { "Server admin", "spoolss.access_mask.server_admin",
8002 FT_BOOLEAN, 32, TFS(&flags_set_truth),
8003 SERVER_ACCESS_ADMINISTER, "Server admin", HFILL }},
8005 { &hf_server_access_enum,
8006 { "Server enum", "spoolss.access_mask.server_enum",
8007 FT_BOOLEAN, 32, TFS(&flags_set_truth),
8008 SERVER_ACCESS_ENUMERATE, "Server enum", HFILL }},
8010 { &hf_printer_access_admin,
8011 { "Printer admin", "spoolss.access_mask.printer_admin",
8012 FT_BOOLEAN, 32, TFS(&flags_set_truth),
8013 PRINTER_ACCESS_ADMINISTER, "Printer admin", HFILL }},
8015 { &hf_printer_access_use,
8016 { "Printer use", "spoolss.access_mask.printer_use",
8017 FT_BOOLEAN, 32, TFS(&flags_set_truth),
8018 PRINTER_ACCESS_USE, "Printer use", HFILL }},
8020 { &hf_job_access_admin,
8021 { "Job admin", "spoolss.access_mask.job_admin",
8022 FT_BOOLEAN, 32, TFS(&flags_set_truth),
8023 JOB_ACCESS_ADMINISTER, "Job admin", HFILL }},
8025 /* Printer information */
8027 { &hf_printer_cjobs,
8028 { "CJobs", "spoolss.printer.cjobs", FT_UINT32,
8029 BASE_DEC, NULL, 0, "CJobs", HFILL }},
8031 { &hf_printer_total_jobs,
8032 { "Total jobs", "spoolss.printer.total_jobs", FT_UINT32,
8033 BASE_DEC, NULL, 0, "Total jobs", HFILL }},
8035 { &hf_printer_total_bytes,
8036 { "Total bytes", "spoolss.printer.total_bytes", FT_UINT32,
8037 BASE_DEC, NULL, 0, "Total bytes", HFILL }},
8039 { &hf_printer_global_counter,
8040 { "Global counter", "spoolss.printer.global_counter",
8041 FT_UINT32, BASE_DEC, NULL, 0, "Global counter", HFILL }},
8043 { &hf_printer_total_pages,
8044 { "Total pages", "spoolss.printer.total_pages", FT_UINT32,
8045 BASE_DEC, NULL, 0, "Total pages", HFILL }},
8047 { &hf_printer_major_version,
8048 { "Major version", "spoolss.printer.major_version",
8049 FT_UINT16, BASE_DEC, NULL, 0, "Major version", HFILL }},
8051 { &hf_printer_build_version,
8052 { "Build version", "spoolss.printer.build_version",
8053 FT_UINT16, BASE_DEC, NULL, 0, "Build version", HFILL }},
8056 { "Unknown 7", "spoolss.printer.unknown7", FT_UINT32,
8057 BASE_DEC, NULL, 0, "Unknown 7", HFILL }},
8060 { "Unknown 8", "spoolss.printer.unknown8", FT_UINT32,
8061 BASE_DEC, NULL, 0, "Unknown 8", HFILL }},
8064 { "Unknown 9", "spoolss.printer.unknown9", FT_UINT32,
8065 BASE_DEC, NULL, 0, "Unknown 9", HFILL }},
8067 { &hf_printer_session_ctr,
8068 { "Session counter", "spoolss.printer.session_ctr",
8069 FT_UINT32, BASE_DEC, NULL, 0, "Sessopm counter", HFILL }},
8071 { &hf_printer_unk11,
8072 { "Unknown 11", "spoolss.printer.unknown11", FT_UINT32,
8073 BASE_DEC, NULL, 0, "Unknown 11", HFILL }},
8075 { &hf_printer_printer_errors,
8076 { "Printer errors", "spoolss.printer.printer_errors",
8077 FT_UINT32, BASE_DEC, NULL, 0, "Printer errors", HFILL }},
8079 { &hf_printer_unk13,
8080 { "Unknown 13", "spoolss.printer.unknown13", FT_UINT32,
8081 BASE_DEC, NULL, 0, "Unknown 13", HFILL }},
8083 { &hf_printer_unk14,
8084 { "Unknown 14", "spoolss.printer.unknown14", FT_UINT32,
8085 BASE_DEC, NULL, 0, "Unknown 14", HFILL }},
8087 { &hf_printer_unk15,
8088 { "Unknown 15", "spoolss.printer.unknown15", FT_UINT32,
8089 BASE_DEC, NULL, 0, "Unknown 15", HFILL }},
8091 { &hf_printer_unk16,
8092 { "Unknown 16", "spoolss.printer.unknown16", FT_UINT32,
8093 BASE_DEC, NULL, 0, "Unknown 16", HFILL }},
8095 { &hf_printer_changeid,
8096 { "Change id", "spoolss.printer.changeid", FT_UINT32,
8097 BASE_DEC, NULL, 0, "Change id", HFILL }},
8099 { &hf_printer_unk18,
8100 { "Unknown 18", "spoolss.printer.unknown18", FT_UINT32,
8101 BASE_DEC, NULL, 0, "Unknown 18", HFILL }},
8103 { &hf_printer_unk20,
8104 { "Unknown 20", "spoolss.printer.unknown20", FT_UINT32,
8105 BASE_DEC, NULL, 0, "Unknown 20", HFILL }},
8107 { &hf_printer_c_setprinter,
8108 { "Csetprinter", "spoolss.printer.c_setprinter",
8109 FT_UINT32, BASE_DEC, NULL, 0, "Csetprinter", HFILL }},
8111 { &hf_printer_unk22,
8112 { "Unknown 22", "spoolss.printer.unknown22",
8113 FT_UINT16, BASE_DEC, NULL, 0, "Unknown 22", HFILL }},
8115 { &hf_printer_unk23,
8116 { "Unknown 23", "spoolss.printer.unknown23",
8117 FT_UINT16, BASE_DEC, NULL, 0, "Unknown 23", HFILL }},
8119 { &hf_printer_unk24,
8120 { "Unknown 24", "spoolss.printer.unknown24",
8121 FT_UINT16, BASE_DEC, NULL, 0, "Unknown 24", HFILL }},
8123 { &hf_printer_unk25,
8124 { "Unknown 25", "spoolss.printer.unknown25",
8125 FT_UINT16, BASE_DEC, NULL, 0, "Unknown 25", HFILL }},
8127 { &hf_printer_unk26,
8128 { "Unknown 26", "spoolss.printer.unknown26",
8129 FT_UINT16, BASE_DEC, NULL, 0, "Unknown 26", HFILL }},
8131 { &hf_printer_unk27,
8132 { "Unknown 27", "spoolss.printer.unknown27",
8133 FT_UINT16, BASE_DEC, NULL, 0, "Unknown 27", HFILL }},
8135 { &hf_printer_unk28,
8136 { "Unknown 28", "spoolss.printer.unknown28",
8137 FT_UINT16, BASE_DEC, NULL, 0, "Unknown 28", HFILL }},
8139 { &hf_printer_unk29,
8140 { "Unknown 29", "spoolss.printer.unknown29",
8141 FT_UINT16, BASE_DEC, NULL, 0, "Unknown 29", HFILL }},
8143 { &hf_printer_flags,
8144 { "Flags", "spoolss.printer.flags",
8145 FT_UINT32, BASE_HEX, NULL, 0, "Flags", HFILL }},
8148 { "GUID", "spoolss.printer.guid", FT_STRING,
8149 BASE_NONE, NULL, 0, "GUID", HFILL }},
8151 { &hf_printer_action,
8152 { "Action", "spoolss.printer.action", FT_UINT32, BASE_DEC,
8153 VALS(getprinter_action_vals), 0, "Action", HFILL }},
8156 static gint *ett[] = {
8157 &ett_dcerpc_spoolss,
8158 &ett_PRINTER_DATATYPE,
8161 &ett_DEVMODE_fields,
8162 &ett_USER_LEVEL_CTR,
8166 &ett_SPOOL_PRINTER_INFO_LEVEL,
8167 &ett_PRINTER_INFO_0,
8168 &ett_PRINTER_INFO_1,
8169 &ett_PRINTER_INFO_2,
8170 &ett_PRINTER_INFO_3,
8171 &ett_PRINTER_INFO_7,
8184 &ett_printerdata_value,
8185 &ett_printerdata_data,
8186 &ett_writeprinter_buffer,
8189 &ett_rffpcnex_flags,
8190 &ett_notify_options_flags,
8191 &ett_NOTIFY_INFO_DATA,
8193 &ett_printer_attributes,
8195 &ett_enumprinters_flags,
8196 &ett_PRINTER_DATA_CTR,
8197 &ett_printer_enumdataex_value,
8200 proto_dcerpc_spoolss = proto_register_protocol(
8201 "Microsoft Spool Subsystem", "SPOOLSS", "spoolss");
8203 proto_register_field_array(proto_dcerpc_spoolss, hf, array_length(hf));
8205 proto_register_subtree_array(ett, array_length(ett));
8208 /* Protocol handoff */
8210 static e_uuid_t uuid_dcerpc_spoolss = {
8211 0x12345678, 0x1234, 0xabcd,
8212 { 0xef, 0x00, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab }
8215 static guint16 ver_dcerpc_spoolss = 1;
8218 proto_reg_handoff_dcerpc_spoolss(void)
8221 /* Register protocol as dcerpc */
8223 dcerpc_init_uuid(proto_dcerpc_spoolss, ett_dcerpc_spoolss,
8224 &uuid_dcerpc_spoolss, ver_dcerpc_spoolss,
8225 dcerpc_spoolss_dissectors, hf_opnum);