1 /* packet-dcerpc-spoolss.c
2 * Routines for SMB \PIPE\spoolss packet disassembly
3 * Copyright 2001-2003, Tim Potter <tpot@samba.org>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
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 <epan/emem.h>
41 #include "packet-dcerpc.h"
42 #include "packet-dcerpc-nt.h"
43 #include "packet-dcerpc-spoolss.h"
44 #include "packet-windows-common.h"
46 /* GetPrinterDriver2 */
48 static int hf_clientmajorversion = -1;
49 static int hf_clientminorversion = -1;
50 static int hf_servermajorversion = -1;
51 static int hf_serverminorversion = -1;
52 static int hf_driverpath = -1;
53 static int hf_datafile = -1;
54 static int hf_configfile = -1;
55 static int hf_helpfile = -1;
56 static int hf_monitorname = -1;
57 static int hf_defaultdatatype = -1;
58 static int hf_driverinfo_cversion = -1;
59 static int hf_dependentfiles = -1;
60 static int hf_previousdrivernames = -1;
61 static int hf_driverdate = -1;
62 static int hf_padding = -1;
63 static int hf_driver_version_low = -1;
64 static int hf_driver_version_high = -1;
65 static int hf_mfgname = -1;
66 static int hf_oemurl = -1;
67 static int hf_hardwareid= -1;
68 static int hf_provider = -1;
74 static int hf_start_time = -1;
75 static int hf_end_time = -1;
76 static int hf_elapsed_time = -1;
78 /****************************************************************************/
81 * New hf index values - I'm in the process of doing a bit of a cleanup -tpot
84 static int hf_opnum = -1;
85 static int hf_hnd = -1;
86 static int hf_rc = -1;
87 static int hf_offered = -1;
88 static int hf_needed = -1;
89 static int hf_returned = -1;
90 static int hf_buffer_size = -1;
91 static int hf_buffer_data = -1;
92 static int hf_offset = -1;
93 static int hf_level = -1;
94 static int hf_access_required = -1;
96 static int hf_printername = -1;
97 static int hf_machinename = -1;
98 static int hf_notifyname = -1;
99 static int hf_printerdesc = -1;
100 static int hf_printercomment = -1;
101 static int hf_servername = -1;
102 static int hf_sharename = -1;
103 static int hf_portname = -1;
104 static int hf_printerlocation = -1;
105 static int hf_drivername = -1;
106 static int hf_architecture = -1;
107 static int hf_username = -1;
108 static int hf_documentname = -1;
109 static int hf_outputfile = -1;
110 static int hf_datatype = -1;
111 static int hf_textstatus = -1;
112 static int hf_sepfile = -1;
113 static int hf_printprocessor = -1;
114 static int hf_parameters = -1;
116 /* Printer information */
118 static int hf_printer_cjobs = -1;
119 static int hf_printer_total_jobs = -1;
120 static int hf_printer_total_bytes = -1;
121 static int hf_printer_global_counter = -1;
122 static int hf_printer_total_pages = -1;
123 static int hf_printer_major_version = -1;
124 static int hf_printer_build_version = -1;
125 static int hf_printer_unk7 = -1;
126 static int hf_printer_unk8 = -1;
127 static int hf_printer_unk9 = -1;
128 static int hf_printer_session_ctr = -1;
129 static int hf_printer_unk11 = -1;
130 static int hf_printer_printer_errors = -1;
131 static int hf_printer_unk13 = -1;
132 static int hf_printer_unk14 = -1;
133 static int hf_printer_unk15 = -1;
134 static int hf_printer_unk16 = -1;
135 static int hf_printer_changeid = -1;
136 static int hf_printer_unk18 = -1;
137 static int hf_printer_unk20 = -1;
138 static int hf_printer_c_setprinter = -1;
139 static int hf_printer_unk22 = -1;
140 static int hf_printer_unk23 = -1;
141 static int hf_printer_unk24 = -1;
142 static int hf_printer_unk25 = -1;
143 static int hf_printer_unk26 = -1;
144 static int hf_printer_unk27 = -1;
145 static int hf_printer_unk28 = -1;
146 static int hf_printer_unk29 = -1;
147 static int hf_printer_flags = -1;
148 static int hf_printer_priority = -1;
149 static int hf_printer_default_priority = -1;
150 static int hf_printer_jobs = -1;
151 static int hf_printer_averageppm = -1;
152 static int hf_printer_guid = -1;
153 static int hf_printer_action = -1;
157 static int hf_printerdata = -1;
158 static int hf_printerdata_key = -1;
159 static int hf_printerdata_value = -1;
160 static int hf_printerdata_type = -1;
161 static int hf_printerdata_size = -1; /* Length of printer data */
162 static int hf_printerdata_data = -1;
163 static int hf_printerdata_data_sz = -1;
164 static int hf_printerdata_data_dword = -1;
168 static int hf_devmodectr_size = -1;
170 static int hf_devmode = -1;
171 static int hf_devmode_size = -1;
172 static int hf_devmode_spec_version = -1;
173 static int hf_devmode_driver_version = -1;
174 static int hf_devmode_size2 = -1;
175 static int hf_devmode_driver_extra_len = -1;
176 static int hf_devmode_fields = -1;
177 static int hf_devmode_orientation = -1;
178 static int hf_devmode_paper_size = -1;
179 static int hf_devmode_paper_width = -1;
180 static int hf_devmode_paper_length = -1;
181 static int hf_devmode_scale = -1;
182 static int hf_devmode_copies = -1;
183 static int hf_devmode_default_source = -1;
184 static int hf_devmode_print_quality = -1;
185 static int hf_devmode_color = -1;
186 static int hf_devmode_duplex = -1;
187 static int hf_devmode_y_resolution = -1;
188 static int hf_devmode_tt_option = -1;
189 static int hf_devmode_collate = -1;
190 static int hf_devmode_log_pixels = -1;
191 static int hf_devmode_bits_per_pel = -1;
192 static int hf_devmode_pels_width = -1;
193 static int hf_devmode_pels_height = -1;
194 static int hf_devmode_display_flags = -1;
195 static int hf_devmode_display_freq = -1;
196 static int hf_devmode_icm_method = -1;
197 static int hf_devmode_icm_intent = -1;
198 static int hf_devmode_media_type = -1;
199 static int hf_devmode_dither_type = -1;
200 static int hf_devmode_reserved1 = -1;
201 static int hf_devmode_reserved2 = -1;
202 static int hf_devmode_panning_width = -1;
203 static int hf_devmode_panning_height = -1;
204 static int hf_devmode_driver_extra = -1;
206 static int hf_devmode_fields_orientation = -1;
207 static int hf_devmode_fields_papersize = -1;
208 static int hf_devmode_fields_paperlength = -1;
209 static int hf_devmode_fields_paperwidth = -1;
210 static int hf_devmode_fields_scale = -1;
211 static int hf_devmode_fields_position = -1;
212 static int hf_devmode_fields_nup = -1;
213 static int hf_devmode_fields_copies = -1;
214 static int hf_devmode_fields_defaultsource = -1;
215 static int hf_devmode_fields_printquality = -1;
216 static int hf_devmode_fields_color = -1;
217 static int hf_devmode_fields_duplex = -1;
218 static int hf_devmode_fields_yresolution = -1;
219 static int hf_devmode_fields_ttoption = -1;
220 static int hf_devmode_fields_collate = -1;
221 static int hf_devmode_fields_formname = -1;
222 static int hf_devmode_fields_logpixels = -1;
223 static int hf_devmode_fields_bitsperpel = -1;
224 static int hf_devmode_fields_pelswidth = -1;
225 static int hf_devmode_fields_pelsheight = -1;
226 static int hf_devmode_fields_displayflags = -1;
227 static int hf_devmode_fields_displayfrequency = -1;
228 static int hf_devmode_fields_icmmethod = -1;
229 static int hf_devmode_fields_icmintent = -1;
230 static int hf_devmode_fields_mediatype = -1;
231 static int hf_devmode_fields_dithertype = -1;
232 static int hf_devmode_fields_panningwidth = -1;
233 static int hf_devmode_fields_panningheight = -1;
237 static int hf_job_id = -1;
238 static int hf_job_priority = -1;
239 static int hf_job_position = -1;
240 static int hf_job_totalpages = -1;
241 static int hf_job_totalbytes = -1;
242 static int hf_job_pagesprinted = -1;
243 static int hf_job_bytesprinted = -1;
244 static int hf_job_size = -1;
246 static int hf_job_status = -1;
247 static int hf_job_status_paused = -1;
248 static int hf_job_status_error = -1;
249 static int hf_job_status_deleting = -1;
250 static int hf_job_status_spooling = -1;
251 static int hf_job_status_printing = -1;
252 static int hf_job_status_offline = -1;
253 static int hf_job_status_paperout = -1;
254 static int hf_job_status_printed = -1;
255 static int hf_job_status_deleted = -1;
256 static int hf_job_status_blocked = -1;
257 static int hf_job_status_user_intervention = -1;
261 static int hf_form = -1;
262 static int hf_form_level = -1;
263 static int hf_form_name = -1;
264 static int hf_form_flags = -1;
265 static int hf_form_unknown = -1;
266 static int hf_form_width = -1;
267 static int hf_form_height = -1;
268 static int hf_form_left_margin = -1;
269 static int hf_form_top_margin = -1;
270 static int hf_form_horiz_len = -1;
271 static int hf_form_vert_len = -1;
273 static int hf_enumforms_num = -1;
277 static int hf_notify_options_version = -1;
278 static int hf_notify_options_flags = -1;
279 static int hf_notify_options_flags_refresh = -1;
280 static int hf_notify_options_count = -1;
281 static int hf_notify_option_type = -1;
282 static int hf_notify_option_reserved1 = -1;
283 static int hf_notify_option_reserved2 = -1;
284 static int hf_notify_option_reserved3 = -1;
285 static int hf_notify_option_count = -1;
286 static int hf_notify_option_data_count = -1;
287 static int hf_notify_info_count = -1;
288 static int hf_notify_info_version = -1;
289 static int hf_notify_info_flags = -1;
290 static int hf_notify_info_data_type = -1;
291 static int hf_notify_info_data_count = -1;
292 static int hf_notify_info_data_id = -1;
293 static int hf_notify_info_data_value1 = -1;
294 static int hf_notify_info_data_value2 = -1;
295 static int hf_notify_info_data_bufsize = -1;
296 static int hf_notify_info_data_buffer = -1;
297 static int hf_notify_info_data_buffer_len = -1;
298 static int hf_notify_info_data_buffer_data = -1;
300 static int hf_notify_field = -1;
302 static int hf_printerlocal = -1;
304 static int hf_rrpcn_changelow = -1;
305 static int hf_rrpcn_changehigh = -1;
306 static int hf_rrpcn_unk0 = -1;
307 static int hf_rrpcn_unk1 = -1;
309 static int hf_replyopenprinter_unk0 = -1;
310 static int hf_replyopenprinter_unk1 = -1;
312 /* Registry data types */
314 #define DCERPC_REG_NONE 0
315 #define DCERPC_REG_SZ 1
316 #define DCERPC_REG_EXPAND_SZ 2
317 #define DCERPC_REG_BINARY 3
318 #define DCERPC_REG_DWORD 4
319 #define DCERPC_REG_DWORD_LE 4 /* DWORD, little endian
321 #define DCERPC_REG_DWORD_BE 5 /* DWORD, big endian */
322 #define DCERPC_REG_LINK 6
323 #define DCERPC_REG_MULTI_SZ 7
324 #define DCERPC_REG_RESOURCE_LIST 8
325 #define DCERPC_REG_FULL_RESOURCE_DESCRIPTOR 9
326 #define DCERPC_REG_RESOURCE_REQUIREMENTS_LIST 10
328 const value_string reg_datatypes[] = {
329 { DCERPC_REG_NONE, "REG_NONE" },
330 { DCERPC_REG_SZ, "REG_SZ" },
331 { DCERPC_REG_EXPAND_SZ, "REG_EXPAND_SZ" },
332 { DCERPC_REG_BINARY, "REG_BINARY" },
333 { DCERPC_REG_DWORD, "REG_DWORD" },
334 { DCERPC_REG_DWORD_LE, "REG_DWORD_LE" },
335 { DCERPC_REG_DWORD_BE, "REG_DWORD_BE" },
336 { DCERPC_REG_LINK, "REG_LINK" },
337 { DCERPC_REG_MULTI_SZ, "REG_MULTI_SZ" },
338 { DCERPC_REG_RESOURCE_LIST, "REG_RESOURCE_LIST" },
339 { DCERPC_REG_FULL_RESOURCE_DESCRIPTOR, "REG_FULL_RESOURCE_DESCRIPTOR" }, { DCERPC_REG_RESOURCE_REQUIREMENTS_LIST, "REG_RESOURCE_REQUIREMENTS_LIST" },
343 /****************************************************************************/
346 * Dissect SPOOLSS specific access rights
349 static int hf_server_access_admin = -1;
350 static int hf_server_access_enum = -1;
351 static int hf_printer_access_admin = -1;
352 static int hf_printer_access_use = -1;
353 static int hf_job_access_admin = -1;
356 spoolss_printer_specific_rights(tvbuff_t *tvb, gint offset, proto_tree *tree,
359 proto_tree_add_boolean(
360 tree, hf_printer_access_use, tvb, offset, 4, access);
362 proto_tree_add_boolean(
363 tree, hf_printer_access_admin, tvb, offset, 4, access);
366 struct access_mask_info spoolss_printer_access_mask_info = {
368 spoolss_printer_specific_rights,
369 NULL, /* Generic mapping table */
370 NULL /* Standard mapping table */
374 spoolss_printserver_specific_rights(tvbuff_t *tvb, gint offset,
375 proto_tree *tree, guint32 access)
377 proto_tree_add_boolean(
378 tree, hf_server_access_enum, tvb, offset, 4, access);
380 proto_tree_add_boolean(
381 tree, hf_server_access_admin, tvb, offset, 4, access);
384 struct access_mask_info spoolss_printserver_access_mask_info = {
385 "SPOOLSS print server",
386 spoolss_printserver_specific_rights,
387 NULL, /* Generic mapping table */
388 NULL /* Standard mapping table */
392 spoolss_job_specific_rights(tvbuff_t *tvb, gint offset,
393 proto_tree *tree, guint32 access)
395 proto_tree_add_boolean(
396 tree, hf_job_access_admin, tvb, offset, 4, access);
399 struct access_mask_info spoolss_job_access_mask_info = {
401 spoolss_job_specific_rights,
402 NULL, /* Generic mapping table */
403 NULL /* Standard mapping table */
407 * Routines to dissect a spoolss BUFFER
412 proto_item *tree; /* Proto tree buffer located in */
416 static gint ett_BUFFER = -1;
419 dissect_spoolss_buffer_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
420 proto_tree *tree, guint8 *drep)
422 dcerpc_info *di = pinfo->private_data;
423 BUFFER *b = (BUFFER *)di->private_data;
428 if (di->conformant_run)
431 /* Dissect size and data */
433 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
434 hf_buffer_size, &size);
436 offset = dissect_ndr_uint8s(tvb, offset, pinfo, NULL, drep,
437 hf_buffer_data, size, &data);
439 item = proto_tree_add_item(
440 tree, hf_buffer_data, tvb, offset - size,
441 size, drep[0] & 0x10);
443 /* Return buffer info */
447 /* I'm not sure about this. Putting the buffer into
448 it's own tvb makes sense and the dissection code is
449 much clearer, but the data is a proper subset of
450 the actual tvb. Not adding the new data source
451 makes the hex display confusing as it switches
452 between the 'DCERPC over SMB' tvb and the buffer
453 tvb with no visual cues as to what is going on. */
455 b->tvb = tvb_new_child_real_data(tvb, data, size, size);
456 add_new_data_source(pinfo, b->tvb, "SPOOLSS buffer");
459 b->tree = proto_item_add_subtree(item, ett_BUFFER);
465 /* Dissect a spoolss buffer and return buffer data */
468 dissect_spoolss_buffer(tvbuff_t *tvb, gint offset, packet_info *pinfo,
469 proto_tree *tree, guint8 *drep, BUFFER *b)
471 dcerpc_info *di = pinfo->private_data;
474 memset(b, 0, sizeof(BUFFER));
476 di->private_data = b;
478 offset = dissect_ndr_pointer(
479 tvb, offset, pinfo, tree, drep,
480 dissect_spoolss_buffer_data, NDR_POINTER_UNIQUE,
490 static gint ett_SYSTEM_TIME = -1;
492 static int hf_time_year = -1;
493 static int hf_time_month = -1;
494 static int hf_time_dow = -1;
495 static int hf_time_day = -1;
496 static int hf_time_hour = -1;
497 static int hf_time_minute = -1;
498 static int hf_time_second = -1;
499 static int hf_time_msec = -1;
502 dissect_SYSTEM_TIME(tvbuff_t *tvb, int offset, packet_info *pinfo,
503 proto_tree *tree, guint8 *drep, const char *name,
504 gboolean add_subtree, char **data)
506 proto_item *item = NULL;
507 proto_tree *subtree = tree;
508 guint16 year, month, day, hour, minute, second, millisecond;
512 item = proto_tree_add_text(tree, tvb, offset, 16, "%s", name);
513 subtree = proto_item_add_subtree(item, ett_SYSTEM_TIME);
516 offset = dissect_ndr_uint16(
517 tvb, offset, pinfo, subtree, drep, hf_time_year, &year);
519 offset = dissect_ndr_uint16(
520 tvb, offset, pinfo, subtree, drep, hf_time_month, &month);
522 offset = dissect_ndr_uint16(
523 tvb, offset, pinfo, subtree, drep, hf_time_dow, NULL);
525 offset = dissect_ndr_uint16(
526 tvb, offset, pinfo, subtree, drep, hf_time_day, &day);
528 offset = dissect_ndr_uint16(
529 tvb, offset, pinfo, subtree, drep, hf_time_hour, &hour);
531 offset = dissect_ndr_uint16(
532 tvb, offset, pinfo, subtree, drep, hf_time_minute, &minute);
534 offset = dissect_ndr_uint16(
535 tvb, offset, pinfo, subtree, drep, hf_time_second, &second);
537 offset = dissect_ndr_uint16(
538 tvb, offset, pinfo, subtree, drep, hf_time_msec, &millisecond);
540 str = ep_strdup_printf("%d/%02d/%02d %02d:%02d:%02d.%03d",
541 year, month, day, hour, minute, second,
545 proto_item_append_text(item, ": %s", str);
554 dissect_SYSTEM_TIME_ptr(tvbuff_t *tvb, int offset, packet_info *pinfo,
555 proto_tree *tree, guint8 *drep)
557 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
558 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
562 offset = dissect_SYSTEM_TIME(
563 tvb, offset, pinfo, tree, drep, NULL, FALSE, &str);
564 dcv->private_data = str;
570 * SpoolssClosePrinter
573 static int SpoolssClosePrinter_q(tvbuff_t *tvb, int offset,
574 packet_info *pinfo, proto_tree *tree,
577 e_ctx_hnd policy_hnd;
582 offset = dissect_nt_policy_hnd(
583 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, NULL,
586 dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL,
589 if (check_col(pinfo->cinfo, COL_INFO) && pol_name)
590 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
596 static int SpoolssClosePrinter_r(tvbuff_t *tvb, int offset,
597 packet_info *pinfo, proto_tree *tree,
602 offset = dissect_nt_policy_hnd(
603 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
607 offset = dissect_doserror(
608 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
613 /* Dissect some printer data. The get/set/enum printerdata routines all
614 store value/data in a uint8 array. We could use the ndr routines for
615 this but that would result in one item for each byte in the printer
618 static gint ett_printerdata_data = -1;
619 static gint ett_printerdata_value = -1;
621 static int dissect_printerdata_data(tvbuff_t *tvb, int offset,
622 packet_info *pinfo, proto_tree *tree,
623 guint8 *drep _U_, guint32 type)
625 proto_item *item, *hidden_item;
629 item = proto_tree_add_text(tree, tvb, offset, 0, "Data");
631 subtree = proto_item_add_subtree(item, ett_printerdata_data);
633 offset = dissect_ndr_uint32(
634 tvb, offset, pinfo, subtree, drep, hf_printerdata_size, &size);
638 offset = dissect_ndr_uint8s(
639 tvb, offset, pinfo, subtree, drep,
640 hf_printerdata_data, size, NULL);
643 case DCERPC_REG_SZ: {
644 char *data = tvb_fake_unicode(tvb, offset - size, size/2, TRUE);
646 proto_item_append_text(item, ": %s", data);
648 if (check_col(pinfo->cinfo, COL_INFO))
650 pinfo->cinfo, COL_INFO, " = %s", data);
652 hidden_item = proto_tree_add_string(
653 tree, hf_printerdata_data_sz, tvb,
654 offset - size, size, data);
655 PROTO_ITEM_SET_HIDDEN(hidden_item);
661 case DCERPC_REG_DWORD: {
662 guint32 data = tvb_get_letohl(tvb, offset - size);
664 proto_item_append_text(item, ": 0x%08x", data);
666 if (check_col(pinfo->cinfo, COL_INFO))
668 pinfo->cinfo, COL_INFO, " = 0x%08x",
671 hidden_item = proto_tree_add_uint(
672 tree, hf_printerdata_data_dword, tvb,
673 offset - size, 4, data);
674 PROTO_ITEM_SET_HIDDEN(hidden_item);
678 case DCERPC_REG_BINARY:
680 pinfo->cinfo, COL_INFO,
689 proto_item_set_len(item, size + 4);
695 * SpoolssGetPrinterData
698 static int SpoolssGetPrinterData_q(tvbuff_t *tvb, int offset,
699 packet_info *pinfo, proto_tree *tree,
702 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
703 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
705 proto_item *hidden_item;
707 hidden_item = proto_tree_add_uint(
708 tree, hf_printerdata, tvb, offset, 0, 1);
709 PROTO_ITEM_SET_HIDDEN(hidden_item);
713 offset = dissect_nt_policy_hnd(
714 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
719 offset = dissect_ndr_cvstring(
720 tvb, offset, pinfo, tree, drep, sizeof(guint16),
721 hf_printerdata_value, TRUE, value_name ? NULL : &value_name);
722 /* GetPrinterData() stores the printerdata in se_data */
723 if(!pinfo->fd->flags.visited){
726 dcv->se_data = se_strdup(value_name);
731 if (check_col(pinfo->cinfo, COL_INFO))
732 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", value_name);
734 offset = dissect_ndr_uint32(
735 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
740 static int SpoolssGetPrinterData_r(tvbuff_t *tvb, int offset,
741 packet_info *pinfo, proto_tree *tree,
744 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
745 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
747 proto_item *hidden_item;
749 hidden_item = proto_tree_add_uint(
750 tree, hf_printerdata, tvb, offset, 0, 1);
751 PROTO_ITEM_SET_HIDDEN(hidden_item);
755 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
756 hf_printerdata_type, &type);
758 if (check_col(pinfo->cinfo, COL_INFO)) {
759 const char *data = dcv->se_data ? dcv->se_data : "????";
761 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", data);
764 offset = dissect_printerdata_data(
765 tvb, offset, pinfo, tree, drep, type);
767 offset = dissect_ndr_uint32(
768 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
770 offset = dissect_doserror(
771 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
777 * SpoolssGetPrinterDataEx
780 static int SpoolssGetPrinterDataEx_q(tvbuff_t *tvb, int offset,
781 packet_info *pinfo, proto_tree *tree,
784 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
785 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
786 char *key_name, *value_name;
787 proto_item *hidden_item;
789 hidden_item = proto_tree_add_uint(
790 tree, hf_printerdata, tvb, offset, 0, 1);
791 PROTO_ITEM_SET_HIDDEN(hidden_item);
795 offset = dissect_nt_policy_hnd(
796 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
800 offset = dissect_ndr_cvstring(
801 tvb, offset, pinfo, tree, drep, sizeof(guint16),
802 hf_printerdata_key, TRUE, &key_name);
805 offset = dissect_ndr_cvstring(
806 tvb, offset, pinfo, tree, drep, sizeof(guint16),
807 hf_printerdata_value, TRUE, &value_name);
809 /* GetPrinterDataEx() stores the key/value in se_data */
810 if(!pinfo->fd->flags.visited){
812 dcv->se_data = se_strdup_printf("%s==%s",
813 key_name?key_name:"",
814 value_name?value_name:"");
818 if (check_col(pinfo->cinfo, COL_INFO) && dcv->se_data)
819 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
820 (char *)dcv->se_data);
822 offset = dissect_ndr_uint32(
823 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
828 static int SpoolssGetPrinterDataEx_r(tvbuff_t *tvb, int offset,
829 packet_info *pinfo, proto_tree *tree,
832 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
833 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
835 proto_item *hidden_item;
837 hidden_item = proto_tree_add_uint(
838 tree, hf_printerdata, tvb, offset, 0, 1);
839 PROTO_ITEM_SET_HIDDEN(hidden_item);
843 offset = dissect_ndr_uint32(
844 tvb, offset, pinfo, tree, drep, hf_printerdata_type, &type);
846 offset = dissect_ndr_uint32(
847 tvb, offset, pinfo, tree, drep, hf_returned, &size);
849 if (check_col(pinfo->cinfo, COL_INFO) && dcv->se_data) {
850 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", (char *)dcv->se_data);
854 dissect_printerdata_data(tvb, offset, pinfo, tree, drep, type);
858 offset = dissect_ndr_uint32(
859 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
861 offset = dissect_doserror(
862 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
868 * SpoolssSetPrinterData
871 static int SpoolssSetPrinterData_q(tvbuff_t *tvb, int offset,
872 packet_info *pinfo, proto_tree *tree,
875 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
876 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
879 proto_item *hidden_item;
881 hidden_item = proto_tree_add_uint(
882 tree, hf_printerdata, tvb, offset, 0, 1);
883 PROTO_ITEM_SET_HIDDEN(hidden_item);
887 offset = dissect_nt_policy_hnd(
888 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
892 offset = dissect_ndr_cvstring(
893 tvb, offset, pinfo, tree, drep, sizeof(guint16),
894 hf_printerdata_value, TRUE, &value_name);
896 /* GetPrinterDataEx() stores the key/value in se_data */
897 if(!pinfo->fd->flags.visited){
899 dcv->se_data = se_strdup_printf("%s",
900 value_name?value_name:"");
905 if (check_col(pinfo->cinfo, COL_INFO) && dcv->se_data){
906 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", (char *)dcv->se_data);
909 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
910 hf_printerdata_type, &type);
912 offset = dissect_printerdata_data(
913 tvb, offset, pinfo, tree, drep, type);
915 offset = dissect_ndr_uint32(
916 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
921 static int SpoolssSetPrinterData_r(tvbuff_t *tvb, int offset,
922 packet_info *pinfo, proto_tree *tree,
925 proto_item *hidden_item;
927 hidden_item = proto_tree_add_uint(
928 tree, hf_printerdata, tvb, offset, 0, 1);
929 PROTO_ITEM_SET_HIDDEN(hidden_item);
933 offset = dissect_doserror(
934 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
940 * SpoolssSetPrinterDataEx
943 static int hf_setprinterdataex_max_len = -1;
944 static int hf_setprinterdataex_real_len = -1;
945 static int hf_setprinterdataex_data = -1;
947 static int SpoolssSetPrinterDataEx_q(tvbuff_t *tvb, int offset,
948 packet_info *pinfo, proto_tree *tree,
951 char *key_name, *value_name;
953 proto_item *hidden_item;
955 hidden_item = proto_tree_add_uint(
956 tree, hf_printerdata, tvb, offset, 0, 1);
957 PROTO_ITEM_SET_HIDDEN(hidden_item);
961 offset = dissect_nt_policy_hnd(
962 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
965 offset = dissect_ndr_cvstring(
966 tvb, offset, pinfo, tree, drep, sizeof(guint16),
967 hf_printerdata_key, TRUE, &key_name);
969 CLEANUP_PUSH(g_free, key_name);
971 offset = dissect_ndr_cvstring(
972 tvb, offset, pinfo, tree, drep, sizeof(guint16),
973 hf_printerdata_value, TRUE, &value_name);
975 if (check_col(pinfo->cinfo, COL_INFO))
976 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s/%s",
977 key_name, value_name);
979 CLEANUP_CALL_AND_POP;
982 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
983 hf_printerdata_type, NULL);
985 offset = dissect_ndr_uint32(
986 tvb, offset, pinfo, tree, drep,
987 hf_setprinterdataex_max_len, &max_len);
989 offset = dissect_ndr_uint8s(
990 tvb, offset, pinfo, tree, drep,
991 hf_setprinterdataex_data, max_len, NULL);
993 offset = dissect_ndr_uint32(
994 tvb, offset, pinfo, tree, drep,
995 hf_setprinterdataex_real_len, NULL);
1000 static int SpoolssSetPrinterDataEx_r(tvbuff_t *tvb, int offset,
1001 packet_info *pinfo, proto_tree *tree,
1004 proto_item *hidden_item;
1006 hidden_item = proto_tree_add_uint(
1007 tree, hf_printerdata, tvb, offset, 0, 1);
1008 PROTO_ITEM_SET_HIDDEN(hidden_item);
1012 offset = dissect_doserror(
1013 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
1018 /* Yet another way to represent a unicode string - sheesh. This function
1019 dissects a NULL terminate unicode string at the current offset and
1020 returns the (char *) equivalent. This really should return UTF8 or
1021 something but we use tvb_fake_unicode() instead. */
1023 /* XXX - "name" should be an hf_ value for an FT_STRING. */
1025 dissect_spoolss_uint16uni(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
1026 proto_tree *tree, guint8 *drep _U_, char **data,
1029 gint len, remaining;
1033 offset += 2 - (offset % 2);
1035 /* Get remaining data in buffer as a string */
1037 remaining = tvb_length_remaining(tvb, offset) / 2;
1038 text = tvb_fake_unicode(tvb, offset, remaining, TRUE);
1039 len = (int)strlen(text);
1041 proto_tree_add_text(tree, tvb, offset, len * 2, "%s: %s",
1042 name ? name : "String", text);
1049 return offset + (len + 1) * 2;
1056 /* Devicemode orientation values */
1058 static const value_string devmode_orientation_vals[] =
1060 { DEVMODE_ORIENTATION_PORTRAIT, "Portrait" },
1061 { DEVMODE_ORIENTATION_LANDSCAPE, "Landscape" },
1065 /* Paper size values. International paper sizes is a fascinating
1066 topic. No seriously! (-: */
1068 static const value_string devmode_papersize_vals[] =
1070 { DEVMODE_PAPERSIZE_LETTER, "Letter" },
1071 { DEVMODE_PAPERSIZE_LETTERSMALL, "Letter (small)" },
1072 { DEVMODE_PAPERSIZE_TABLOID, "Tabloid" },
1073 { DEVMODE_PAPERSIZE_LEDGER, "Ledger" },
1074 { DEVMODE_PAPERSIZE_LEGAL, "Legal" },
1075 { DEVMODE_PAPERSIZE_STATEMENT, "Statement" },
1076 { DEVMODE_PAPERSIZE_EXECUTIVE, "Executive" },
1077 { DEVMODE_PAPERSIZE_A3, "A3" },
1078 { DEVMODE_PAPERSIZE_A4, "A4" },
1079 { DEVMODE_PAPERSIZE_A4SMALL, "A4 (small)" },
1080 { DEVMODE_PAPERSIZE_A5, "A5" },
1081 { DEVMODE_PAPERSIZE_B4, "B4" },
1082 { DEVMODE_PAPERSIZE_B5, "B5" },
1083 { DEVMODE_PAPERSIZE_FOLIO, "Folio" },
1084 { DEVMODE_PAPERSIZE_QUARTO, "Quarto" },
1085 { DEVMODE_PAPERSIZE_10X14, "10x14" },
1086 { DEVMODE_PAPERSIZE_11X17, "11x17" },
1087 { DEVMODE_PAPERSIZE_NOTE, "Note" },
1088 { DEVMODE_PAPERSIZE_ENV9, "Envelope #9" },
1089 { DEVMODE_PAPERSIZE_ENV10, "Envelope #10" },
1090 { DEVMODE_PAPERSIZE_ENV11, "Envelope #11" },
1091 { DEVMODE_PAPERSIZE_ENV12, "Envelope #12" },
1092 { DEVMODE_PAPERSIZE_ENV14, "Envelope #14" },
1093 { DEVMODE_PAPERSIZE_CSHEET, "C sheet" },
1094 { DEVMODE_PAPERSIZE_DSHEET, "D sheet" },
1095 { DEVMODE_PAPERSIZE_ESHEET, "E sheet" },
1096 { DEVMODE_PAPERSIZE_ENVDL, "Envelope DL" },
1097 { DEVMODE_PAPERSIZE_ENVC5, "Envelope C5" },
1098 { DEVMODE_PAPERSIZE_ENVC3, "Envelope C3" },
1099 { DEVMODE_PAPERSIZE_ENVC4, "Envelope C4" },
1100 { DEVMODE_PAPERSIZE_ENVC6, "Envelope C6" },
1101 { DEVMODE_PAPERSIZE_ENVC65, "Envelope C65" },
1102 { DEVMODE_PAPERSIZE_ENVB4, "Envelope B4" },
1103 { DEVMODE_PAPERSIZE_ENVB5, "Envelope B5" },
1104 { DEVMODE_PAPERSIZE_ENVB6, "Envelope B6" },
1105 { DEVMODE_PAPERSIZE_ENVITALY, "Envelope (Italy)" },
1106 { DEVMODE_PAPERSIZE_ENVMONARCH, "Envelope (Monarch)" },
1107 { DEVMODE_PAPERSIZE_ENVPERSONAL, "Envelope (Personal)" },
1108 { DEVMODE_PAPERSIZE_FANFOLDUS, "Fanfold (US)" },
1109 { DEVMODE_PAPERSIZE_FANFOLDSTDGERMAN, "Fanfold (Std German)" },
1110 { DEVMODE_PAPERSIZE_FANFOLDLGLGERMAN, "Fanfold (Legal German)" },
1111 { DEVMODE_PAPERSIZE_ISOB4, "B4 (ISO)" },
1112 { DEVMODE_PAPERSIZE_JAPANESEPOSTCARD, "Japanese postcard" },
1113 { DEVMODE_PAPERSIZE_9X11, "9x11" },
1114 { DEVMODE_PAPERSIZE_10X11, "10x11" },
1115 { DEVMODE_PAPERSIZE_15X11, "15x11" },
1116 { DEVMODE_PAPERSIZE_ENVINVITE, "Envelope (Invite)" },
1117 { DEVMODE_PAPERSIZE_RESERVED48, "Reserved (48)" },
1118 { DEVMODE_PAPERSIZE_RESERVED49, "Reserved (49)" },
1119 { DEVMODE_PAPERSIZE_LETTEREXTRA, "Letter (Extra)" },
1120 { DEVMODE_PAPERSIZE_LEGALEXTRA, "Legal (Extra)" },
1121 { DEVMODE_PAPERSIZE_TABLOIDEXTRA, "Tabloid (Extra)" },
1122 { DEVMODE_PAPERSIZE_A4EXTRA, "A4 (Extra)" },
1123 { DEVMODE_PAPERSIZE_LETTERTRANS, "Letter (Transverse)" },
1124 { DEVMODE_PAPERSIZE_A4TRANS, "A4 (Transverse)" },
1125 { DEVMODE_PAPERSIZE_LETTEREXTRATRANS, "Letter (Extra, Transverse)" },
1126 { DEVMODE_PAPERSIZE_APLUS, "A+" },
1127 { DEVMODE_PAPERSIZE_BPLUS, "B+" },
1128 { DEVMODE_PAPERSIZE_LETTERPLUS, "Letter+" },
1129 { DEVMODE_PAPERSIZE_A4PLUS, "A4+" },
1130 { DEVMODE_PAPERSIZE_A5TRANS, "A5 (Transverse)" },
1131 { DEVMODE_PAPERSIZE_B5TRANS, "B5 (Transverse)" },
1132 { DEVMODE_PAPERSIZE_A3EXTRA, "A3 (Extra)" },
1133 { DEVMODE_PAPERSIZE_A5EXTRA, "A5 (Extra)" },
1134 { DEVMODE_PAPERSIZE_B5EXTRA, "B5 (Extra)" },
1135 { DEVMODE_PAPERSIZE_A2, "A2" },
1136 { DEVMODE_PAPERSIZE_A3TRANS, "A3 (Transverse)" },
1137 { DEVMODE_PAPERSIZE_A3EXTRATRANS, "A3 (Extra, Transverse" },
1138 { DEVMODE_PAPERSIZE_DBLJAPANESEPOSTCARD, "Double Japanese Postcard" },
1139 { DEVMODE_PAPERSIZE_A6, "A6" },
1140 { DEVMODE_PAPERSIZE_JENVKAKU2, "Japanese Envelope (Kaku #2)" },
1141 { DEVMODE_PAPERSIZE_JENVKAKU3, "Japanese Envelope (Kaku #3)" },
1142 { DEVMODE_PAPERSIZE_JENVCHOU3, "Japanese Envelope (Chou #3)" },
1143 { DEVMODE_PAPERSIZE_JENVCHOU4, "Japaneve Envelope (Chou #4)" },
1144 { DEVMODE_PAPERSIZE_LETTERROT, "Letter (Rotated)" },
1145 { DEVMODE_PAPERSIZE_A3ROT, "A3 (Rotated)" },
1146 { DEVMODE_PAPERSIZE_A4ROT, "A4 (Rotated)" },
1147 { DEVMODE_PAPERSIZE_A5ROT, "A5 (Rotated)" },
1148 { DEVMODE_PAPERSIZE_B4JISROT, "B4 (JIS, Rotated)" },
1149 { DEVMODE_PAPERSIZE_B5JISROT, "B5 (JIS, Rotated)"},
1150 { DEVMODE_PAPERSIZE_JAPANESEPOSTCARDROT,
1151 "Japanese Postcard (Rotated)" },
1152 { DEVMODE_PAPERSIZE_DBLJAPANESEPOSTCARDROT82,
1153 "Double Japanese Postcard (Rotated)" },
1154 { DEVMODE_PAPERSIZE_A6ROT, "A6 (Rotated)" },
1155 { DEVMODE_PAPERSIZE_JENVKAKU2ROT,
1156 "Japanese Envelope (Kaku #2, Rotated)" },
1157 { DEVMODE_PAPERSIZE_JENVKAKU3ROT,
1158 "Japanese Envelope (Kaku #3, Rotated)" },
1159 { DEVMODE_PAPERSIZE_JENVCHOU3ROT,
1160 "Japanese Envelope (Chou #3, Rotated)" },
1161 { DEVMODE_PAPERSIZE_JENVCHOU4ROT,
1162 "Japanese Envelope (Chou #4, Rotated)" },
1163 { DEVMODE_PAPERSIZE_B6JIS, "B6 (JIS)" },
1164 { DEVMODE_PAPERSIZE_B6JISROT, "B6 (JIS, Rotated)" },
1165 { DEVMODE_PAPERSIZE_12X11, "12x11" },
1166 { DEVMODE_PAPERSIZE_JENVYOU4, "Japanese Envelope (You #4)" },
1167 { DEVMODE_PAPERSIZE_JENVYOU4ROT,
1168 "Japanese Envelope (You #4, Rotated" },
1169 { DEVMODE_PAPERSIZE_P16K, "PRC 16K" },
1170 { DEVMODE_PAPERSIZE_P32K, "PRC 32K" },
1171 { DEVMODE_PAPERSIZE_P32KBIG, "P32K (Big)" },
1172 { DEVMODE_PAPERSIZE_PENV1, "PRC Envelope #1" },
1173 { DEVMODE_PAPERSIZE_PENV2, "PRC Envelope #2" },
1174 { DEVMODE_PAPERSIZE_PENV3, "PRC Envelope #3" },
1175 { DEVMODE_PAPERSIZE_PENV4, "PRC Envelope #4" },
1176 { DEVMODE_PAPERSIZE_PENV5, "PRC Envelope #5" },
1177 { DEVMODE_PAPERSIZE_PENV6, "PRC Envelope #6" },
1178 { DEVMODE_PAPERSIZE_PENV7, "PRC Envelope #7" },
1179 { DEVMODE_PAPERSIZE_PENV8, "PRC Envelope #8" },
1180 { DEVMODE_PAPERSIZE_PENV9, "PRC Envelope #9" },
1181 { DEVMODE_PAPERSIZE_PENV10, "PRC Envelope #10" },
1182 { DEVMODE_PAPERSIZE_P16KROT, "PRC 16K (Rotated)" },
1183 { DEVMODE_PAPERSIZE_P32KROT, "PRC 32K (Rotated)" },
1184 { DEVMODE_PAPERSIZE_P32KBIGROT, "PRC 32K (Big, Rotated)" },
1185 { DEVMODE_PAPERSIZE_PENV1ROT, "PRC Envelope #1 (Rotated)" },
1186 { DEVMODE_PAPERSIZE_PENV2ROT, "PRC Envelope #2 (Rotated)" },
1187 { DEVMODE_PAPERSIZE_PENV3ROT, "PRC Envelope #3 (Rotated)" },
1188 { DEVMODE_PAPERSIZE_PENV4ROT, "PRC Envelope #4 (Rotated)" },
1189 { DEVMODE_PAPERSIZE_PENV5ROT, "PRC Envelope #5 (Rotated)" },
1190 { DEVMODE_PAPERSIZE_PENV6ROT, "PRC Envelope #6 (Rotated)" },
1191 { DEVMODE_PAPERSIZE_PENV7ROT, "PRC Envelope #7 (Rotated)" },
1192 { DEVMODE_PAPERSIZE_PENV8ROT, "PRC Envelope #8 (Rotated)" },
1193 { DEVMODE_PAPERSIZE_PENV9ROT, "PRC Envelope #9 (Rotated)" },
1194 { DEVMODE_PAPERSIZE_PENV10ROT, "PRC Envelope #10 (Rotated)" },
1198 /* List of observed specversions */
1200 static const value_string devmode_specversion_vals[] =
1202 { 0x0320, "Observed" },
1203 { 0x0400, "Observed" },
1204 { 0x0401, "Observed" },
1205 { 0x040d, "Observed" },
1211 static const value_string devmode_papersource_vals[] =
1213 { DEVMODE_PAPERSOURCE_UPPER, "Upper" },
1214 { DEVMODE_PAPERSOURCE_LOWER, "Lower" },
1215 { DEVMODE_PAPERSOURCE_MIDDLE, "Middle" },
1216 { DEVMODE_PAPERSOURCE_MANUAL, "Manual" },
1217 { DEVMODE_PAPERSOURCE_ENV, "Envelope" },
1218 { DEVMODE_PAPERSOURCE_ENVMANUAL, "Envelope Manual" },
1219 { DEVMODE_PAPERSOURCE_AUTO, "Auto" },
1220 { DEVMODE_PAPERSOURCE_TRACTOR, "Tractor" },
1221 { DEVMODE_PAPERSOURCE_SMALLFMT, "Small Format" },
1222 { DEVMODE_PAPERSOURCE_LARGEFMAT, "Large Format" },
1223 { DEVMODE_PAPERSOURCE_LARGECAP, "Large Capacity" },
1224 { DEVMODE_PAPERSOURCE_CASSETTE, "Cassette" },
1225 { DEVMODE_PAPERSOURCE_FORMSRC, "Form Source" },
1231 static const value_string devmode_printquality_vals[] =
1233 { DEVMODE_PRINTQUALITY_HIGH, "High" },
1234 { DEVMODE_PRINTQUALITY_MEDIUM, "Medium" },
1235 { DEVMODE_PRINTQUALITY_LOW, "Low" },
1236 { DEVMODE_PRINTQUALITY_DRAFT, "Draft" },
1242 static const value_string devmode_colour_vals[] =
1244 { DEVMODE_COLOUR_COLOUR, "Colour" },
1245 { DEVMODE_COLOUR_MONO, "Monochrome" },
1249 /* TrueType options */
1251 static const value_string devmode_ttoption_vals[] =
1254 { DEVMODE_TTOPTION_BITMAP, "Bitmap" },
1255 { DEVMODE_TTOPTION_DOWNLOAD, "Download" },
1256 { DEVMODE_TTOPTION_DOWNLOAD_OUTLINE, "Download outline" },
1257 { DEVMODE_TTOPTION_SUBDEV, "Substitute device fonts" },
1263 static const value_string devmode_collate_vals[] =
1265 { DEVMODE_COLLATE_FALSE, "False" },
1266 { DEVMODE_COLLATE_TRUE, "True" },
1272 static const value_string devmode_duplex_vals[] =
1274 { DEVMODE_DUPLEX_SIMPLEX, "Simplex" },
1275 { DEVMODE_DUPLEX_VERT, "Vertical" },
1276 { DEVMODE_DUPLEX_HORIZ, "Horizontal" },
1280 static const value_string devmode_displayflags_vals[] =
1283 { DEVMODE_DISPLAYFLAGS_GRAYSCALE, "Grayscale" },
1284 { DEVMODE_DISPLAYFLAGS_INTERLACED, "Interlaced" },
1288 static const value_string devmode_icmmethod_vals[] =
1290 { DEVMODE_ICMMETHOD_NONE, "None" },
1291 { DEVMODE_ICMMETHOD_SYSTEM, "System" },
1292 { DEVMODE_ICMMETHOD_DRIVER, "Driver" },
1293 { DEVMODE_ICMMETHOD_DEVICE, "Device" },
1297 static const value_string devmode_icmintent_vals[] =
1300 { DEVMODE_ICMINTENT_SATURATE, "Saturate" },
1301 { DEVMODE_ICMINTENT_CONTRAST, "Contrast" },
1302 { DEVMODE_ICMINTENT_COLORIMETRIC, "Colorimetric" },
1303 { DEVMODE_ICMINTENT_ABS_COLORIMETRIC, "Absolute colorimetric" },
1307 static const value_string devmode_mediatype_vals[] =
1310 { DEVMODE_MEDIATYPE_STANDARD, "Standard" },
1311 { DEVMODE_MEDIATYPE_TRANSPARENCY, "Transparency" },
1312 { DEVMODE_MEDIATYPE_GLOSSY, "Glossy" },
1316 static const value_string devmode_dithertype_vals[] =
1319 { DEVMODE_DITHERTYPE_NONE, "None" },
1320 { DEVMODE_DITHERTYPE_COARSE, "Coarse" },
1321 { DEVMODE_DITHERTYPE_LINE, "Line" },
1322 { DEVMODE_DITHERTYPE_LINEART, "Line art" },
1323 { DEVMODE_DITHERTYPE_ERRORDIFFUSION, "Error diffusion" },
1324 { DEVMODE_DITHERTYPE_RESERVED6, "Reserved 6" },
1325 { DEVMODE_DITHERTYPE_RESERVED7, "Reserved 7" },
1326 { DEVMODE_DITHERTYPE_GRAYSCALE, "Grayscale" },
1330 static gint ett_DEVMODE_fields = -1;
1333 dissect_DEVMODE_fields(tvbuff_t *tvb, gint offset, packet_info *pinfo,
1334 proto_tree *tree, guint8 *drep _U_, guint32 *pdata)
1337 proto_tree *subtree;
1339 proto_item *hidden_item;
1341 hidden_item = proto_tree_add_uint(
1342 tree, hf_devmode, tvb, offset, 0, 1);
1343 PROTO_ITEM_SET_HIDDEN(hidden_item);
1345 offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
1346 hf_devmode_fields, &fields);
1348 item = proto_tree_add_text(tree, tvb, offset - 4, 4,
1349 "Fields: 0x%08x", fields);
1351 subtree = proto_item_add_subtree(item, ett_DEVMODE_fields);
1353 proto_tree_add_boolean(
1354 subtree, hf_devmode_fields_orientation,
1355 tvb, offset - 4, 4, fields);
1357 proto_tree_add_boolean(
1358 subtree, hf_devmode_fields_papersize,
1359 tvb, offset - 4, 4, fields);
1361 proto_tree_add_boolean(
1362 subtree, hf_devmode_fields_paperlength,
1363 tvb, offset - 4, 4, fields);
1365 proto_tree_add_boolean(
1366 subtree, hf_devmode_fields_paperwidth,
1367 tvb, offset - 4, 4, fields);
1369 proto_tree_add_boolean(
1370 subtree, hf_devmode_fields_scale,
1371 tvb, offset - 4, 4, fields);
1373 proto_tree_add_boolean(
1374 subtree, hf_devmode_fields_position,
1375 tvb, offset - 4, 4, fields);
1377 proto_tree_add_boolean(
1378 subtree, hf_devmode_fields_nup,
1379 tvb, offset - 4, 4, fields);
1381 proto_tree_add_boolean(
1382 subtree, hf_devmode_fields_copies,
1383 tvb, offset - 4, 4, fields);
1385 proto_tree_add_boolean(
1386 subtree, hf_devmode_fields_defaultsource,
1387 tvb, offset - 4, 4, fields);
1389 proto_tree_add_boolean(
1390 subtree, hf_devmode_fields_printquality,
1391 tvb, offset - 4, 4, fields);
1393 proto_tree_add_boolean(
1394 subtree, hf_devmode_fields_color,
1395 tvb, offset - 4, 4, fields);
1397 proto_tree_add_boolean(
1398 subtree, hf_devmode_fields_duplex,
1399 tvb, offset - 4, 4, fields);
1401 proto_tree_add_boolean(
1402 subtree, hf_devmode_fields_yresolution,
1403 tvb, offset - 4, 4, fields);
1405 proto_tree_add_boolean(
1406 subtree, hf_devmode_fields_ttoption,
1407 tvb, offset - 4, 4, fields);
1409 proto_tree_add_boolean(
1410 subtree, hf_devmode_fields_collate,
1411 tvb, offset - 4, 4, fields);
1413 proto_tree_add_boolean(
1414 subtree, hf_devmode_fields_formname,
1415 tvb, offset - 4, 4, fields);
1417 proto_tree_add_boolean(
1418 subtree, hf_devmode_fields_logpixels,
1419 tvb, offset - 4, 4, fields);
1421 proto_tree_add_boolean(
1422 subtree, hf_devmode_fields_bitsperpel,
1423 tvb, offset - 4, 4, fields);
1425 proto_tree_add_boolean(
1426 subtree, hf_devmode_fields_pelswidth,
1427 tvb, offset - 4, 4, fields);
1429 proto_tree_add_boolean(
1430 subtree, hf_devmode_fields_pelsheight,
1431 tvb, offset - 4, 4, fields);
1433 proto_tree_add_boolean(
1434 subtree, hf_devmode_fields_displayflags,
1435 tvb, offset - 4, 4, fields);
1437 proto_tree_add_boolean(
1438 subtree, hf_devmode_fields_displayfrequency,
1439 tvb, offset - 4, 4, fields);
1441 proto_tree_add_boolean(
1442 subtree, hf_devmode_fields_icmmethod,
1443 tvb, offset - 4, 4, fields);
1445 proto_tree_add_boolean(
1446 subtree, hf_devmode_fields_icmintent,
1447 tvb, offset - 4, 4, fields);
1449 proto_tree_add_boolean(
1450 subtree, hf_devmode_fields_mediatype,
1451 tvb, offset - 4, 4, fields);
1453 proto_tree_add_boolean(
1454 subtree, hf_devmode_fields_dithertype,
1455 tvb, offset - 4, 4, fields);
1457 proto_tree_add_boolean(
1458 subtree, hf_devmode_fields_panningwidth,
1459 tvb, offset - 4, 4, fields);
1461 proto_tree_add_boolean(
1462 subtree, hf_devmode_fields_panningheight,
1463 tvb, offset - 4, 4, fields);
1471 static gint ett_DEVMODE = -1;
1473 static int dissect_DEVMODE(tvbuff_t *tvb, int offset, packet_info *pinfo,
1474 proto_tree *tree, guint8 *drep)
1476 dcerpc_info *di = pinfo->private_data;
1478 proto_tree *subtree;
1479 guint16 driver_extra;
1480 gint16 print_quality;
1482 int struct_start = offset;
1484 if (di->conformant_run)
1487 item = proto_tree_add_text(tree, tvb, offset, 0, "Devicemode");
1488 subtree = proto_item_add_subtree(item, ett_DEVMODE);
1490 offset = dissect_ndr_uint32(
1491 tvb, offset, pinfo, subtree, drep, hf_devmode_size,
1494 /* The device name is stored in a 32-wchar buffer */
1496 dissect_spoolss_uint16uni(tvb, offset, pinfo, subtree, drep, NULL,
1500 offset = dissect_ndr_uint16(
1501 tvb, offset, pinfo, subtree, drep,
1502 hf_devmode_spec_version, NULL);
1504 offset = dissect_ndr_uint16(
1505 tvb, offset, pinfo, subtree, drep,
1506 hf_devmode_driver_version, NULL);
1508 offset = dissect_ndr_uint16(
1509 tvb, offset, pinfo, subtree, drep,
1510 hf_devmode_size2, NULL);
1512 offset = dissect_ndr_uint16(
1513 tvb, offset, pinfo, subtree, drep,
1514 hf_devmode_driver_extra_len, &driver_extra);
1516 offset = dissect_DEVMODE_fields(
1517 tvb, offset, pinfo, subtree, drep, &fields);
1519 offset = dissect_ndr_uint16(
1520 tvb, offset, pinfo, subtree, drep,
1521 hf_devmode_orientation, NULL);
1523 offset = dissect_ndr_uint16(
1524 tvb, offset, pinfo, subtree, drep,
1525 hf_devmode_paper_size, NULL);
1527 offset = dissect_ndr_uint16(
1528 tvb, offset, pinfo, subtree, drep,
1529 hf_devmode_paper_length, NULL);
1531 offset = dissect_ndr_uint16(
1532 tvb, offset, pinfo, subtree, drep,
1533 hf_devmode_paper_width, NULL);
1535 offset = dissect_ndr_uint16(
1536 tvb, offset, pinfo, subtree, drep,
1537 hf_devmode_scale, NULL);
1539 offset = dissect_ndr_uint16(
1540 tvb, offset, pinfo, subtree, drep,
1541 hf_devmode_copies, NULL);
1543 offset = dissect_ndr_uint16(
1544 tvb, offset, pinfo, subtree, drep,
1545 hf_devmode_default_source, NULL);
1547 offset = dissect_ndr_uint16(
1548 tvb, offset, pinfo, NULL, drep,
1549 hf_devmode_print_quality, &print_quality);
1551 if (print_quality < 0)
1552 proto_tree_add_item(
1553 subtree, hf_devmode_print_quality, tvb,
1554 offset - 2, 2, drep[0] & 0x10);
1556 proto_tree_add_text(
1557 subtree, tvb, offset - 4, 4,
1558 "Print Quality: %d dpi", print_quality);
1560 offset = dissect_ndr_uint16(
1561 tvb, offset, pinfo, subtree, drep,
1562 hf_devmode_color, NULL);
1564 offset = dissect_ndr_uint16(
1565 tvb, offset, pinfo, subtree, drep,
1566 hf_devmode_duplex, NULL);
1568 offset = dissect_ndr_uint16(
1569 tvb, offset, pinfo, subtree, drep,
1570 hf_devmode_y_resolution, NULL);
1572 offset = dissect_ndr_uint16(
1573 tvb, offset, pinfo, subtree, drep,
1574 hf_devmode_tt_option, NULL);
1576 offset = dissect_ndr_uint16(
1577 tvb, offset, pinfo, subtree, drep,
1578 hf_devmode_collate, NULL);
1580 dissect_spoolss_uint16uni(tvb, offset, pinfo, subtree, drep, NULL,
1584 offset = dissect_ndr_uint16(
1585 tvb, offset, pinfo, subtree, drep,
1586 hf_devmode_log_pixels, NULL);
1588 offset = dissect_ndr_uint32(
1589 tvb, offset, pinfo, subtree, drep,
1590 hf_devmode_bits_per_pel, NULL);
1592 offset = dissect_ndr_uint32(
1593 tvb, offset, pinfo, subtree, drep,
1594 hf_devmode_pels_width, NULL);
1596 offset = dissect_ndr_uint32(
1597 tvb, offset, pinfo, subtree, drep,
1598 hf_devmode_pels_height, NULL);
1600 offset = dissect_ndr_uint32(
1601 tvb, offset, pinfo, subtree, drep,
1602 hf_devmode_display_flags, NULL);
1604 offset = dissect_ndr_uint32(
1605 tvb, offset, pinfo, subtree, drep,
1606 hf_devmode_display_freq, NULL);
1608 /* TODO: Some of the remaining fields are optional. See
1609 rpc_parse/parse_spoolss.c in the Samba source for details. */
1611 offset = dissect_ndr_uint32(
1612 tvb, offset, pinfo, subtree, drep,
1613 hf_devmode_icm_method, NULL);
1615 offset = dissect_ndr_uint32(
1616 tvb, offset, pinfo, subtree, drep,
1617 hf_devmode_icm_intent, NULL);
1619 offset = dissect_ndr_uint32(
1620 tvb, offset, pinfo, subtree, drep,
1621 hf_devmode_media_type, NULL);
1623 offset = dissect_ndr_uint32(
1624 tvb, offset, pinfo, subtree, drep,
1625 hf_devmode_dither_type, NULL);
1627 offset = dissect_ndr_uint32(
1628 tvb, offset, pinfo, subtree, drep,
1629 hf_devmode_reserved1, NULL);
1631 offset = dissect_ndr_uint32(
1632 tvb, offset, pinfo, subtree, drep,
1633 hf_devmode_reserved2, NULL);
1635 offset = dissect_ndr_uint32(
1636 tvb, offset, pinfo, subtree, drep,
1637 hf_devmode_panning_width, NULL);
1639 offset = dissect_ndr_uint32(
1640 tvb, offset, pinfo, subtree, drep,
1641 hf_devmode_panning_height, NULL);
1644 offset = dissect_ndr_uint8s(
1645 tvb, offset, pinfo, subtree, drep,
1646 hf_devmode_driver_extra, driver_extra, NULL);
1648 proto_item_set_len(item, offset - struct_start);
1657 static gint ett_DEVMODE_CTR = -1;
1659 static int dissect_DEVMODE_CTR(tvbuff_t *tvb, int offset, packet_info *pinfo,
1660 proto_tree *tree, guint8 *drep)
1663 proto_tree *subtree;
1666 item = proto_tree_add_text(
1667 tree, tvb, offset, 0, "Devicemode container");
1669 subtree = proto_item_add_subtree(item, ett_DEVMODE_CTR);
1671 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
1672 hf_devmodectr_size, &size);
1674 offset = dissect_ndr_pointer(
1675 tvb, offset, pinfo, subtree, drep,
1676 dissect_DEVMODE, NDR_POINTER_UNIQUE, "Devicemode", -1);
1682 * Relative string given by offset into the current buffer. Note that
1683 * the offset for subsequent relstrs are against the structure start, not
1684 * the point where the offset is parsed from.
1687 static gint ett_RELSTR = -1;
1690 dissect_spoolss_relstr(tvbuff_t *tvb, int offset, packet_info *pinfo,
1691 proto_tree *tree, guint8 *drep, int hf_index,
1692 int struct_start, char **data)
1695 proto_tree *subtree;
1696 guint32 relstr_offset, relstr_start, relstr_end;
1699 /* Peek ahead to read the string. We need this for the
1700 proto_tree_add_string() call so filtering will work. */
1702 offset = dissect_ndr_uint32(
1703 tvb, offset, pinfo, NULL, drep, hf_offset, &relstr_offset);
1705 relstr_start = relstr_offset + struct_start;
1707 if (relstr_offset) {
1708 relstr_end = dissect_spoolss_uint16uni(
1709 tvb, relstr_start, pinfo, NULL, drep, &text, NULL);
1710 } else { /* relstr_offset == 0 is a NULL string */
1711 text = g_strdup("");
1712 relstr_end = relstr_start;
1715 /* OK now add the proto item with the string value */
1717 item = proto_tree_add_string(tree, hf_index, tvb, relstr_start, relstr_end - relstr_start, text);
1718 subtree = proto_item_add_subtree(item, ett_RELSTR);
1721 tvb, offset - 4, pinfo, subtree, drep, hf_offset, NULL);
1724 dissect_spoolss_uint16uni(
1725 tvb, relstr_start, pinfo, subtree, drep, NULL, NULL);
1735 /* An array of relative strings. This is currently just a copy of the
1736 dissect_spoolss_relstr() function as I can't find an example driver that
1737 has more than one dependent file. */
1739 static gint ett_RELSTR_ARRAY = -1;
1742 dissect_spoolss_relstrarray(tvbuff_t *tvb, int offset, packet_info *pinfo,
1743 proto_tree *tree, guint8 *drep, int hf_index,
1744 int struct_start, char **data)
1747 proto_tree *subtree;
1748 guint32 relstr_offset, relstr_start, relstr_end, relstr_len;
1751 item = proto_tree_add_string(tree, hf_index, tvb, offset, 4, "");
1753 subtree = proto_item_add_subtree(item, ett_RELSTR_ARRAY);
1755 offset = dissect_ndr_uint32(
1756 tvb, offset, pinfo, subtree, drep, hf_offset, &relstr_offset);
1758 /* A relative offset of zero is a NULL string */
1760 relstr_start = relstr_offset + struct_start;
1763 relstr_end = dissect_spoolss_uint16uni(
1764 tvb, relstr_start, pinfo, subtree, drep, &text, NULL);
1766 text = g_strdup("NULL");
1767 relstr_end = offset;
1770 relstr_len = relstr_end - relstr_start;
1772 proto_item_append_text(item, "%s", text);
1786 static int hf_printer_status = -1;
1788 static const value_string printer_status_vals[] =
1790 { PRINTER_STATUS_OK, "OK" },
1791 { PRINTER_STATUS_PAUSED, "Paused" },
1792 { PRINTER_STATUS_ERROR, "Error" },
1793 { PRINTER_STATUS_PENDING_DELETION, "Pending deletion" },
1794 { PRINTER_STATUS_PAPER_JAM, "Paper jam" },
1795 { PRINTER_STATUS_PAPER_OUT, "Paper out" },
1796 { PRINTER_STATUS_MANUAL_FEED, "Manual feed" },
1797 { PRINTER_STATUS_PAPER_PROBLEM, "Paper problem" },
1798 { PRINTER_STATUS_OFFLINE, "Offline" },
1799 { PRINTER_STATUS_IO_ACTIVE, "IO active" },
1800 { PRINTER_STATUS_BUSY, "Busy" },
1801 { PRINTER_STATUS_PRINTING, "Printing" },
1802 { PRINTER_STATUS_OUTPUT_BIN_FULL, "Output bin full" },
1803 { PRINTER_STATUS_NOT_AVAILABLE, "Not available" },
1804 { PRINTER_STATUS_WAITING, "Waiting" },
1805 { PRINTER_STATUS_PROCESSING, "Processing" },
1806 { PRINTER_STATUS_INITIALIZING, "Initialising" },
1807 { PRINTER_STATUS_WARMING_UP, "Warming up" },
1808 { PRINTER_STATUS_TONER_LOW, "Toner low" },
1809 { PRINTER_STATUS_NO_TONER, "No toner" },
1810 { PRINTER_STATUS_PAGE_PUNT, "Page punt" },
1811 { PRINTER_STATUS_USER_INTERVENTION, "User intervention" },
1812 { PRINTER_STATUS_OUT_OF_MEMORY, "Out of memory" },
1813 { PRINTER_STATUS_DOOR_OPEN, "Door open" },
1814 { PRINTER_STATUS_SERVER_UNKNOWN, "Server unknown" },
1815 { PRINTER_STATUS_POWER_SAVE, "Power save" },
1819 static gint ett_PRINTER_INFO_0 = -1;
1821 static int dissect_PRINTER_INFO_0(tvbuff_t *tvb, int offset,
1822 packet_info *pinfo, proto_tree *tree,
1825 offset = dissect_spoolss_relstr(
1826 tvb, offset, pinfo, tree, drep, hf_printername,
1829 offset = dissect_spoolss_relstr(
1830 tvb, offset, pinfo, tree, drep, hf_servername,
1833 offset = dissect_ndr_uint32(
1834 tvb, offset, pinfo, tree, drep, hf_printer_cjobs, NULL);
1836 offset = dissect_ndr_uint32(
1837 tvb, offset, pinfo, tree, drep, hf_printer_total_jobs,
1840 offset = dissect_ndr_uint32(
1841 tvb, offset, pinfo, tree, drep, hf_printer_total_bytes,
1844 offset = dissect_SYSTEM_TIME(
1845 tvb, offset, pinfo, tree, drep, "Unknown time", TRUE, NULL);
1847 offset = dissect_ndr_uint32(
1848 tvb, offset, pinfo, tree, drep, hf_printer_global_counter,
1851 offset = dissect_ndr_uint32(
1852 tvb, offset, pinfo, tree, drep, hf_printer_total_pages,
1855 offset = dissect_ndr_uint16(
1856 tvb, offset, pinfo, tree, drep, hf_printer_major_version,
1859 offset = dissect_ndr_uint16(
1860 tvb, offset, pinfo, tree, drep, hf_printer_build_version,
1863 offset = dissect_ndr_uint32(
1864 tvb, offset, pinfo, tree, drep, hf_printer_unk7, NULL);
1866 offset = dissect_ndr_uint32(
1867 tvb, offset, pinfo, tree, drep, hf_printer_unk8, NULL);
1869 offset = dissect_ndr_uint32(
1870 tvb, offset, pinfo, tree, drep, hf_printer_unk9, NULL);
1872 offset = dissect_ndr_uint32(
1873 tvb, offset, pinfo, tree, drep, hf_printer_session_ctr,
1876 offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep,
1877 hf_printer_unk11, NULL);
1879 offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep,
1880 hf_printer_printer_errors, NULL);
1882 offset = dissect_ndr_uint32(
1883 tvb, offset, pinfo, tree, drep, hf_printer_unk13, NULL);
1885 offset = dissect_ndr_uint32(
1886 tvb, offset, pinfo, tree, drep, hf_printer_unk14, NULL);
1888 offset = dissect_ndr_uint32(
1889 tvb, offset, pinfo, tree, drep, hf_printer_unk15, NULL);
1891 offset = dissect_ndr_uint32(
1892 tvb, offset, pinfo, tree, drep, hf_printer_unk16, NULL);
1894 offset = dissect_ndr_uint32(
1895 tvb, offset, pinfo, tree, drep, hf_printer_changeid, NULL);
1897 offset = dissect_ndr_uint32(
1898 tvb, offset, pinfo, tree, drep, hf_printer_unk18, NULL);
1900 offset = dissect_ndr_uint32(
1901 tvb, offset, pinfo, tree, drep, hf_printer_status, NULL);
1903 offset = dissect_ndr_uint32(
1904 tvb, offset, pinfo, tree, drep, hf_printer_unk20, NULL);
1906 offset = dissect_ndr_uint32(
1907 tvb, offset, pinfo, tree, drep, hf_printer_c_setprinter,
1910 offset = dissect_ndr_uint16(
1911 tvb, offset, pinfo, tree, drep, hf_printer_unk22, NULL);
1913 offset = dissect_ndr_uint16(
1914 tvb, offset, pinfo, tree, drep, hf_printer_unk23, NULL);
1916 offset = dissect_ndr_uint16(
1917 tvb, offset, pinfo, tree, drep, hf_printer_unk24, NULL);
1919 offset = dissect_ndr_uint16(
1920 tvb, offset, pinfo, tree, drep, hf_printer_unk25, NULL);
1922 offset = dissect_ndr_uint16(
1923 tvb, offset, pinfo, tree, drep, hf_printer_unk26, NULL);
1925 offset = dissect_ndr_uint16(
1926 tvb, offset, pinfo, tree, drep, hf_printer_unk27, NULL);
1928 offset = dissect_ndr_uint16(
1929 tvb, offset, pinfo, tree, drep, hf_printer_unk28, NULL);
1931 offset = dissect_ndr_uint16(
1932 tvb, offset, pinfo, tree, drep, hf_printer_unk29, NULL);
1941 static gint ett_PRINTER_INFO_1 = -1;
1943 static int dissect_PRINTER_INFO_1(tvbuff_t *tvb, int offset,
1944 packet_info *pinfo, proto_tree *tree,
1947 offset = dissect_ndr_uint32(
1948 tvb, offset, pinfo, tree, drep,
1949 hf_printer_flags, NULL);
1951 offset = dissect_spoolss_relstr(
1952 tvb, offset, pinfo, tree, drep, hf_printerdesc,
1955 offset = dissect_spoolss_relstr(
1956 tvb, offset, pinfo, tree, drep, hf_printername,
1959 offset = dissect_spoolss_relstr(
1960 tvb, offset, pinfo, tree, drep, hf_printercomment,
1968 static const true_false_string tfs_job_status_paused = {
1973 static const true_false_string tfs_job_status_error = {
1978 static const true_false_string tfs_job_status_deleting = {
1979 "Job is being deleted",
1980 "Job is not being deleted"
1983 static const true_false_string tfs_job_status_spooling = {
1984 "Job is being spooled",
1985 "Job is not being spooled"
1988 static const true_false_string tfs_job_status_printing = {
1989 "Job is being printed",
1990 "Job is not being printed"
1993 static const true_false_string tfs_job_status_offline = {
1995 "Job is not offline"
1998 static const true_false_string tfs_job_status_paperout = {
1999 "Job is out of paper",
2000 "Job is not out of paper"
2003 static const true_false_string tfs_job_status_printed = {
2004 "Job has completed printing",
2005 "Job has not completed printing"
2008 static const true_false_string tfs_job_status_deleted = {
2009 "Job has been deleted",
2010 "Job has not been deleted"
2013 static const true_false_string tfs_job_status_blocked = {
2014 "Job has been blocked",
2015 "Job has not been blocked"
2018 static const true_false_string tfs_job_status_user_intervention = {
2019 "User intervention required",
2020 "User intervention not required"
2023 static gint ett_job_status = -1;
2026 dissect_job_status(tvbuff_t *tvb, int offset, packet_info *pinfo,
2027 proto_tree *tree, guint8 *drep)
2030 proto_tree *subtree;
2033 offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
2034 hf_job_status, &status);
2036 item = proto_tree_add_text(tree, tvb, offset - 4, 4,
2037 "Status: 0x%08x", status);
2039 subtree = proto_item_add_subtree(item, ett_job_status);
2041 proto_tree_add_boolean(
2042 subtree, hf_job_status_user_intervention, tvb, offset - 4, 4,
2045 proto_tree_add_boolean(
2046 subtree, hf_job_status_blocked, tvb, offset - 4, 4, status);
2048 proto_tree_add_boolean(
2049 subtree, hf_job_status_deleted, tvb, offset - 4, 4, status);
2051 proto_tree_add_boolean(
2052 subtree, hf_job_status_printed, tvb, offset - 4, 4, status);
2054 proto_tree_add_boolean(
2055 subtree, hf_job_status_paperout, tvb, offset - 4, 4, status);
2057 proto_tree_add_boolean(
2058 subtree, hf_job_status_offline, tvb, offset - 4, 4, status);
2060 proto_tree_add_boolean(
2061 subtree, hf_job_status_printing, tvb, offset - 4, 4, status);
2063 proto_tree_add_boolean(
2064 subtree, hf_job_status_spooling, tvb, offset - 4, 4, status);
2066 proto_tree_add_boolean(
2067 subtree, hf_job_status_deleting, tvb, offset - 4, 4, status);
2069 proto_tree_add_boolean(
2070 subtree, hf_job_status_error, tvb, offset - 4, 4, status);
2072 proto_tree_add_boolean(
2073 subtree, hf_job_status_paused, tvb, offset - 4, 4, status);
2078 /* Printer attributes */
2080 static gint ett_printer_attributes = -1;
2082 static int hf_printer_attributes = -1;
2083 static int hf_printer_attributes_queued = -1;
2084 static int hf_printer_attributes_direct = -1;
2085 static int hf_printer_attributes_default = -1;
2086 static int hf_printer_attributes_shared = -1;
2087 static int hf_printer_attributes_network = -1;
2088 static int hf_printer_attributes_hidden = -1;
2089 static int hf_printer_attributes_local = -1;
2090 static int hf_printer_attributes_enable_devq = -1;
2091 static int hf_printer_attributes_keep_printed_jobs = -1;
2092 static int hf_printer_attributes_do_complete_first = -1;
2093 static int hf_printer_attributes_work_offline = -1;
2094 static int hf_printer_attributes_enable_bidi = -1;
2095 static int hf_printer_attributes_raw_only = -1;
2096 static int hf_printer_attributes_published = -1;
2098 static const true_false_string tfs_printer_attributes_queued = {
2099 "Printer starts printing after last page spooled",
2100 "Printer starts printing while spooling"
2103 static const true_false_string tfs_printer_attributes_direct = {
2104 "Jobs sent directly to printer",
2105 "Jobs are spooled to printer before printing"
2108 static const true_false_string tfs_printer_attributes_default = {
2109 "Printer is the default printer",
2110 "Printer is not the default printer"
2113 static const true_false_string tfs_printer_attributes_shared = {
2114 "Printer is shared",
2115 "Printer is not shared"
2118 static const true_false_string tfs_printer_attributes_network = {
2119 "Printer is a network printer connection",
2120 "Printer is not a network printer connection"
2123 static const true_false_string tfs_printer_attributes_hidden = {
2128 static const true_false_string tfs_printer_attributes_local = {
2129 "Printer is a local printer",
2130 "Printer is not a local printer"
2133 static const true_false_string tfs_printer_attributes_enable_devq = {
2134 "Call DevQueryPrint",
2135 "Do not call DevQueryPrint"
2138 static const true_false_string tfs_printer_attributes_keep_printed_jobs = {
2139 "Jobs are kept after they are printed",
2140 "Jobs are deleted after printing"
2143 static const true_false_string tfs_printer_attributes_do_complete_first = {
2144 "Jobs that have completed spooling are scheduled before still spooling jobs",
2145 "Jobs are scheduled in the order they start spooling"
2148 static const true_false_string tfs_printer_attributes_work_offline = {
2149 "The printer is currently connected",
2150 "The printer is currently not connected"
2153 static const true_false_string tfs_printer_attributes_enable_bidi = {
2154 "Bidirectional communications are supported",
2155 "Bidirectional communications are not supported"
2158 static const true_false_string tfs_printer_attributes_raw_only = {
2159 "Only raw data type print jobs can be spooled",
2160 "All data type print jobs can be spooled"
2163 static const true_false_string tfs_printer_attributes_published = {
2164 "Printer is published in the directory",
2165 "Printer is not published in the directory"
2169 dissect_printer_attributes(tvbuff_t *tvb, int offset, packet_info *pinfo,
2170 proto_tree *tree, guint8 *drep)
2173 proto_tree *subtree;
2176 offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
2177 hf_printer_attributes, &attributes);
2179 item = proto_tree_add_text(tree, tvb, offset - 4, 4,
2180 "Attributes: 0x%08x", attributes);
2182 subtree = proto_item_add_subtree(item, ett_printer_attributes);
2184 proto_tree_add_boolean(
2185 subtree, hf_printer_attributes_published,
2186 tvb, offset - 4, 4, attributes);
2188 proto_tree_add_boolean(
2189 subtree, hf_printer_attributes_raw_only,
2190 tvb, offset - 4, 4, attributes);
2192 proto_tree_add_boolean(
2193 subtree, hf_printer_attributes_enable_bidi,
2194 tvb, offset - 4, 4, attributes);
2196 proto_tree_add_boolean(
2197 subtree, hf_printer_attributes_work_offline,
2198 tvb, offset - 4, 4, attributes);
2200 proto_tree_add_boolean(
2201 subtree, hf_printer_attributes_do_complete_first,
2202 tvb, offset - 4, 4, attributes);
2204 proto_tree_add_boolean(
2205 subtree, hf_printer_attributes_keep_printed_jobs,
2206 tvb, offset - 4, 4, attributes);
2208 proto_tree_add_boolean(
2209 subtree, hf_printer_attributes_enable_devq,
2210 tvb, offset - 4, 4, attributes);
2212 proto_tree_add_boolean(
2213 subtree, hf_printer_attributes_local,
2214 tvb, offset - 4, 4, attributes);
2216 proto_tree_add_boolean(
2217 subtree, hf_printer_attributes_hidden,
2218 tvb, offset - 4, 4, attributes);
2220 proto_tree_add_boolean(
2221 subtree, hf_printer_attributes_network,
2222 tvb, offset - 4, 4, attributes);
2224 proto_tree_add_boolean(
2225 subtree, hf_printer_attributes_shared,
2226 tvb, offset - 4, 4, attributes);
2228 proto_tree_add_boolean(
2229 subtree, hf_printer_attributes_default,
2230 tvb, offset - 4, 4, attributes);
2232 proto_tree_add_boolean(
2233 subtree, hf_printer_attributes_direct,
2234 tvb, offset - 4, 4, attributes);
2236 proto_tree_add_boolean(
2237 subtree, hf_printer_attributes_queued,
2238 tvb, offset - 4, 4, attributes);
2247 static gint ett_PRINTER_INFO_2 = -1;
2249 static int dissect_PRINTER_INFO_2(tvbuff_t *tvb, int offset,
2250 packet_info *pinfo, proto_tree *tree,
2253 guint32 devmode_offset, secdesc_offset;
2255 offset = dissect_spoolss_relstr(
2256 tvb, offset, pinfo, tree, drep, hf_servername,
2259 offset = dissect_spoolss_relstr(
2260 tvb, offset, pinfo, tree, drep, hf_printername,
2263 offset = dissect_spoolss_relstr(
2264 tvb, offset, pinfo, tree, drep, hf_sharename,
2267 offset = dissect_spoolss_relstr(
2268 tvb, offset, pinfo, tree, drep, hf_portname,
2271 offset = dissect_spoolss_relstr(
2272 tvb, offset, pinfo, tree, drep, hf_drivername,
2275 offset = dissect_spoolss_relstr(
2276 tvb, offset, pinfo, tree, drep, hf_printercomment,
2279 offset = dissect_spoolss_relstr(
2280 tvb, offset, pinfo, tree, drep, hf_printerlocation,
2283 offset = dissect_ndr_uint32(
2284 tvb, offset, pinfo, NULL, drep, hf_offset,
2287 dissect_DEVMODE(tvb, devmode_offset - 4, pinfo, tree, drep);
2289 offset = dissect_spoolss_relstr(
2290 tvb, offset, pinfo, tree, drep, hf_sepfile,
2293 offset = dissect_spoolss_relstr(
2294 tvb, offset, pinfo, tree, drep, hf_printprocessor,
2297 offset = dissect_spoolss_relstr(
2298 tvb, offset, pinfo, tree, drep, hf_datatype,
2301 offset = dissect_spoolss_relstr(
2302 tvb, offset, pinfo, tree, drep, hf_parameters,
2306 * XXX - what *is* the length of this security descriptor?
2307 * "prs_PRINTER_INFO_2()" is passed to "defer_ptr()", but
2308 * "defer_ptr" takes, as an argument, a function with a
2309 * different calling sequence from "prs_PRINTER_INFO_2()",
2310 * lacking the "len" argument, so that won't work.
2313 offset = dissect_ndr_uint32(
2314 tvb, offset, pinfo, NULL, drep, hf_offset,
2317 dissect_nt_sec_desc(
2318 tvb, secdesc_offset, pinfo, tree, drep,
2320 &spoolss_printer_access_mask_info);
2322 offset = dissect_printer_attributes(tvb, offset, pinfo, tree, drep);
2324 offset = dissect_ndr_uint32(
2325 tvb, offset, pinfo, NULL, drep, hf_printer_priority,
2328 offset = dissect_ndr_uint32(
2329 tvb, offset, pinfo, NULL, drep,
2330 hf_printer_default_priority, NULL);
2332 offset = dissect_ndr_uint32(
2333 tvb, offset, pinfo, NULL, drep, hf_start_time, NULL);
2335 offset = dissect_ndr_uint32(
2336 tvb, offset, pinfo, NULL, drep, hf_end_time, NULL);
2338 offset = dissect_ndr_uint32(
2339 tvb, offset, pinfo, tree, drep,
2340 hf_printer_status, NULL);
2342 offset = dissect_ndr_uint32(
2343 tvb, offset, pinfo, NULL, drep, hf_printer_jobs,
2346 offset = dissect_ndr_uint32(
2347 tvb, offset, pinfo, NULL, drep,
2348 hf_printer_averageppm, NULL);
2357 static gint ett_PRINTER_INFO_3 = -1;
2359 static int dissect_PRINTER_INFO_3(tvbuff_t *tvb, int offset,
2360 packet_info *pinfo, proto_tree *tree,
2363 offset = dissect_ndr_uint32(
2364 tvb, offset, pinfo, tree, drep,
2365 hf_printer_flags, NULL);
2367 offset = dissect_nt_sec_desc(
2368 tvb, offset, pinfo, tree, drep,
2370 &spoolss_printer_access_mask_info);
2379 static gint ett_PRINTER_INFO_7 = -1;
2381 static const value_string getprinter_action_vals[] = {
2382 { DS_PUBLISH, "Publish" },
2383 { DS_UNPUBLISH, "Unpublish" },
2384 { DS_UPDATE, "Update" },
2386 /* Not sure what the constant values are here */
2388 /* { DS_PENDING, "Pending" }, */
2389 /* { DS_REPUBLISH, "Republish" }, */
2394 static int dissect_PRINTER_INFO_7(tvbuff_t *tvb, int offset,
2395 packet_info *pinfo, proto_tree *tree,
2398 offset = dissect_spoolss_relstr(
2399 tvb, offset, pinfo, tree, drep, hf_printer_guid,
2402 offset = dissect_ndr_uint32(
2403 tvb, offset, pinfo, tree, drep,
2404 hf_printer_action, NULL);
2410 * PRINTER_DATATYPE structure
2413 static gint ett_PRINTER_DATATYPE = -1;
2415 static int dissect_PRINTER_DATATYPE(tvbuff_t *tvb, int offset,
2416 packet_info *pinfo, proto_tree *tree,
2419 dcerpc_info *di = pinfo->private_data;
2421 if (di->conformant_run)
2424 offset = dissect_ndr_cvstring(
2425 tvb, offset, pinfo, tree, drep, sizeof(guint16),
2426 hf_datatype, TRUE, NULL);
2432 * USER_LEVEL_1 structure
2435 static gint ett_USER_LEVEL_1 = -1;
2437 static int hf_userlevel_size = -1;
2438 static int hf_userlevel_client = -1;
2439 static int hf_userlevel_user = -1;
2440 static int hf_userlevel_build = -1;
2441 static int hf_userlevel_major = -1;
2442 static int hf_userlevel_minor = -1;
2443 static int hf_userlevel_processor = -1;
2445 static int dissect_USER_LEVEL_1(tvbuff_t *tvb, int offset,
2446 packet_info *pinfo, proto_tree *tree,
2451 /* Guy has pointed out that this dissection looks wrong. In
2452 the wireshark output for a USER_LEVEL_1 it looks like the
2453 info level and container pointer are transposed. I'm not
2454 even sure this structure is a container. */
2456 offset = dissect_ndr_uint32(
2457 tvb, offset, pinfo, tree, drep, hf_level, &level);
2459 offset = dissect_ndr_uint32(
2460 tvb, offset, pinfo, tree, drep, hf_userlevel_size, NULL);
2462 offset = dissect_ndr_str_pointer_item(
2463 tvb, offset, pinfo, tree, drep, NDR_POINTER_UNIQUE,
2464 "Client", hf_userlevel_client, 0);
2466 offset = dissect_ndr_str_pointer_item(
2467 tvb, offset, pinfo, tree, drep, NDR_POINTER_UNIQUE,
2468 "User", hf_userlevel_user, 0);
2470 offset = dissect_ndr_uint32(
2471 tvb, offset, pinfo, tree, drep, hf_userlevel_build, NULL);
2473 offset = dissect_ndr_uint32(
2474 tvb, offset, pinfo, tree, drep, hf_userlevel_major, NULL);
2476 offset = dissect_ndr_uint32(
2477 tvb, offset, pinfo, tree, drep, hf_userlevel_minor, NULL);
2479 offset = dissect_ndr_uint32(
2480 tvb, offset, pinfo, tree, drep, hf_userlevel_processor, NULL);
2486 * USER_LEVEL_CTR structure
2489 static gint ett_USER_LEVEL_CTR = -1;
2491 static int dissect_USER_LEVEL_CTR(tvbuff_t *tvb, int offset,
2492 packet_info *pinfo, proto_tree *tree,
2495 dcerpc_info *di = pinfo->private_data;
2497 proto_tree *subtree;
2500 if (di->conformant_run)
2503 item = proto_tree_add_text(
2504 tree, tvb, offset, 0, "User level container");
2506 subtree = proto_item_add_subtree(item, ett_USER_LEVEL_CTR);
2508 offset = dissect_ndr_uint32(
2509 tvb, offset, pinfo, subtree, drep, hf_level, &level);
2513 offset = dissect_ndr_pointer(
2514 tvb, offset, pinfo, subtree, drep,
2515 dissect_USER_LEVEL_1, NDR_POINTER_UNIQUE,
2516 "User level 1", -1);
2519 proto_tree_add_text(
2520 tree, tvb, offset, 0,
2521 "[Info level %d not decoded]", level);
2529 * SpoolssOpenPrinterEx
2532 static int SpoolssOpenPrinterEx_q(tvbuff_t *tvb, int offset,
2533 packet_info *pinfo, proto_tree *tree,
2536 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2537 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
2542 dcv->private_data=NULL;
2543 offset = dissect_ndr_pointer_cb(
2544 tvb, offset, pinfo, tree, drep,
2545 dissect_ndr_wchar_cvstring, NDR_POINTER_UNIQUE,
2546 "Printer name", hf_printername, cb_wstr_postprocess,
2547 GINT_TO_POINTER(CB_STR_COL_INFO | CB_STR_SAVE | 1));
2548 name = dcv->private_data;
2550 /* OpenPrinterEx() stores the key/value in se_data */
2551 if(!pinfo->fd->flags.visited){
2553 dcv->se_data = se_strdup_printf("%s",
2558 offset = dissect_ndr_pointer(
2559 tvb, offset, pinfo, tree, drep,
2560 dissect_PRINTER_DATATYPE, NDR_POINTER_UNIQUE,
2561 "Printer datatype", -1);
2563 offset = dissect_DEVMODE_CTR(tvb, offset, pinfo, tree, drep);
2567 if (name[0] == '\\' && name[1] == '\\')
2570 /* Determine if we are opening a printer or a print server */
2572 if (strchr(name, '\\'))
2573 offset = dissect_nt_access_mask(
2574 tvb, offset, pinfo, tree, drep,
2576 &spoolss_printer_access_mask_info, NULL);
2578 offset = dissect_nt_access_mask(
2579 tvb, offset, pinfo, tree, drep,
2581 &spoolss_printserver_access_mask_info, NULL);
2584 /* We can't decide what type of object being opened */
2586 offset = dissect_nt_access_mask(
2587 tvb, offset, pinfo, tree, drep, hf_access_required,
2591 offset = dissect_USER_LEVEL_CTR(tvb, offset, pinfo, tree, drep);
2596 static int SpoolssOpenPrinterEx_r(tvbuff_t *tvb, int offset,
2597 packet_info *pinfo, proto_tree *tree,
2600 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2601 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
2602 e_ctx_hnd policy_hnd;
2603 proto_item *hnd_item;
2608 offset = dissect_nt_policy_hnd(
2609 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, &hnd_item,
2612 offset = dissect_doserror(
2613 tvb, offset, pinfo, tree, drep, hf_rc, &status);
2616 const char *pol_name;
2619 pol_name = ep_strdup_printf(
2620 "OpenPrinterEx(%s)", (char *)dcv->se_data);
2622 pol_name = "Unknown OpenPrinterEx() handle";
2624 if(!pinfo->fd->flags.visited){
2625 dcerpc_store_polhnd_name(&policy_hnd, pinfo, pol_name);
2629 proto_item_append_text(hnd_item, ": %s", pol_name);
2635 static const value_string printer_notify_option_data_vals[] = {
2636 { PRINTER_NOTIFY_SERVER_NAME, "Server name" },
2637 { PRINTER_NOTIFY_PRINTER_NAME, "Printer name" },
2638 { PRINTER_NOTIFY_SHARE_NAME, "Share name" },
2639 { PRINTER_NOTIFY_PORT_NAME, "Port name" },
2640 { PRINTER_NOTIFY_DRIVER_NAME, "Driver name" },
2641 { PRINTER_NOTIFY_COMMENT, "Comment" },
2642 { PRINTER_NOTIFY_LOCATION, "Location" },
2643 { PRINTER_NOTIFY_DEVMODE, "Devmode" },
2644 { PRINTER_NOTIFY_SEPFILE, "Sepfile" },
2645 { PRINTER_NOTIFY_PRINT_PROCESSOR, "Print processor" },
2646 { PRINTER_NOTIFY_PARAMETERS, "Parameters" },
2647 { PRINTER_NOTIFY_DATATYPE, "Datatype" },
2648 { PRINTER_NOTIFY_SECURITY_DESCRIPTOR, "Security descriptor" },
2649 { PRINTER_NOTIFY_ATTRIBUTES, "Attributes" },
2650 { PRINTER_NOTIFY_PRIORITY, "Priority" },
2651 { PRINTER_NOTIFY_DEFAULT_PRIORITY, "Default priority" },
2652 { PRINTER_NOTIFY_START_TIME, "Start time" },
2653 { PRINTER_NOTIFY_UNTIL_TIME, "Until time" },
2654 { PRINTER_NOTIFY_STATUS, "Status" },
2655 { PRINTER_NOTIFY_STATUS_STRING, "Status string" },
2656 { PRINTER_NOTIFY_CJOBS, "Cjobs" },
2657 { PRINTER_NOTIFY_AVERAGE_PPM, "Average PPM" },
2658 { PRINTER_NOTIFY_TOTAL_PAGES, "Total pages" },
2659 { PRINTER_NOTIFY_PAGES_PRINTED, "Pages printed" },
2660 { PRINTER_NOTIFY_TOTAL_BYTES, "Total bytes" },
2661 { PRINTER_NOTIFY_BYTES_PRINTED, "Bytes printed" },
2665 static const value_string job_notify_option_data_vals[] = {
2666 { JOB_NOTIFY_PRINTER_NAME, "Printer name" },
2667 { JOB_NOTIFY_MACHINE_NAME, "Machine name" },
2668 { JOB_NOTIFY_PORT_NAME, "Port name" },
2669 { JOB_NOTIFY_USER_NAME, "User name" },
2670 { JOB_NOTIFY_NOTIFY_NAME, "Notify name" },
2671 { JOB_NOTIFY_DATATYPE, "Data type" },
2672 { JOB_NOTIFY_PRINT_PROCESSOR, "Print processor" },
2673 { JOB_NOTIFY_PARAMETERS, "Parameters" },
2674 { JOB_NOTIFY_DRIVER_NAME, "Driver name" },
2675 { JOB_NOTIFY_DEVMODE, "Devmode" },
2676 { JOB_NOTIFY_STATUS, "Status" },
2677 { JOB_NOTIFY_STATUS_STRING, "Status string" },
2678 { JOB_NOTIFY_SECURITY_DESCRIPTOR, "Security descriptor" },
2679 { JOB_NOTIFY_DOCUMENT, "Document" },
2680 { JOB_NOTIFY_PRIORITY, "Priority" },
2681 { JOB_NOTIFY_POSITION, "Position" },
2682 { JOB_NOTIFY_SUBMITTED, "Submitted" },
2683 { JOB_NOTIFY_START_TIME, "Start time" },
2684 { JOB_NOTIFY_UNTIL_TIME, "Until time" },
2685 { JOB_NOTIFY_TIME, "Time" },
2686 { JOB_NOTIFY_TOTAL_PAGES, "Total pages" },
2687 { JOB_NOTIFY_PAGES_PRINTED, "Pages printed" },
2688 { JOB_NOTIFY_TOTAL_BYTES, "Total bytes" },
2689 { JOB_NOTIFY_BYTES_PRINTED, "Bytes printed" },
2694 dissect_notify_field(tvbuff_t *tvb, int offset, packet_info *pinfo,
2695 proto_tree *tree, guint8 *drep, guint16 type,
2701 offset = dissect_ndr_uint16(
2702 tvb, offset, pinfo, NULL, drep,
2703 hf_notify_field, &field);
2706 case PRINTER_NOTIFY_TYPE:
2707 str = val_to_str(field, printer_notify_option_data_vals,
2710 case JOB_NOTIFY_TYPE:
2711 str = val_to_str(field, job_notify_option_data_vals,
2715 str = "Unknown notify type";
2719 proto_tree_add_text(tree, tvb, offset - 2, 2,
2720 "Field: %s (%d)", str, field);
2729 dissect_NOTIFY_OPTION_DATA(tvbuff_t *tvb, int offset, packet_info *pinfo,
2730 proto_tree *tree, guint8 *drep)
2732 dcerpc_info *di = pinfo->private_data;
2733 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
2737 if (di->conformant_run)
2740 offset = dissect_ndr_uint32(
2741 tvb, offset, pinfo, tree, drep,
2742 hf_notify_option_data_count, &count);
2744 type = GPOINTER_TO_INT(dcv->private_data);
2746 for (i = 0; i < count; i++)
2747 offset = dissect_notify_field(
2748 tvb, offset, pinfo, tree, drep, type, NULL);
2753 static const value_string printer_notify_types[] =
2755 { PRINTER_NOTIFY_TYPE, "Printer notify" },
2756 { JOB_NOTIFY_TYPE, "Job notify" },
2760 static const char *notify_plural(int count)
2763 return "notification";
2768 static gint ett_NOTIFY_OPTION = -1;
2771 dissect_NOTIFY_OPTION(tvbuff_t *tvb, int offset, packet_info *pinfo,
2772 proto_tree *tree, guint8 *drep)
2774 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2775 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
2777 proto_tree *subtree;
2781 item = proto_tree_add_text(tree, tvb, offset, 0, "Notify Option");
2783 subtree = proto_item_add_subtree(item, ett_NOTIFY_OPTION);
2785 offset = dissect_ndr_uint16(tvb, offset, pinfo, subtree, drep,
2786 hf_notify_option_type, &type);
2788 proto_item_append_text(
2789 item, ": %s", val_to_str(type, printer_notify_types,
2792 offset = dissect_ndr_uint16(tvb, offset, pinfo, subtree, drep,
2793 hf_notify_option_reserved1, NULL);
2795 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
2796 hf_notify_option_reserved2, NULL);
2798 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
2799 hf_notify_option_reserved3, NULL);
2801 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
2802 hf_notify_option_count, &count);
2804 proto_item_append_text(
2805 item, ", %d %s", count, notify_plural(count));
2807 dcv->private_data = GINT_TO_POINTER((int)type);
2809 offset = dissect_ndr_pointer(
2810 tvb, offset, pinfo, subtree, drep,
2811 dissect_NOTIFY_OPTION_DATA, NDR_POINTER_UNIQUE,
2812 "Notify Option Data", -1);
2818 dissect_NOTIFY_OPTIONS_ARRAY(tvbuff_t *tvb, int offset,
2819 packet_info *pinfo, proto_tree *tree,
2822 /* Why is a check for di->conformant_run not required here? */
2824 offset = dissect_ndr_ucarray(
2825 tvb, offset, pinfo, tree, drep, dissect_NOTIFY_OPTION);
2830 static gint ett_notify_options_flags = -1;
2832 static const true_false_string tfs_notify_options_flags_refresh = {
2833 "Data for all monitored fields is present",
2834 "Data for all monitored fields not present"
2838 dissect_notify_options_flags(tvbuff_t *tvb, int offset, packet_info *pinfo,
2839 proto_tree *tree, guint8 *drep)
2842 proto_tree *subtree;
2845 offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
2846 hf_notify_options_flags,
2849 item = proto_tree_add_text(tree, tvb, offset - 4, 4,
2850 "Flags: 0x%08x", flags);
2852 subtree = proto_item_add_subtree(item, ett_notify_options_flags);
2854 proto_tree_add_boolean(
2855 subtree, hf_notify_options_flags_refresh,
2856 tvb, offset, 4, flags);
2862 dissect_NOTIFY_OPTIONS_ARRAY_CTR(tvbuff_t *tvb, int offset,
2863 packet_info *pinfo, proto_tree *tree,
2866 dcerpc_info *di = pinfo->private_data;
2868 if (di->conformant_run)
2871 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2872 hf_notify_options_version, NULL);
2874 offset = dissect_notify_options_flags(tvb, offset, pinfo, tree, drep);
2876 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2877 hf_notify_options_count, NULL);
2879 offset = dissect_ndr_pointer(
2880 tvb, offset, pinfo, tree, drep,
2881 dissect_NOTIFY_OPTIONS_ARRAY, NDR_POINTER_UNIQUE,
2882 "Notify Options Array", -1);
2891 static gint ett_rffpcnex_flags = -1;
2893 static int hf_rffpcnex_flags = -1;
2894 static int hf_rffpcnex_options = -1;
2896 static int hf_rffpcnex_flags_add_printer = -1;
2897 static int hf_rffpcnex_flags_set_printer = -1;
2898 static int hf_rffpcnex_flags_delete_printer = -1;
2899 static int hf_rffpcnex_flags_failed_printer_connection = -1;
2901 static const true_false_string tfs_rffpcnex_flags_add_printer = {
2902 "Notify on add printer",
2903 "Don't notify on add printer"
2906 static const true_false_string tfs_rffpcnex_flags_set_printer = {
2907 "Notify on set printer",
2908 "Don't notify on set printer"
2911 static const true_false_string tfs_rffpcnex_flags_delete_printer = {
2912 "Notify on delete printer",
2913 "Don't notify on delete printer"
2916 static const true_false_string tfs_rffpcnex_flags_failed_connection_printer = {
2917 "Notify on failed printer connection",
2918 "Don't notify on failed printer connection"
2921 static int hf_rffpcnex_flags_add_job = -1;
2922 static int hf_rffpcnex_flags_set_job = -1;
2923 static int hf_rffpcnex_flags_delete_job = -1;
2924 static int hf_rffpcnex_flags_write_job = -1;
2926 static const true_false_string tfs_rffpcnex_flags_add_job = {
2927 "Notify on add job",
2928 "Don't notify on add job"
2931 static const true_false_string tfs_rffpcnex_flags_set_job = {
2932 "Notify on set job",
2933 "Don't notify on set job"
2936 static const true_false_string tfs_rffpcnex_flags_delete_job = {
2937 "Notify on delete job",
2938 "Don't notify on delete job"
2941 static const true_false_string tfs_rffpcnex_flags_write_job = {
2942 "Notify on writejob",
2943 "Don't notify on write job"
2946 static int hf_rffpcnex_flags_add_form = -1;
2947 static int hf_rffpcnex_flags_set_form = -1;
2948 static int hf_rffpcnex_flags_delete_form = -1;
2950 static const true_false_string tfs_rffpcnex_flags_add_form = {
2951 "Notify on add form",
2952 "Don't notify on add form"
2955 static const true_false_string tfs_rffpcnex_flags_set_form = {
2956 "Notify on set form",
2957 "Don't notify on set form"
2960 static const true_false_string tfs_rffpcnex_flags_delete_form = {
2961 "Notify on delete form",
2962 "Don't notify on delete form"
2965 static int hf_rffpcnex_flags_add_port = -1;
2966 static int hf_rffpcnex_flags_configure_port = -1;
2967 static int hf_rffpcnex_flags_delete_port = -1;
2969 static const true_false_string tfs_rffpcnex_flags_add_port = {
2970 "Notify on add port",
2971 "Don't notify on add port"
2974 static const true_false_string tfs_rffpcnex_flags_configure_port = {
2975 "Notify on configure port",
2976 "Don't notify on configure port"
2979 static const true_false_string tfs_rffpcnex_flags_delete_port = {
2980 "Notify on delete port",
2981 "Don't notify on delete port"
2984 static int hf_rffpcnex_flags_add_print_processor = -1;
2985 static int hf_rffpcnex_flags_delete_print_processor = -1;
2987 static const true_false_string tfs_rffpcnex_flags_add_print_processor = {
2988 "Notify on add driver",
2989 "Don't notify on add driver"
2992 static const true_false_string tfs_rffpcnex_flags_delete_print_processor = {
2993 "Notify on add driver",
2994 "Don't notify on add driver"
2997 static int hf_rffpcnex_flags_add_driver = -1;
2998 static int hf_rffpcnex_flags_set_driver = -1;
2999 static int hf_rffpcnex_flags_delete_driver = -1;
3001 static const true_false_string tfs_rffpcnex_flags_add_driver = {
3002 "Notify on add driver",
3003 "Don't notify on add driver"
3006 static const true_false_string tfs_rffpcnex_flags_set_driver = {
3007 "Notify on set driver",
3008 "Don't notify on set driver"
3011 static const true_false_string tfs_rffpcnex_flags_delete_driver = {
3012 "Notify on delete driver",
3013 "Don't notify on delete driver"
3016 static int hf_rffpcnex_flags_timeout = -1;
3018 static const true_false_string tfs_rffpcnex_flags_timeout = {
3019 "Notify on timeout",
3020 "Don't notify on timeout"
3023 static int SpoolssRFFPCNEX_q(tvbuff_t *tvb, int offset,
3024 packet_info *pinfo, proto_tree *tree,
3028 proto_item *flags_item;
3029 proto_tree *flags_subtree;
3033 offset = dissect_nt_policy_hnd(
3034 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
3037 offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
3038 hf_rffpcnex_flags, &flags);
3040 flags_item = proto_tree_add_text(tree, tvb, offset - 4, 4,
3041 "Flags: 0x%08x", flags);
3043 flags_subtree = proto_item_add_subtree(flags_item, ett_rffpcnex_flags);
3045 proto_tree_add_boolean(
3046 flags_subtree, hf_rffpcnex_flags_timeout, tvb,
3047 offset - 4, 4, flags);
3049 proto_tree_add_boolean(
3050 flags_subtree, hf_rffpcnex_flags_delete_driver, tvb,
3051 offset - 4, 4, flags);
3053 proto_tree_add_boolean(
3054 flags_subtree, hf_rffpcnex_flags_set_driver, tvb,
3055 offset - 4, 4, flags);
3057 proto_tree_add_boolean(
3058 flags_subtree, hf_rffpcnex_flags_add_driver, tvb,
3059 offset - 4, 4, flags);
3061 proto_tree_add_boolean(
3063 hf_rffpcnex_flags_delete_print_processor, tvb,
3064 offset - 4, 4, flags);
3066 proto_tree_add_boolean(
3067 flags_subtree, hf_rffpcnex_flags_add_print_processor,
3068 tvb, offset - 4, 4, flags);
3070 proto_tree_add_boolean(
3071 flags_subtree, hf_rffpcnex_flags_delete_port, tvb,
3072 offset - 4, 4, flags);
3074 proto_tree_add_boolean(
3075 flags_subtree, hf_rffpcnex_flags_configure_port, tvb,
3076 offset - 4, 4, flags);
3078 proto_tree_add_boolean(
3079 flags_subtree, hf_rffpcnex_flags_add_port, tvb,
3080 offset - 4, 4, flags);
3082 proto_tree_add_boolean(
3083 flags_subtree, hf_rffpcnex_flags_delete_form, tvb,
3084 offset - 4, 4, flags);
3086 proto_tree_add_boolean(
3087 flags_subtree, hf_rffpcnex_flags_set_form, tvb,
3088 offset - 4, 4, flags);
3090 proto_tree_add_boolean(
3091 flags_subtree, hf_rffpcnex_flags_add_form, tvb,
3092 offset - 4, 4, flags);
3094 proto_tree_add_boolean(
3095 flags_subtree, hf_rffpcnex_flags_write_job, tvb,
3096 offset - 4, 4, flags);
3098 proto_tree_add_boolean(
3099 flags_subtree, hf_rffpcnex_flags_delete_job, tvb,
3100 offset - 4, 4, flags);
3102 proto_tree_add_boolean(
3103 flags_subtree, hf_rffpcnex_flags_set_job, tvb,
3104 offset - 4, 4, flags);
3106 proto_tree_add_boolean(
3107 flags_subtree, hf_rffpcnex_flags_add_job, tvb,
3108 offset - 4, 4, flags);
3110 proto_tree_add_boolean(
3112 hf_rffpcnex_flags_failed_printer_connection, tvb,
3113 offset - 4, 4, flags);
3115 proto_tree_add_boolean(
3116 flags_subtree, hf_rffpcnex_flags_delete_printer, tvb,
3117 offset - 4, 4, flags);
3119 proto_tree_add_boolean(
3120 flags_subtree, hf_rffpcnex_flags_set_printer, tvb,
3121 offset - 4, 4, flags);
3123 proto_tree_add_boolean(
3124 flags_subtree, hf_rffpcnex_flags_add_printer, tvb,
3125 offset - 4, 4, flags);
3127 if (flags & SPOOLSS_PRINTER_CHANGE_PRINTER)
3128 proto_item_append_text(flags_item, ", change printer");
3130 if (flags & SPOOLSS_PRINTER_CHANGE_JOB)
3131 proto_item_append_text(flags_item, ", change job");
3133 if (flags & SPOOLSS_PRINTER_CHANGE_FORM)
3134 proto_item_append_text(flags_item, ", change form");
3136 if (flags & SPOOLSS_PRINTER_CHANGE_PORT)
3137 proto_item_append_text(flags_item, ", change port");
3139 if (flags & SPOOLSS_PRINTER_CHANGE_PRINTER_DRIVER)
3140 proto_item_append_text(flags_item, ", change printer driver");
3142 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3143 hf_rffpcnex_options, NULL);
3145 offset = dissect_ndr_str_pointer_item(
3146 tvb, offset, pinfo, tree, drep, NDR_POINTER_UNIQUE,
3147 "Server", hf_servername, 0);
3149 offset = dissect_ndr_uint32(
3150 tvb, offset, pinfo, tree, drep, hf_printerlocal, NULL);
3152 offset = dissect_ndr_pointer(
3153 tvb, offset, pinfo, tree, drep,
3154 dissect_NOTIFY_OPTIONS_ARRAY_CTR, NDR_POINTER_UNIQUE,
3155 "Notify Options Container", -1);
3160 static int SpoolssRFFPCNEX_r(tvbuff_t *tvb, int offset,
3161 packet_info *pinfo, proto_tree *tree,
3166 offset = dissect_doserror(
3167 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
3173 * SpoolssReplyOpenPrinter
3176 static int SpoolssReplyOpenPrinter_q(tvbuff_t *tvb, int offset,
3177 packet_info *pinfo, proto_tree *tree,
3180 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3181 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3182 guint32 printerlocal;
3187 offset = dissect_ndr_cvstring(
3188 tvb, offset, pinfo, tree, drep, sizeof(guint16),
3189 hf_servername, TRUE, &name);
3190 /* ReplyOpenPrinter() stores the printername in se_data */
3191 if(!pinfo->fd->flags.visited){
3194 dcv->se_data = se_strdup(name);
3199 if (check_col(pinfo->cinfo, COL_INFO) && name)
3200 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", name);
3202 offset = dissect_ndr_uint32(
3203 tvb, offset, pinfo, tree, drep, hf_printerlocal,
3206 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3207 hf_printerdata_type, NULL);
3209 offset = dissect_ndr_uint32(
3210 tvb, offset, pinfo, tree, drep, hf_replyopenprinter_unk0,
3213 offset = dissect_ndr_uint32(
3214 tvb, offset, pinfo, tree, drep, hf_replyopenprinter_unk1,
3220 static int SpoolssReplyOpenPrinter_r(tvbuff_t *tvb, int offset,
3221 packet_info *pinfo, proto_tree *tree,
3224 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3225 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3226 e_ctx_hnd policy_hnd;
3227 proto_item *hnd_item;
3232 offset = dissect_nt_policy_hnd(
3233 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, &hnd_item,
3236 offset = dissect_doserror(
3237 tvb, offset, pinfo, tree, drep, hf_rc, &status);
3240 const char *pol_name;
3243 pol_name = ep_strdup_printf(
3244 "ReplyOpenPrinter(%s)", (char *)dcv->se_data);
3246 pol_name = "Unknown ReplyOpenPrinter() handle";
3248 if(!pinfo->fd->flags.visited){
3249 dcerpc_store_polhnd_name(&policy_hnd, pinfo, pol_name);
3253 proto_item_append_text(hnd_item, ": %s", pol_name);
3264 static int SpoolssGetPrinter_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
3265 proto_tree *tree, guint8 *drep _U_)
3267 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3268 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3273 offset = dissect_nt_policy_hnd(
3274 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
3277 offset = dissect_ndr_uint32(
3278 tvb, offset, pinfo, tree, drep, hf_level, &level);
3280 /* GetPrinter() stores the level in se_data */
3281 if(!pinfo->fd->flags.visited){
3282 dcv->se_data = GINT_TO_POINTER((int)level);
3286 if (check_col(pinfo->cinfo, COL_INFO))
3287 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
3289 offset = dissect_spoolss_buffer(
3290 tvb, offset, pinfo, tree, drep, NULL);
3292 offset = dissect_ndr_uint32(
3293 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
3298 static gint ett_PRINTER_INFO = -1;
3300 static int SpoolssGetPrinter_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
3301 proto_tree *tree, guint8 *drep _U_)
3303 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3304 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3306 gint16 level = GPOINTER_TO_INT(dcv->se_data);
3308 proto_tree *subtree = NULL;
3310 if (check_col(pinfo->cinfo, COL_INFO))
3311 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
3315 offset = dissect_spoolss_buffer(
3316 tvb, offset, pinfo, tree, drep, &buffer);
3325 item = proto_tree_add_text(
3326 buffer.tree, buffer.tvb, 0, -1,
3327 "Print info level %d", level);
3329 subtree = proto_item_add_subtree(
3330 item, ett_PRINTER_INFO);
3336 dissect_PRINTER_INFO_0(
3337 buffer.tvb, 0, pinfo, subtree, drep);
3340 dissect_PRINTER_INFO_1(
3341 buffer.tvb, 0, pinfo, subtree, drep);
3344 dissect_PRINTER_INFO_2(
3345 buffer.tvb, 0, pinfo, subtree, drep);
3348 dissect_PRINTER_INFO_3(
3349 buffer.tvb, 0, pinfo, subtree, drep);
3352 dissect_PRINTER_INFO_7(
3353 buffer.tvb, 0, pinfo, subtree, drep);
3356 proto_tree_add_text(
3357 buffer.tree, buffer.tvb, 0, -1,
3358 "[Unknown printer info level %d]", level);
3363 offset = dissect_ndr_uint32(
3364 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
3366 offset = dissect_doserror(
3367 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
3376 static gint ett_SEC_DESC_BUF = -1;
3378 static int hf_secdescbuf_maxlen = -1;
3379 static int hf_secdescbuf_undoc = -1;
3380 static int hf_secdescbuf_len = -1;
3383 dissect_SEC_DESC_BUF(tvbuff_t *tvb, int offset, packet_info *pinfo,
3384 proto_tree *tree, guint8 *drep)
3387 proto_tree *subtree;
3390 /* XXX: I think this is really a array of bytes which can be
3391 dissected using dissect_ndr_cvstring(). The dissected data
3392 can be passed to dissect_nt_sec_desc(). The problem is that
3393 dissect_nt_cvstring() passes back a char * where it really
3394 should pass back a tvb. */
3396 item = proto_tree_add_text(
3397 tree, tvb, offset, 0, "Security descriptor buffer");
3399 subtree = proto_item_add_subtree(item, ett_SEC_DESC_BUF);
3401 offset = dissect_ndr_uint32(
3402 tvb, offset, pinfo, subtree, drep,
3403 hf_secdescbuf_maxlen, NULL);
3405 offset = dissect_ndr_uint32(
3406 tvb, offset, pinfo, subtree, drep,
3407 hf_secdescbuf_undoc, NULL);
3409 offset = dissect_ndr_uint32(
3410 tvb, offset, pinfo, subtree, drep,
3411 hf_secdescbuf_len, &len);
3413 dissect_nt_sec_desc(
3414 tvb, offset, pinfo, subtree, drep, TRUE, len,
3415 &spoolss_printer_access_mask_info);
3423 * SPOOL_PRINTER_INFO_LEVEL
3426 static gint ett_SPOOL_PRINTER_INFO_LEVEL = -1;
3428 /* spool printer info */
3430 static int hf_spool_printer_info_devmode_ptr = -1;
3431 static int hf_spool_printer_info_secdesc_ptr = -1;
3434 dissect_SPOOL_PRINTER_INFO(tvbuff_t *tvb, int offset, packet_info *pinfo,
3435 proto_tree *tree, guint8 *drep)
3438 proto_tree *subtree;
3441 item = proto_tree_add_text(
3442 tree, tvb, offset, 0, "Spool printer info level");
3444 subtree = proto_item_add_subtree(item, ett_SPOOL_PRINTER_INFO_LEVEL);
3446 offset = dissect_ndr_uint32(
3447 tvb, offset, pinfo, subtree, drep, hf_level, &level);
3451 guint32 devmode_ptr, secdesc_ptr;
3453 /* I can't seem to get this working with the correct
3454 dissect_ndr_pointer() function so let's cheat and
3455 dissect the pointers by hand. )-: */
3457 offset = dissect_ndr_uint32(
3458 tvb, offset, pinfo, subtree, drep,
3459 hf_spool_printer_info_devmode_ptr,
3462 offset = dissect_ndr_uint32(
3463 tvb, offset, pinfo, subtree, drep,
3464 hf_spool_printer_info_secdesc_ptr,
3468 offset = dissect_DEVMODE_CTR(
3469 tvb, offset, pinfo, subtree, drep);
3472 offset = dissect_SEC_DESC_BUF(
3473 tvb, offset, pinfo, subtree, drep);
3479 proto_tree_add_text(
3480 subtree, tvb, offset, 0,
3481 "[Unknown spool printer info level %d]", level);
3492 static int hf_setprinter_cmd = -1;
3494 static const value_string setprinter_cmd_vals[] = {
3495 { SPOOLSS_PRINTER_CONTROL_UNPAUSE, "Unpause" },
3496 { SPOOLSS_PRINTER_CONTROL_PAUSE, "Pause" },
3497 { SPOOLSS_PRINTER_CONTROL_RESUME, "Resume" },
3498 { SPOOLSS_PRINTER_CONTROL_PURGE, "Purge" },
3499 { SPOOLSS_PRINTER_CONTROL_SET_STATUS, "Set status" },
3503 static int SpoolssSetPrinter_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
3504 proto_tree *tree, guint8 *drep _U_)
3510 offset = dissect_nt_policy_hnd(
3511 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
3514 offset = dissect_ndr_uint32(
3515 tvb, offset, pinfo, tree, drep, hf_level, &level);
3517 if (check_col(pinfo->cinfo, COL_INFO))
3518 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
3520 offset = dissect_SPOOL_PRINTER_INFO(
3521 tvb, offset, pinfo, tree, drep);
3523 offset = dissect_ndr_uint32(
3524 tvb, offset, pinfo, tree, drep,
3525 hf_setprinter_cmd, NULL);
3530 static int SpoolssSetPrinter_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
3531 proto_tree *tree, guint8 *drep _U_)
3535 offset = dissect_doserror(
3536 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
3545 static const value_string form_type_vals[] =
3547 { SPOOLSS_FORM_USER, "User" },
3548 { SPOOLSS_FORM_BUILTIN, "Builtin" },
3549 { SPOOLSS_FORM_PRINTER, "Printer" },
3553 static gint ett_FORM_REL = -1;
3555 static int dissect_FORM_REL(tvbuff_t *tvb, int offset, packet_info *pinfo,
3556 proto_tree *tree, guint8 *drep, int struct_start)
3559 proto_tree *subtree;
3561 int item_start = offset;
3564 item = proto_tree_add_text(tree, tvb, offset, 0, "Form");
3566 subtree = proto_item_add_subtree(item, ett_FORM_REL);
3568 offset = dissect_ndr_uint32(
3569 tvb, offset, pinfo, subtree, drep, hf_form_flags, &flags);
3571 offset = dissect_spoolss_relstr(
3572 tvb, offset, pinfo, subtree, drep, hf_form_name,
3573 struct_start, &name);
3576 proto_item_append_text(item, ": %s", name);
3580 offset = dissect_ndr_uint32(
3581 tvb, offset, pinfo, subtree, drep,
3582 hf_form_width, NULL);
3584 offset = dissect_ndr_uint32(
3585 tvb, offset, pinfo, subtree, drep,
3586 hf_form_height, NULL);
3588 offset = dissect_ndr_uint32(
3589 tvb, offset, pinfo, subtree, drep,
3590 hf_form_left_margin, NULL);
3592 offset = dissect_ndr_uint32(
3593 tvb, offset, pinfo, subtree, drep,
3594 hf_form_top_margin, NULL);
3596 offset = dissect_ndr_uint32(
3597 tvb, offset, pinfo, subtree, drep,
3598 hf_form_horiz_len, NULL);
3600 offset = dissect_ndr_uint32(
3601 tvb, offset, pinfo, subtree, drep,
3602 hf_form_vert_len, NULL);
3604 proto_item_set_len(item, offset - item_start);
3613 static int SpoolssEnumForms_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
3614 proto_tree *tree, guint8 *drep _U_)
3616 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3617 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3619 proto_item *hidden_item;
3621 hidden_item = proto_tree_add_uint(
3622 tree, hf_form, tvb, offset, 0, 1);
3623 PROTO_ITEM_SET_HIDDEN(hidden_item);
3627 offset = dissect_nt_policy_hnd(
3628 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
3631 offset = dissect_ndr_uint32(
3632 tvb, offset, pinfo, tree, drep, hf_level, &level);
3634 /* EnumForms() stores the level in se_data */
3635 if(!pinfo->fd->flags.visited){
3636 dcv->se_data = GINT_TO_POINTER((int)level);
3639 if (check_col(pinfo->cinfo, COL_INFO))
3640 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
3642 offset = dissect_spoolss_buffer(
3643 tvb, offset, pinfo, tree, drep, NULL);
3645 offset = dissect_ndr_uint32(
3646 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
3651 static int SpoolssEnumForms_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
3652 proto_tree *tree, guint8 *drep _U_)
3654 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3655 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3657 guint32 level = GPOINTER_TO_UINT(dcv->se_data), i, count;
3659 proto_item *hidden_item;
3661 hidden_item = proto_tree_add_uint(
3662 tree, hf_form, tvb, offset, 0, 1);
3663 PROTO_ITEM_SET_HIDDEN(hidden_item);
3667 offset = dissect_spoolss_buffer(
3668 tvb, offset, pinfo, tree, drep, &buffer);
3670 offset = dissect_ndr_uint32(
3671 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
3673 if (check_col(pinfo->cinfo, COL_INFO))
3674 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
3676 offset = dissect_ndr_uint32(
3677 tvb, offset, pinfo, tree, drep, hf_enumforms_num, &count);
3679 /* Unfortunately this array isn't in NDR format so we can't
3680 use prs_array(). The other weird thing is the
3681 struct_start being inside the loop rather than outside.
3686 for (i = 0; i < count; i++) {
3687 int struct_start = buffer_offset;
3689 buffer_offset = dissect_FORM_REL(
3690 buffer.tvb, buffer_offset, pinfo, buffer.tree, drep,
3694 offset = dissect_doserror(
3695 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
3701 * SpoolssDeletePrinter
3704 static int SpoolssDeletePrinter_q(tvbuff_t *tvb, int offset,
3705 packet_info *pinfo, proto_tree *tree,
3710 offset = dissect_nt_policy_hnd(
3711 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
3717 static int SpoolssDeletePrinter_r(tvbuff_t *tvb, int offset,
3718 packet_info *pinfo, proto_tree *tree,
3723 offset = dissect_nt_policy_hnd(
3724 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
3727 offset = dissect_doserror(
3728 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
3733 static int SpoolssAddPrinterEx_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
3734 proto_tree *tree, guint8 *drep _U_)
3736 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3737 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3738 e_ctx_hnd policy_hnd;
3739 proto_item *hnd_item;
3744 offset = dissect_nt_policy_hnd(
3745 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, &hnd_item,
3748 offset = dissect_doserror(
3749 tvb, offset, pinfo, tree, drep, hf_rc, &status);
3752 const char *pol_name;
3755 pol_name = ep_strdup_printf(
3756 "AddPrinterEx(%s)", (char *)dcv->se_data);
3758 pol_name = "Unknown AddPrinterEx() handle";
3760 if(!pinfo->fd->flags.visited){
3761 dcerpc_store_polhnd_name(&policy_hnd, pinfo, pol_name);
3765 proto_item_append_text(hnd_item, ": %s", pol_name);
3772 * SpoolssEnumPrinterData
3775 static int hf_enumprinterdata_enumindex = -1;
3776 static int hf_enumprinterdata_value_offered = -1;
3777 static int hf_enumprinterdata_data_offered = -1;
3778 static int hf_enumprinterdata_value_len = -1;
3779 static int hf_enumprinterdata_value_needed = -1;
3780 static int hf_enumprinterdata_data_needed = -1;
3782 static int SpoolssEnumPrinterData_q(tvbuff_t *tvb, int offset,
3783 packet_info *pinfo, proto_tree *tree,
3787 proto_item *hidden_item;
3789 hidden_item = proto_tree_add_uint(
3790 tree, hf_printerdata, tvb, offset, 0, 1);
3791 PROTO_ITEM_SET_HIDDEN(hidden_item);
3795 offset = dissect_nt_policy_hnd(
3796 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
3799 offset = dissect_ndr_uint32(
3800 tvb, offset, pinfo, tree, drep,
3801 hf_enumprinterdata_enumindex, &ndx);
3803 if (check_col(pinfo->cinfo, COL_INFO))
3804 col_append_fstr(pinfo->cinfo, COL_INFO, ", index %d", ndx);
3806 offset = dissect_ndr_uint32(
3807 tvb, offset, pinfo, tree, drep,
3808 hf_enumprinterdata_value_offered, NULL);
3810 offset = dissect_ndr_uint32(
3811 tvb, offset, pinfo, tree, drep,
3812 hf_enumprinterdata_data_offered, NULL);
3817 static int SpoolssEnumPrinterData_r(tvbuff_t *tvb, int offset,
3818 packet_info *pinfo, proto_tree *tree,
3821 guint32 value_len, type;
3823 proto_item *value_item;
3824 proto_tree *value_subtree;
3825 proto_item *hidden_item;
3827 hidden_item = proto_tree_add_uint(
3828 tree, hf_printerdata, tvb, offset, 0, 1);
3829 PROTO_ITEM_SET_HIDDEN(hidden_item);
3833 value_item = proto_tree_add_text(tree, tvb, offset, 0, "Value");
3835 value_subtree = proto_item_add_subtree(
3836 value_item, ett_printerdata_value);
3838 offset = dissect_ndr_uint32(
3839 tvb, offset, pinfo, value_subtree, drep,
3840 hf_enumprinterdata_value_len, &value_len);
3843 dissect_spoolss_uint16uni(
3844 tvb, offset, pinfo, value_subtree, drep, &value,
3847 offset += value_len * 2;
3849 if (check_col(pinfo->cinfo, COL_INFO) && value && value[0])
3850 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", value);
3852 proto_item_append_text(value_item, ": %s", value);
3854 hidden_item = proto_tree_add_string(
3855 tree, hf_printerdata_value, tvb, offset, 0, value);
3856 PROTO_ITEM_SET_HIDDEN(hidden_item);
3861 proto_item_set_len(value_item, value_len * 2 + 4);
3863 offset = dissect_ndr_uint32(
3864 tvb, offset, pinfo, value_subtree, drep,
3865 hf_enumprinterdata_value_needed, NULL);
3867 offset = dissect_ndr_uint32(
3868 tvb, offset, pinfo, tree, drep, hf_printerdata_type, &type);
3870 offset = dissect_printerdata_data(
3871 tvb, offset, pinfo, tree, drep, type);
3873 offset = dissect_ndr_uint32(
3874 tvb, offset, pinfo, tree, drep,
3875 hf_enumprinterdata_data_needed, NULL);
3877 offset = dissect_doserror(
3878 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
3884 * SpoolssEnumPrinters
3887 static gint ett_enumprinters_flags = -1;
3889 static int hf_enumprinters_flags = -1;
3890 static int hf_enumprinters_flags_local = -1;
3891 static int hf_enumprinters_flags_name = -1;
3892 static int hf_enumprinters_flags_shared = -1;
3893 static int hf_enumprinters_flags_default = -1;
3894 static int hf_enumprinters_flags_connections = -1;
3895 static int hf_enumprinters_flags_network = -1;
3896 static int hf_enumprinters_flags_remote = -1;
3898 static int SpoolssEnumPrinters_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
3899 proto_tree *tree, guint8 *drep _U_)
3901 guint32 level, flags;
3902 proto_tree *flags_subtree;
3903 proto_item *flags_item;
3904 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3905 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3909 offset = dissect_ndr_uint32(
3910 tvb, offset, pinfo, NULL, drep,
3911 hf_enumprinters_flags, &flags);
3913 flags_item = proto_tree_add_text(tree, tvb, offset - 4, 4,
3914 "Flags: 0x%08x", flags);
3916 flags_subtree = proto_item_add_subtree(
3917 flags_item, ett_enumprinters_flags);
3919 proto_tree_add_boolean(
3920 flags_subtree, hf_enumprinters_flags_network, tvb,
3921 offset - 4, 4, flags);
3923 proto_tree_add_boolean(
3924 flags_subtree, hf_enumprinters_flags_shared, tvb,
3925 offset - 4, 4, flags);
3927 proto_tree_add_boolean(
3928 flags_subtree, hf_enumprinters_flags_remote, tvb,
3929 offset - 4, 4, flags);
3931 proto_tree_add_boolean(
3932 flags_subtree, hf_enumprinters_flags_name, tvb,
3933 offset - 4, 4, flags);
3935 proto_tree_add_boolean(
3936 flags_subtree, hf_enumprinters_flags_connections, tvb,
3937 offset - 4, 4, flags);
3939 proto_tree_add_boolean(
3940 flags_subtree, hf_enumprinters_flags_local, tvb,
3941 offset - 4, 4, flags);
3943 proto_tree_add_boolean(
3944 flags_subtree, hf_enumprinters_flags_default, tvb,
3945 offset - 4, 4, flags);
3947 offset = dissect_ndr_str_pointer_item(
3948 tvb, offset, pinfo, tree, drep,
3949 NDR_POINTER_UNIQUE, "Server name", hf_servername, 0);
3951 offset = dissect_ndr_uint32(
3952 tvb, offset, pinfo, tree, drep, hf_level, &level);
3954 /* GetPrinter() stores the level in se_data */
3955 if(!pinfo->fd->flags.visited){
3956 dcv->se_data = GINT_TO_POINTER((int)level);
3959 if (check_col(pinfo->cinfo, COL_INFO))
3960 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
3962 offset = dissect_spoolss_buffer(
3963 tvb, offset, pinfo, tree, drep, NULL);
3965 offset = dissect_ndr_uint32(
3966 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
3971 static int SpoolssEnumPrinters_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
3972 proto_tree *tree, guint8 *drep _U_)
3974 guint32 num_drivers;
3975 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3976 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
3977 gint16 level = GPOINTER_TO_INT(dcv->se_data);
3980 proto_tree *subtree = NULL;
3982 if (check_col(pinfo->cinfo, COL_INFO))
3983 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
3987 offset = dissect_spoolss_buffer(
3988 tvb, offset, pinfo, tree, drep, &buffer);
3997 item = proto_tree_add_text(
3998 buffer.tree, buffer.tvb, 0, -1,
3999 "Printer info level %d", level);
4000 subtree = proto_item_add_subtree(
4001 item, ett_PRINTER_INFO);
4006 dissect_PRINTER_INFO_0(
4007 buffer.tvb, 0, pinfo, subtree, drep);
4010 dissect_PRINTER_INFO_1(
4011 buffer.tvb, 0, pinfo, subtree, drep);
4014 dissect_PRINTER_INFO_2(
4015 buffer.tvb, 0, pinfo, subtree, drep);
4018 dissect_PRINTER_INFO_3(
4019 buffer.tvb, 0, pinfo, subtree, drep);
4022 dissect_PRINTER_INFO_7(
4023 buffer.tvb, 0, pinfo, subtree, drep);
4026 proto_tree_add_text(
4027 buffer.tree, buffer.tvb, 0, -1,
4028 "[Unknown printer info level %d]", level);
4033 offset = dissect_ndr_uint32(
4034 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
4036 offset = dissect_ndr_uint32(
4037 tvb, offset, pinfo, tree, drep, hf_returned,
4040 offset = dissect_doserror(
4041 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4049 static int SpoolssAddPrinterDriver_r(tvbuff_t *tvb, int offset,
4050 packet_info *pinfo, proto_tree *tree,
4055 offset = dissect_doserror(
4056 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4065 static gint ett_FORM_1 = -1;
4067 static int dissect_FORM_1(tvbuff_t *tvb, int offset, packet_info *pinfo,
4068 proto_tree *tree, guint8 *drep)
4071 proto_tree *subtree;
4074 item = proto_tree_add_text(tree, tvb, offset, 0, "Form level 1");
4076 subtree = proto_item_add_subtree(item, ett_FORM_1);
4078 offset = dissect_ndr_str_pointer_item(
4079 tvb, offset, pinfo, subtree, drep, NDR_POINTER_UNIQUE,
4080 "Name", hf_form_name, 0);
4082 /* Eek - we need to know whether this pointer was NULL or not.
4083 Currently there is not any way to do this. */
4085 if (tvb_length_remaining(tvb, offset) == 0)
4088 offset = dissect_ndr_uint32(
4089 tvb, offset, pinfo, subtree, drep, hf_form_flags, &flags);
4091 offset = dissect_ndr_uint32(
4092 tvb, offset, pinfo, subtree, drep,
4093 hf_form_unknown, NULL);
4095 offset = dissect_ndr_uint32(
4096 tvb, offset, pinfo, subtree, drep,
4097 hf_form_width, NULL);
4099 offset = dissect_ndr_uint32(
4100 tvb, offset, pinfo, subtree, drep,
4101 hf_form_height, NULL);
4103 offset = dissect_ndr_uint32(
4104 tvb, offset, pinfo, subtree, drep,
4105 hf_form_left_margin, NULL);
4107 offset = dissect_ndr_uint32(
4108 tvb, offset, pinfo, subtree, drep,
4109 hf_form_top_margin, NULL);
4111 offset = dissect_ndr_uint32(
4112 tvb, offset, pinfo, subtree, drep,
4113 hf_form_horiz_len, NULL);
4115 offset = dissect_ndr_uint32(
4116 tvb, offset, pinfo, subtree, drep,
4117 hf_form_vert_len, NULL);
4127 static gint ett_FORM_CTR = -1;
4129 static int dissect_FORM_CTR(tvbuff_t *tvb, int offset,
4130 packet_info *pinfo, proto_tree *tree,
4134 proto_tree *subtree;
4137 item = proto_tree_add_text(tree, tvb, offset, 0, "Form container");
4139 subtree = proto_item_add_subtree(item, ett_FORM_CTR);
4141 offset = dissect_ndr_uint32(
4142 tvb, offset, pinfo, subtree, drep, hf_form_level, &level);
4146 offset = dissect_FORM_1(tvb, offset, pinfo, subtree, drep);
4150 proto_tree_add_text(
4151 subtree, tvb, offset, 0,
4152 "[Unknown form info level %d]", level);
4163 static int SpoolssAddForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
4164 proto_tree *tree, guint8 *drep _U_)
4166 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4167 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
4169 proto_item *hidden_item;
4171 hidden_item = proto_tree_add_uint(
4172 tree, hf_form, tvb, offset, 0, 1);
4173 PROTO_ITEM_SET_HIDDEN(hidden_item);
4177 offset = dissect_nt_policy_hnd(
4178 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
4181 offset = dissect_ndr_uint32(
4182 tvb, offset, pinfo, tree, drep, hf_form_level, &level);
4184 if (check_col(pinfo->cinfo, COL_INFO))
4185 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
4187 /* AddForm() stores the level in se_data */
4188 if(!pinfo->fd->flags.visited){
4189 dcv->se_data = GUINT_TO_POINTER((int)level);
4192 offset = dissect_FORM_CTR(tvb, offset, pinfo, tree, drep);
4197 static int SpoolssAddForm_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4198 proto_tree *tree, guint8 *drep _U_)
4200 proto_item *hidden_item;
4202 hidden_item = proto_tree_add_uint(
4203 tree, hf_form, tvb, offset, 0, 1);
4204 PROTO_ITEM_SET_HIDDEN(hidden_item);
4208 offset = dissect_doserror(
4209 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4218 static int SpoolssDeleteForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
4219 proto_tree *tree, guint8 *drep _U_)
4221 proto_item *hidden_item;
4224 hidden_item = proto_tree_add_uint(
4225 tree, hf_form, tvb, offset, 0, 1);
4226 PROTO_ITEM_SET_HIDDEN(hidden_item);
4230 offset = dissect_nt_policy_hnd(
4231 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
4234 offset = dissect_ndr_cvstring(
4235 tvb, offset, pinfo, tree, drep,
4236 sizeof(guint16), hf_form_name, TRUE, &name);
4238 if (check_col(pinfo->cinfo, COL_INFO) && name)
4239 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", name);
4246 static int SpoolssDeleteForm_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4247 proto_tree *tree, guint8 *drep _U_)
4249 proto_item *hidden_item;
4251 hidden_item = proto_tree_add_uint(
4252 tree, hf_form, tvb, offset, 0, 1);
4253 PROTO_ITEM_SET_HIDDEN(hidden_item);
4257 offset = dissect_doserror(
4258 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4267 static int SpoolssSetForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
4268 proto_tree *tree, guint8 *drep _U_)
4272 proto_item *hidden_item;
4274 hidden_item = proto_tree_add_uint(
4275 tree, hf_form, tvb, offset, 0, 1);
4276 PROTO_ITEM_SET_HIDDEN(hidden_item);
4280 offset = dissect_nt_policy_hnd(
4281 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
4284 offset = dissect_ndr_cvstring(
4285 tvb, offset, pinfo, tree, drep,
4286 sizeof(guint16), hf_form_name, TRUE, &name);
4288 if (check_col(pinfo->cinfo, COL_INFO) && name)
4289 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", name);
4293 offset = dissect_ndr_uint32(
4294 tvb, offset, pinfo, tree, drep, hf_form_level, &level);
4296 if (check_col(pinfo->cinfo, COL_INFO))
4297 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
4299 offset = dissect_FORM_CTR(tvb, offset, pinfo, tree, drep);
4304 static int SpoolssSetForm_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4305 proto_tree *tree, guint8 *drep _U_)
4307 proto_item *hidden_item;
4309 hidden_item = proto_tree_add_uint(
4310 tree, hf_form, tvb, offset, 0, 1);
4311 PROTO_ITEM_SET_HIDDEN(hidden_item);
4315 offset = dissect_doserror(
4316 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4325 static int SpoolssGetForm_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
4326 proto_tree *tree, guint8 *drep _U_)
4328 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4329 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
4330 proto_item *hidden_item;
4334 hidden_item = proto_tree_add_uint(
4335 tree, hf_form, tvb, offset, 0, 1);
4336 PROTO_ITEM_SET_HIDDEN(hidden_item);
4340 offset = dissect_nt_policy_hnd(
4341 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
4344 offset = dissect_ndr_cvstring(
4345 tvb, offset, pinfo, tree, drep,
4346 sizeof(guint16), hf_form_name, TRUE, &name);
4348 if (check_col(pinfo->cinfo, COL_INFO))
4349 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", name);
4351 offset = dissect_ndr_uint32(
4352 tvb, offset, pinfo, tree, drep, hf_form_level, &level);
4354 /* GetForm() stores the level in se_data */
4355 if(!pinfo->fd->flags.visited){
4356 dcv->se_data = GUINT_TO_POINTER((int)level);
4359 if (check_col(pinfo->cinfo, COL_INFO))
4360 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d",
4363 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL);
4365 offset = dissect_ndr_uint32(
4366 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
4371 static int SpoolssGetForm_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4372 proto_tree *tree, guint8 *drep _U_)
4374 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4375 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
4377 guint32 level = GPOINTER_TO_UINT(dcv->se_data);
4378 proto_item *hidden_item;
4380 hidden_item = proto_tree_add_uint(
4381 tree, hf_form, tvb, offset, 0, 1);
4382 PROTO_ITEM_SET_HIDDEN(hidden_item);
4386 offset = dissect_spoolss_buffer(
4387 tvb, offset, pinfo, tree, drep, &buffer);
4389 offset = dissect_ndr_uint32(
4390 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
4392 if (check_col(pinfo->cinfo, COL_INFO))
4393 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
4396 int buffer_offset = 0;
4400 int struct_start = buffer_offset;
4402 buffer_offset = dissect_FORM_REL(
4403 buffer.tvb, buffer_offset, pinfo, tree, drep,
4409 proto_tree_add_text(
4410 buffer.tree, buffer.tvb, buffer_offset, -1,
4411 "[Unknown form info level %d]", level);
4416 offset = dissect_doserror(
4417 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4423 /* A generic reply function that just parses the status code. Useful for
4424 unimplemented dissectors so the status code can be inserted into the
4427 static int SpoolssGeneric_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4428 proto_tree *tree, guint8 *drep _U_)
4430 int len = tvb_length(tvb);
4432 proto_tree_add_text(tree, tvb, offset, 0,
4433 "[Unimplemented dissector: SPOOLSS]");
4435 offset = dissect_doserror(
4436 tvb, len - 4, pinfo, tree, drep, hf_rc, NULL);
4445 static gint ett_JOB_INFO_1 = -1;
4448 dissect_spoolss_JOB_INFO_1(tvbuff_t *tvb, int offset, packet_info *pinfo,
4449 proto_tree *tree, guint8 *drep)
4452 proto_tree *subtree;
4453 int struct_start = offset;
4454 char *document_name;
4456 item = proto_tree_add_text(tree, tvb, offset, 0, "Job info level 1");
4458 subtree = proto_item_add_subtree(item, ett_JOB_INFO_1);
4460 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
4463 offset = dissect_spoolss_relstr(
4464 tvb, offset, pinfo, subtree, drep, hf_printername,
4465 struct_start, NULL);
4467 offset = dissect_spoolss_relstr(
4468 tvb, offset, pinfo, subtree, drep, hf_servername,
4469 struct_start, NULL);
4471 offset = dissect_spoolss_relstr(
4472 tvb, offset, pinfo, subtree, drep, hf_username,
4473 struct_start, NULL);
4475 offset = dissect_spoolss_relstr(
4476 tvb, offset, pinfo, subtree, drep, hf_documentname,
4477 struct_start, &document_name);
4479 proto_item_append_text(item, ": %s", document_name);
4480 g_free(document_name);
4482 offset = dissect_spoolss_relstr(
4483 tvb, offset, pinfo, subtree, drep, hf_datatype,
4484 struct_start, NULL);
4486 offset = dissect_spoolss_relstr(
4487 tvb, offset, pinfo, subtree, drep, hf_textstatus,
4488 struct_start, NULL);
4490 offset = dissect_job_status(tvb, offset, pinfo, subtree, drep);
4492 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
4493 hf_job_priority, NULL);
4495 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
4496 hf_job_position, NULL);
4498 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
4499 hf_job_totalpages, NULL);
4501 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
4502 hf_job_pagesprinted, NULL);
4504 offset = dissect_SYSTEM_TIME(
4505 tvb, offset, pinfo, subtree, drep, "Job Submission Time",
4508 proto_item_set_len(item, offset - struct_start);
4517 static gint ett_JOB_INFO_2 = -1;
4520 dissect_spoolss_JOB_INFO_2(tvbuff_t *tvb, int offset, packet_info *pinfo,
4521 proto_tree *tree, guint8 *drep)
4524 proto_tree *subtree;
4525 int struct_start = offset;
4526 char *document_name;
4527 guint32 devmode_offset, secdesc_offset;
4529 item = proto_tree_add_text(tree, tvb, offset, 0, "Job info level 2");
4531 subtree = proto_item_add_subtree(item, ett_JOB_INFO_2);
4533 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
4536 offset = dissect_spoolss_relstr(
4537 tvb, offset, pinfo, subtree, drep, hf_printername,
4538 struct_start, NULL);
4540 offset = dissect_spoolss_relstr(
4541 tvb, offset, pinfo, subtree, drep, hf_machinename,
4542 struct_start, NULL);
4544 offset = dissect_spoolss_relstr(
4545 tvb, offset, pinfo, subtree, drep, hf_username,
4546 struct_start, NULL);
4548 offset = dissect_spoolss_relstr(
4549 tvb, offset, pinfo, subtree, drep, hf_documentname,
4550 struct_start, &document_name);
4552 proto_item_append_text(item, ": %s", document_name);
4553 g_free(document_name);
4555 offset = dissect_spoolss_relstr(
4556 tvb, offset, pinfo, subtree, drep, hf_notifyname,
4557 struct_start, NULL);
4559 offset = dissect_spoolss_relstr(
4560 tvb, offset, pinfo, subtree, drep, hf_datatype,
4561 struct_start, NULL);
4563 offset = dissect_spoolss_relstr(
4564 tvb, offset, pinfo, subtree, drep, hf_printprocessor,
4565 struct_start, NULL);
4567 offset = dissect_spoolss_relstr(
4568 tvb, offset, pinfo, subtree, drep, hf_parameters,
4569 struct_start, NULL);
4571 offset = dissect_spoolss_relstr(
4572 tvb, offset, pinfo, subtree, drep, hf_drivername,
4573 struct_start, NULL);
4575 offset = dissect_ndr_uint32(
4576 tvb, offset, pinfo, NULL, drep, hf_offset,
4580 tvb, devmode_offset - 4 + struct_start, pinfo, subtree, drep);
4582 offset = dissect_spoolss_relstr(
4583 tvb, offset, pinfo, subtree, drep, hf_textstatus,
4584 struct_start, NULL);
4586 offset = dissect_ndr_uint32(
4587 tvb, offset, pinfo, NULL, drep, hf_offset,
4590 dissect_nt_sec_desc(
4591 tvb, secdesc_offset, pinfo, subtree, drep,
4593 &spoolss_job_access_mask_info);
4595 offset = dissect_job_status(tvb, offset, pinfo, subtree, drep);
4597 offset = dissect_ndr_uint32(
4598 tvb, offset, pinfo, subtree, drep, hf_job_priority, NULL);
4600 offset = dissect_ndr_uint32(
4601 tvb, offset, pinfo, subtree, drep, hf_job_position, NULL);
4603 offset = dissect_ndr_uint32(
4604 tvb, offset, pinfo, NULL, drep, hf_start_time, NULL);
4606 offset = dissect_ndr_uint32(
4607 tvb, offset, pinfo, NULL, drep, hf_end_time, NULL);
4609 offset = dissect_ndr_uint32(
4610 tvb, offset, pinfo, subtree, drep, hf_job_totalpages, NULL);
4612 offset = dissect_ndr_uint32(
4613 tvb, offset, pinfo, subtree, drep, hf_job_size, NULL);
4615 offset = dissect_SYSTEM_TIME(
4616 tvb, offset, pinfo, subtree, drep, "Job Submission Time",
4619 offset = dissect_ndr_uint32(
4620 tvb, offset, pinfo, NULL, drep, hf_elapsed_time, NULL);
4622 offset = dissect_ndr_uint32(
4623 tvb, offset, pinfo, subtree, drep, hf_job_pagesprinted, NULL);
4625 proto_item_set_len(item, offset - struct_start);
4634 static int hf_enumjobs_firstjob = -1;
4635 static int hf_enumjobs_numjobs = -1;
4637 static int SpoolssEnumJobs_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
4638 proto_tree *tree, guint8 *drep _U_)
4640 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4641 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
4646 offset = dissect_nt_policy_hnd(
4647 tvb, offset, pinfo, tree, drep,
4648 hf_hnd, NULL, NULL, FALSE, FALSE);
4650 offset = dissect_ndr_uint32(
4651 tvb, offset, pinfo, tree, drep, hf_enumjobs_firstjob, NULL);
4653 offset = dissect_ndr_uint32(
4654 tvb, offset, pinfo, tree, drep, hf_enumjobs_numjobs, NULL);
4656 offset = dissect_ndr_uint32(
4657 tvb, offset, pinfo, tree, drep, hf_level, &level);
4659 /* EnumJobs() stores the level in se_data */
4660 if(!pinfo->fd->flags.visited){
4661 dcv->se_data = GUINT_TO_POINTER((int)level);
4664 if (check_col(pinfo->cinfo, COL_INFO))
4665 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
4667 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL);
4669 offset = dissect_ndr_uint32(
4670 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
4675 static int SpoolssEnumJobs_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4676 proto_tree *tree, guint8 *drep _U_)
4678 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4679 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
4680 gint16 level = GPOINTER_TO_UINT(dcv->se_data);
4682 guint32 num_jobs, i;
4687 offset = dissect_spoolss_buffer(
4688 tvb, offset, pinfo, tree, drep, &buffer);
4690 offset = dissect_ndr_uint32(
4691 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
4693 offset = dissect_ndr_uint32(
4694 tvb, offset, pinfo, tree, drep, hf_enumjobs_numjobs,
4699 for (i = 0; i < num_jobs; i++) {
4702 buffer_offset = dissect_spoolss_JOB_INFO_1(
4703 buffer.tvb, buffer_offset, pinfo,
4707 buffer_offset = dissect_spoolss_JOB_INFO_2(
4708 buffer.tvb, buffer_offset, pinfo,
4712 proto_tree_add_text(
4713 buffer.tree, buffer.tvb, 0, -1,
4714 "[Unknown job info level %d]", level);
4720 offset = dissect_doserror(
4721 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4730 static const value_string setjob_commands[] = {
4731 { JOB_CONTROL_PAUSE, "Pause" },
4732 { JOB_CONTROL_RESUME, "Resume" },
4733 { JOB_CONTROL_CANCEL, "Cancel" },
4734 { JOB_CONTROL_RESTART, "Restart" },
4735 { JOB_CONTROL_DELETE, "Delete" },
4739 static int hf_setjob_cmd = -1;
4741 static int SpoolssSetJob_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
4742 proto_tree *tree, guint8 *drep)
4748 offset = dissect_nt_policy_hnd(
4749 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
4752 offset = dissect_ndr_uint32(
4753 tvb, offset, pinfo, tree, drep, hf_job_id, &jobid);
4755 offset = dissect_ndr_uint32(
4756 tvb, offset, pinfo, tree, drep, hf_level, NULL);
4758 offset = dissect_ndr_uint32(
4759 tvb, offset, pinfo, tree, drep, hf_setjob_cmd, &cmd);
4761 if (check_col(pinfo->cinfo, COL_INFO))
4763 pinfo->cinfo, COL_INFO, ", %s jobid %d",
4764 val_to_str(cmd, setjob_commands, "Unknown (%d)"),
4770 static int SpoolssSetJob_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4771 proto_tree *tree, guint8 *drep)
4775 offset = dissect_doserror(
4776 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4785 static int SpoolssGetJob_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
4786 proto_tree *tree, guint8 *drep)
4788 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4789 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
4790 guint32 level, jobid;
4794 offset = dissect_nt_policy_hnd(
4795 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
4798 offset = dissect_ndr_uint32(
4799 tvb, offset, pinfo, tree, drep, hf_job_id, &jobid);
4801 offset = dissect_ndr_uint32(
4802 tvb, offset, pinfo, tree, drep, hf_level, &level);
4804 /* GetJob() stores the level in se_data */
4805 if(!pinfo->fd->flags.visited){
4806 dcv->se_data = GUINT_TO_POINTER((int)level);
4809 if (check_col(pinfo->cinfo, COL_INFO))
4810 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d, jobid %d",
4813 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL);
4815 offset = dissect_ndr_uint32(
4816 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
4821 static int SpoolssGetJob_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
4822 proto_tree *tree, guint8 *drep)
4824 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4825 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
4826 gint32 level = GPOINTER_TO_UINT(dcv->se_data);
4831 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep,
4835 int buffer_offset = 0;
4839 buffer_offset = dissect_spoolss_JOB_INFO_1(
4840 buffer.tvb, buffer_offset, pinfo,
4845 proto_tree_add_text(
4846 buffer.tree, buffer.tvb, buffer_offset, -1,
4847 "[Unknown job info level %d]", level);
4852 offset = dissect_ndr_uint32(
4853 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
4855 offset = dissect_doserror(
4856 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4865 static int SpoolssStartPagePrinter_q(tvbuff_t *tvb, int offset,
4866 packet_info *pinfo, proto_tree *tree,
4869 e_ctx_hnd policy_hnd;
4874 offset = dissect_nt_policy_hnd(
4875 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, NULL,
4878 dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL,
4881 if (check_col(pinfo->cinfo, COL_INFO) && pol_name)
4882 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
4888 static int SpoolssStartPagePrinter_r(tvbuff_t *tvb, int offset,
4889 packet_info *pinfo, proto_tree *tree,
4894 offset = dissect_doserror(
4895 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4904 static int SpoolssEndPagePrinter_q(tvbuff_t *tvb, int offset,
4905 packet_info *pinfo, proto_tree *tree,
4908 e_ctx_hnd policy_hnd;
4913 offset = dissect_nt_policy_hnd(
4914 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, NULL,
4917 dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL,
4920 if (check_col(pinfo->cinfo, COL_INFO) && pol_name)
4921 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
4927 static int SpoolssEndPagePrinter_r(tvbuff_t *tvb, int offset,
4928 packet_info *pinfo, proto_tree *tree,
4933 offset = dissect_doserror(
4934 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
4943 static gint ett_DOC_INFO_1 = -1;
4946 dissect_spoolss_doc_info_1(tvbuff_t *tvb, int offset, packet_info *pinfo,
4947 proto_tree *tree, guint8 *drep)
4950 proto_tree *subtree;
4952 item = proto_tree_add_text(
4953 tree, tvb, offset, 0, "Document info level 1");
4955 subtree = proto_item_add_subtree(item, ett_DOC_INFO_1);
4957 offset = dissect_ndr_str_pointer_item(
4958 tvb, offset, pinfo, subtree, drep, NDR_POINTER_UNIQUE,
4959 "Document name", hf_documentname, 0);
4961 offset = dissect_ndr_str_pointer_item(
4962 tvb, offset, pinfo, subtree, drep, NDR_POINTER_UNIQUE,
4963 "Output file", hf_outputfile, 0);
4965 offset = dissect_ndr_str_pointer_item(
4966 tvb, offset, pinfo, subtree, drep, NDR_POINTER_UNIQUE,
4967 "Data type", hf_datatype, 0);
4973 dissect_spoolss_doc_info_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
4974 proto_tree *tree, guint8 *drep)
4976 dcerpc_info *di = pinfo->private_data;
4977 guint32 info_level = 1; /* XXX */
4979 if (di->conformant_run)
4982 switch(info_level) {
4984 offset = dissect_spoolss_doc_info_1(
4985 tvb, offset, pinfo, tree, drep);
4988 proto_tree_add_text(
4989 tree, tvb, offset, 0,
4990 "[Unknown documentinfo level %d]", info_level);
5001 static gint ett_DOC_INFO = -1;
5004 dissect_spoolss_doc_info(tvbuff_t *tvb, int offset, packet_info *pinfo,
5005 proto_tree *tree, guint8 *drep)
5008 proto_tree *subtree;
5011 item = proto_tree_add_text(
5012 tree, tvb, offset, 0, "Document info");
5014 subtree = proto_item_add_subtree(item, ett_DOC_INFO);
5016 offset = dissect_ndr_uint32(
5017 tvb, offset, pinfo, subtree, drep, hf_level, &level);
5019 offset = dissect_ndr_pointer(
5020 tvb, offset, pinfo, subtree, drep,
5021 dissect_spoolss_doc_info_data,
5022 NDR_POINTER_UNIQUE, "Document info", -1);
5031 static gint ett_DOC_INFO_CTR = -1;
5034 dissect_spoolss_doc_info_ctr(tvbuff_t *tvb, int offset, packet_info *pinfo,
5035 proto_tree *tree, guint8 *drep)
5038 proto_tree *subtree;
5040 item = proto_tree_add_text(
5041 tree, tvb, offset, 0, "Document info container");
5043 subtree = proto_item_add_subtree(item, ett_DOC_INFO_CTR);
5045 offset = dissect_ndr_uint32(
5046 tvb, offset, pinfo, subtree, drep, hf_level, NULL);
5048 offset = dissect_spoolss_doc_info(
5049 tvb, offset, pinfo, subtree, drep);
5058 static int SpoolssStartDocPrinter_q(tvbuff_t *tvb, int offset,
5059 packet_info *pinfo, proto_tree *tree,
5062 e_ctx_hnd policy_hnd;
5067 offset = dissect_nt_policy_hnd(
5068 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, NULL,
5071 dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL,
5074 if (check_col(pinfo->cinfo, COL_INFO) && pol_name)
5075 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
5078 offset = dissect_spoolss_doc_info_ctr(tvb, offset, pinfo, tree, drep);
5083 static int SpoolssStartDocPrinter_r(tvbuff_t *tvb, int offset,
5084 packet_info *pinfo, proto_tree *tree,
5089 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5092 offset = dissect_doserror(
5093 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
5102 static int SpoolssEndDocPrinter_q(tvbuff_t *tvb, int offset,
5103 packet_info *pinfo, proto_tree *tree,
5106 e_ctx_hnd policy_hnd;
5111 offset = dissect_nt_policy_hnd(
5112 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, NULL,
5115 dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL,
5118 if (check_col(pinfo->cinfo, COL_INFO) && pol_name)
5119 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
5126 static int SpoolssEndDocPrinter_r(tvbuff_t *tvb, int offset,
5127 packet_info *pinfo, proto_tree *tree,
5132 offset = dissect_doserror(
5133 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
5142 static gint ett_writeprinter_buffer = -1;
5144 static int hf_writeprinter_numwritten = -1;
5146 static int SpoolssWritePrinter_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
5147 proto_tree *tree, guint8 *drep)
5149 e_ctx_hnd policy_hnd;
5153 proto_tree *subtree;
5157 offset = dissect_nt_policy_hnd(
5158 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, NULL,
5161 dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL,
5164 if (check_col(pinfo->cinfo, COL_INFO) && pol_name)
5165 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
5168 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5169 hf_buffer_size, &size);
5171 if (check_col(pinfo->cinfo, COL_INFO))
5172 col_append_fstr(pinfo->cinfo, COL_INFO, ", %d bytes", size);
5174 item = proto_tree_add_text(tree, tvb, offset, 0, "Buffer");
5176 subtree = proto_item_add_subtree(item, ett_writeprinter_buffer);
5178 offset = dissect_ndr_uint8s(tvb, offset, pinfo, subtree, drep,
5179 hf_buffer_data, size, NULL);
5181 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
5182 hf_buffer_size, NULL);
5184 proto_item_set_len(item, size + 4);
5189 static int SpoolssWritePrinter_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
5190 proto_tree *tree, guint8 *drep)
5196 offset = dissect_ndr_uint32(
5197 tvb, offset, pinfo, tree, drep, hf_writeprinter_numwritten,
5200 if (check_col(pinfo->cinfo, COL_INFO))
5202 pinfo->cinfo, COL_INFO, ", %d bytes written", size);
5204 offset = dissect_doserror(
5205 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
5214 static int SpoolssDeletePrinterData_q(tvbuff_t *tvb, int offset,
5215 packet_info *pinfo, proto_tree *tree,
5219 proto_item *hidden_item;
5221 hidden_item = proto_tree_add_uint(
5222 tree, hf_printerdata, tvb, offset, 0, 1);
5223 PROTO_ITEM_SET_HIDDEN(hidden_item);
5227 offset = dissect_nt_policy_hnd(
5228 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
5231 offset = dissect_ndr_cvstring(
5232 tvb, offset, pinfo, tree, drep, sizeof(guint16),
5233 hf_printerdata_value, TRUE, &value_name);
5235 if (check_col(pinfo->cinfo, COL_INFO))
5236 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", value_name);
5243 static int SpoolssDeletePrinterData_r(tvbuff_t *tvb, int offset,
5244 packet_info *pinfo, proto_tree *tree,
5247 proto_item *hidden_item;
5249 hidden_item = proto_tree_add_uint(
5250 tree, hf_printerdata, tvb, offset, 0, 1);
5251 PROTO_ITEM_SET_HIDDEN(hidden_item);
5255 offset = dissect_doserror(
5256 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
5266 static gint ett_DRIVER_INFO_1 = -1;
5268 static int dissect_DRIVER_INFO_1(tvbuff_t *tvb, int offset,
5269 packet_info *pinfo, proto_tree *tree,
5273 proto_tree *subtree;
5274 int struct_start = offset;
5276 item = proto_tree_add_text(
5277 tree, tvb, offset, 0, "Driver info level 1");
5279 subtree = proto_item_add_subtree(item, ett_DRIVER_INFO_1);
5281 offset = dissect_spoolss_relstr(
5282 tvb, offset, pinfo, subtree, drep, hf_drivername,
5283 struct_start, NULL);
5292 static const value_string driverinfo_cversion_vals[] =
5294 { 0, "Windows 95/98/Me" },
5295 { 2, "Windows NT 4.0" },
5296 { 3, "Windows 2000/XP" },
5300 static gint ett_DRIVER_INFO_2 = -1;
5302 static int dissect_DRIVER_INFO_2(tvbuff_t *tvb, int offset,
5303 packet_info *pinfo, proto_tree *tree,
5307 proto_tree *subtree;
5308 int struct_start = offset;
5310 item = proto_tree_add_text(
5311 tree, tvb, offset, 0, "Driver info level 2");
5313 subtree = proto_item_add_subtree(item, ett_DRIVER_INFO_2);
5315 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
5316 hf_driverinfo_cversion, NULL);
5318 offset = dissect_spoolss_relstr(
5319 tvb, offset, pinfo, subtree, drep, hf_drivername,
5320 struct_start, NULL);
5322 offset = dissect_spoolss_relstr(
5323 tvb, offset, pinfo, subtree, drep, hf_architecture,
5324 struct_start, NULL);
5326 offset = dissect_spoolss_relstr(
5327 tvb, offset, pinfo, subtree, drep, hf_driverpath,
5328 struct_start, NULL);
5330 offset = dissect_spoolss_relstr(
5331 tvb, offset, pinfo, subtree, drep, hf_datafile,
5332 struct_start, NULL);
5334 offset = dissect_spoolss_relstr(
5335 tvb, offset, pinfo, subtree, drep, hf_configfile,
5336 struct_start, NULL);
5345 static gint ett_DRIVER_INFO_3 = -1;
5347 static int dissect_DRIVER_INFO_3(tvbuff_t *tvb, int offset,
5348 packet_info *pinfo, proto_tree *tree,
5352 proto_tree *subtree;
5353 int struct_start = offset;
5355 item = proto_tree_add_text(
5356 tree, tvb, offset, 0, "Driver info level 3");
5358 subtree = proto_item_add_subtree(item, ett_DRIVER_INFO_3);
5360 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
5361 hf_driverinfo_cversion, NULL);
5363 offset = dissect_spoolss_relstr(
5364 tvb, offset, pinfo, subtree, drep, hf_drivername,
5365 struct_start, NULL);
5367 offset = dissect_spoolss_relstr(
5368 tvb, offset, pinfo, subtree, drep, hf_architecture,
5369 struct_start, NULL);
5371 offset = dissect_spoolss_relstr(
5372 tvb, offset, pinfo, subtree, drep, hf_driverpath,
5373 struct_start, NULL);
5375 offset = dissect_spoolss_relstr(
5376 tvb, offset, pinfo, subtree, drep, hf_datafile,
5377 struct_start, NULL);
5379 offset = dissect_spoolss_relstr(
5380 tvb, offset, pinfo, subtree, drep, hf_configfile,
5381 struct_start, NULL);
5383 offset = dissect_spoolss_relstr(
5384 tvb, offset, pinfo, subtree, drep, hf_helpfile,
5385 struct_start, NULL);
5387 offset = dissect_spoolss_relstrarray(
5388 tvb, offset, pinfo, subtree, drep, hf_dependentfiles,
5389 struct_start, NULL);
5391 offset = dissect_spoolss_relstr(
5392 tvb, offset, pinfo, subtree, drep, hf_monitorname,
5393 struct_start, NULL);
5395 offset = dissect_spoolss_relstr(
5396 tvb, offset, pinfo, subtree, drep, hf_defaultdatatype,
5397 struct_start, NULL);
5407 static gint ett_DRIVER_INFO_6 = -1;
5409 static int dissect_DRIVER_INFO_6(tvbuff_t *tvb, int offset,
5410 packet_info *pinfo, proto_tree *tree,
5414 proto_tree *subtree;
5415 int struct_start = offset;
5417 item = proto_tree_add_text(
5418 tree, tvb, offset, 0, "Driver info level 6");
5420 subtree = proto_item_add_subtree(item, ett_DRIVER_INFO_6);
5422 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
5423 hf_driverinfo_cversion, NULL);
5425 offset = dissect_spoolss_relstr(
5426 tvb, offset, pinfo, subtree, drep, hf_drivername,
5427 struct_start, NULL);
5429 offset = dissect_spoolss_relstr(
5430 tvb, offset, pinfo, subtree, drep, hf_architecture,
5431 struct_start, NULL);
5433 offset = dissect_spoolss_relstr(
5434 tvb, offset, pinfo, subtree, drep, hf_driverpath,
5435 struct_start, NULL);
5437 offset = dissect_spoolss_relstr(
5438 tvb, offset, pinfo, subtree, drep, hf_datafile,
5439 struct_start, NULL);
5441 offset = dissect_spoolss_relstr(
5442 tvb, offset, pinfo, subtree, drep, hf_configfile,
5443 struct_start, NULL);
5445 offset = dissect_spoolss_relstr(
5446 tvb, offset, pinfo, subtree, drep, hf_helpfile,
5447 struct_start, NULL);
5449 offset = dissect_spoolss_relstrarray(
5450 tvb, offset, pinfo, subtree, drep, hf_dependentfiles,
5451 struct_start, NULL);
5453 offset = dissect_spoolss_relstr(
5454 tvb, offset, pinfo, subtree, drep, hf_monitorname,
5455 struct_start, NULL);
5457 offset = dissect_spoolss_relstr(
5458 tvb, offset, pinfo, subtree, drep, hf_defaultdatatype,
5459 struct_start, NULL);
5461 offset = dissect_spoolss_relstrarray(
5462 tvb, offset, pinfo, subtree, drep, hf_previousdrivernames,
5463 struct_start, NULL);
5465 offset = dissect_ndr_nt_NTTIME (
5466 tvb, offset, pinfo, subtree, drep,hf_driverdate);
5468 offset = dissect_ndr_uint32(
5469 tvb, offset, pinfo, subtree, drep, hf_padding,
5472 offset = dissect_ndr_uint32(
5473 tvb, offset, pinfo, subtree, drep, hf_driver_version_low,
5476 offset = dissect_ndr_uint32(
5477 tvb, offset, pinfo, subtree, drep, hf_driver_version_high,
5481 offset = dissect_spoolss_relstr(
5482 tvb, offset, pinfo, subtree, drep, hf_mfgname,
5483 struct_start, NULL);
5485 offset = dissect_spoolss_relstr(
5486 tvb, offset, pinfo, subtree, drep, hf_oemurl,
5487 struct_start, NULL);
5489 offset = dissect_spoolss_relstr(
5490 tvb, offset, pinfo, subtree, drep, hf_hardwareid,
5491 struct_start, NULL);
5493 offset = dissect_spoolss_relstr(
5494 tvb, offset, pinfo, subtree, drep, hf_provider,
5495 struct_start, NULL);
5501 static gint ett_DRIVER_INFO_101 = -1;
5503 static int dissect_DRIVER_INFO_101(tvbuff_t *tvb, int offset,
5504 packet_info *pinfo, proto_tree *tree,
5508 proto_tree *subtree;
5509 int struct_start = offset;
5511 item = proto_tree_add_text(
5512 tree, tvb, offset, 0, "Driver info level 101");
5514 subtree = proto_item_add_subtree(item, ett_DRIVER_INFO_101);
5516 offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep,
5517 hf_driverinfo_cversion, NULL);
5519 offset = dissect_spoolss_relstr(
5520 tvb, offset, pinfo, subtree, drep, hf_drivername,
5521 struct_start, NULL);
5523 offset = dissect_spoolss_relstr(
5524 tvb, offset, pinfo, subtree, drep, hf_architecture,
5525 struct_start, NULL);
5527 proto_tree_add_text(subtree,tvb,offset,0,"Unknown Data Follows");
5532 * EnumPrinterDrivers
5535 static int SpoolssEnumPrinterDrivers_q(tvbuff_t *tvb, int offset,
5536 packet_info *pinfo, proto_tree *tree,
5539 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5540 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
5545 offset = dissect_ndr_str_pointer_item(
5546 tvb, offset, pinfo, tree, drep, NDR_POINTER_UNIQUE,
5547 "Name", hf_servername, 0);
5549 offset = dissect_ndr_str_pointer_item(
5550 tvb, offset, pinfo, tree, drep, NDR_POINTER_UNIQUE,
5551 "Environment", hf_servername, 0);
5553 offset = dissect_ndr_uint32(
5554 tvb, offset, pinfo, tree, drep, hf_level, &level);
5556 /* EnumPrinterDrivers() stores the level in se_data */
5557 if(!pinfo->fd->flags.visited){
5558 dcv->se_data = GUINT_TO_POINTER((int)level);
5561 if (check_col(pinfo->cinfo, COL_INFO))
5562 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
5564 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL);
5566 offset = dissect_ndr_uint32(
5567 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
5572 static int SpoolssEnumPrinterDrivers_r(tvbuff_t *tvb, int offset,
5573 packet_info *pinfo, proto_tree *tree,
5576 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5577 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
5578 guint32 level = GPOINTER_TO_UINT(dcv->se_data), num_drivers, i;
5584 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep,
5587 offset = dissect_ndr_uint32(
5588 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
5590 offset = dissect_ndr_uint32(
5591 tvb, offset, pinfo, tree, drep, hf_returned,
5596 for (i = 0; i < num_drivers; i++) {
5599 buffer_offset = dissect_DRIVER_INFO_1(
5600 buffer.tvb, buffer_offset, pinfo,
5604 buffer_offset = dissect_DRIVER_INFO_2(
5605 buffer.tvb, buffer_offset, pinfo,
5609 buffer_offset = dissect_DRIVER_INFO_3(
5610 buffer.tvb, buffer_offset, pinfo,
5614 buffer_offset = dissect_DRIVER_INFO_6(
5615 buffer.tvb, buffer_offset, pinfo,
5619 buffer_offset = dissect_DRIVER_INFO_101(
5620 buffer.tvb, buffer_offset, pinfo,
5623 goto done; /*Not entirely imeplemented*/
5625 proto_tree_add_text(
5626 buffer.tree, buffer.tvb, buffer_offset, -1,
5627 "[Unknown driver info level %d]", level);
5633 offset = dissect_doserror(
5634 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
5643 static int SpoolssGetPrinterDriver2_q(tvbuff_t *tvb, int offset,
5644 packet_info *pinfo, proto_tree *tree,
5647 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5648 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
5649 e_ctx_hnd policy_hnd;
5655 offset = dissect_nt_policy_hnd(
5656 tvb, offset, pinfo, tree, drep, hf_hnd, &policy_hnd, NULL,
5659 dcerpc_fetch_polhnd_data(&policy_hnd, &pol_name, NULL, NULL, NULL,
5662 if (check_col(pinfo->cinfo, COL_INFO) && pol_name)
5663 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
5666 offset = dissect_ndr_str_pointer_item(
5667 tvb, offset, pinfo, tree, drep, NDR_POINTER_UNIQUE,
5668 "Architecture", hf_architecture, 0);
5670 offset = dissect_ndr_uint32(
5671 tvb, offset, pinfo, tree, drep, hf_level, &level);
5673 /* GetPrinterDriver2() stores the level in se_data */
5674 if(!pinfo->fd->flags.visited){
5675 dcv->se_data = GUINT_TO_POINTER((int)level);
5678 if (check_col(pinfo->cinfo, COL_INFO))
5679 col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level);
5681 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep, NULL);
5683 offset = dissect_ndr_uint32(
5684 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
5686 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5687 hf_clientmajorversion, NULL);
5689 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5690 hf_clientminorversion, NULL);
5695 static int SpoolssGetPrinterDriver2_r(tvbuff_t *tvb, int offset,
5696 packet_info *pinfo, proto_tree *tree,
5699 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5700 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
5701 guint32 level = GPOINTER_TO_UINT(dcv->se_data);
5706 offset = dissect_spoolss_buffer(tvb, offset, pinfo, tree, drep,
5712 dissect_DRIVER_INFO_1(
5713 buffer.tvb, 0, pinfo, buffer.tree, drep);
5716 dissect_DRIVER_INFO_2(
5717 buffer.tvb, 0, pinfo, buffer.tree, drep);
5720 dissect_DRIVER_INFO_3(
5721 buffer.tvb, 0, pinfo, buffer.tree, drep);
5724 dissect_DRIVER_INFO_6(
5725 buffer.tvb, 0, pinfo, buffer.tree, drep);
5728 dissect_DRIVER_INFO_101(
5729 buffer.tvb, 0, pinfo, buffer.tree, drep);
5732 proto_tree_add_text(
5733 buffer.tree, buffer.tvb, 0, -1,
5734 "[Unknown driver info level %d]", level);
5739 offset = dissect_ndr_uint32(
5740 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
5742 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5743 hf_servermajorversion, NULL);
5745 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5746 hf_serverminorversion, NULL);
5748 offset = dissect_doserror(
5749 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
5755 dissect_notify_info_data_buffer(tvbuff_t *tvb, int offset, packet_info *pinfo,
5756 proto_tree *tree, guint8 *drep)
5760 offset = dissect_ndr_uint32(
5761 tvb, offset, pinfo, tree, drep,
5762 hf_notify_info_data_buffer_len, &len);
5764 offset = dissect_ndr_uint16s(
5765 tvb, offset, pinfo, tree, drep,
5766 hf_notify_info_data_buffer_data, len);
5771 static void cb_notify_str_postprocess(packet_info *pinfo _U_,
5772 proto_tree *tree _U_,
5773 proto_item *item, tvbuff_t *tvb,
5774 int start_offset, int end_offset,
5775 void *callback_args)
5777 gint levels, hf_index = GPOINTER_TO_INT(callback_args);
5780 proto_item *hidden_item;
5782 /* Align start_offset on 4-byte boundary. */
5784 if (start_offset % 4)
5785 start_offset += 4 - (start_offset % 4);
5787 /* Get string length */
5789 len = tvb_get_letohl(tvb, start_offset);
5791 s = tvb_fake_unicode(
5792 tvb, start_offset + 4, (end_offset - start_offset - 4) / 2, TRUE);
5794 /* Append string to upper-level proto_items */
5798 if (levels > 0 && item && s && s[0]) {
5799 proto_item_append_text(item, ": %s", s);
5800 item = item->parent;
5803 proto_item_append_text(item, ": %s", s);
5804 item = item->parent;
5806 while (levels > 0) {
5807 proto_item_append_text(item, " %s", s);
5808 item = item->parent;
5814 /* Add hidden field so filter brings up any notify data */
5816 if (hf_index != -1) {
5817 hidden_item = proto_tree_add_string(
5818 tree, hf_index, tvb, start_offset, len, s);
5819 PROTO_ITEM_SET_HIDDEN(hidden_item);
5825 /* Return the hf_index for a printer notify field. This is used to
5826 add a hidden string to the display so that filtering will bring
5827 up relevant notify data. */
5830 printer_notify_hf_index(int field)
5835 case PRINTER_NOTIFY_SERVER_NAME:
5836 result = hf_servername;
5838 case PRINTER_NOTIFY_PRINTER_NAME:
5839 result = hf_printername;
5841 case PRINTER_NOTIFY_SHARE_NAME:
5842 result = hf_sharename;
5844 case PRINTER_NOTIFY_PORT_NAME:
5845 result = hf_portname;
5847 case PRINTER_NOTIFY_DRIVER_NAME:
5848 result = hf_drivername;
5850 case PRINTER_NOTIFY_COMMENT:
5851 result = hf_printercomment;
5853 case PRINTER_NOTIFY_LOCATION:
5854 result = hf_printerlocation;
5856 case PRINTER_NOTIFY_SEPFILE:
5857 result = hf_sepfile;
5859 case PRINTER_NOTIFY_PRINT_PROCESSOR:
5860 result = hf_printprocessor;
5862 case PRINTER_NOTIFY_PARAMETERS:
5863 result = hf_parameters;
5865 case PRINTER_NOTIFY_DATATYPE:
5866 result = hf_parameters;
5874 job_notify_hf_index(int field)
5879 case JOB_NOTIFY_PRINTER_NAME:
5880 result = hf_printername;
5882 case JOB_NOTIFY_MACHINE_NAME:
5883 result = hf_machinename;
5885 case JOB_NOTIFY_PORT_NAME:
5886 result = hf_portname;
5888 case JOB_NOTIFY_USER_NAME:
5889 result = hf_username;
5891 case JOB_NOTIFY_NOTIFY_NAME:
5892 result = hf_notifyname;
5894 case JOB_NOTIFY_DATATYPE:
5895 result = hf_datatype;
5897 case JOB_NOTIFY_PRINT_PROCESSOR:
5898 result = hf_printprocessor;
5900 case JOB_NOTIFY_DRIVER_NAME:
5901 result = hf_drivername;
5903 case JOB_NOTIFY_DOCUMENT:
5904 result = hf_documentname;
5906 case JOB_NOTIFY_PRIORITY:
5907 result = hf_job_priority;
5909 case JOB_NOTIFY_POSITION:
5910 result = hf_job_position;
5912 case JOB_NOTIFY_TOTAL_PAGES:
5913 result = hf_job_totalpages;
5915 case JOB_NOTIFY_PAGES_PRINTED:
5916 result = hf_job_pagesprinted;
5918 case JOB_NOTIFY_TOTAL_BYTES:
5919 result = hf_job_totalbytes;
5921 case JOB_NOTIFY_BYTES_PRINTED:
5922 result = hf_job_bytesprinted;
5930 dissect_NOTIFY_INFO_DATA_printer(tvbuff_t *tvb, int offset, packet_info *pinfo,
5931 proto_tree *tree, proto_item *item,
5932 guint8 *drep, guint16 field)
5938 /* String notify data */
5940 case PRINTER_NOTIFY_SERVER_NAME:
5941 case PRINTER_NOTIFY_PRINTER_NAME:
5942 case PRINTER_NOTIFY_SHARE_NAME:
5943 case PRINTER_NOTIFY_DRIVER_NAME:
5944 case PRINTER_NOTIFY_COMMENT:
5945 case PRINTER_NOTIFY_LOCATION:
5946 case PRINTER_NOTIFY_SEPFILE:
5947 case PRINTER_NOTIFY_PRINT_PROCESSOR:
5948 case PRINTER_NOTIFY_PARAMETERS:
5949 case PRINTER_NOTIFY_DATATYPE:
5950 case PRINTER_NOTIFY_PORT_NAME:
5952 offset = dissect_ndr_uint32(
5953 tvb, offset, pinfo, tree, drep,
5954 hf_notify_info_data_bufsize, &value1);
5956 offset = dissect_ndr_pointer_cb(
5957 tvb, offset, pinfo, tree, drep,
5958 dissect_notify_info_data_buffer,
5959 NDR_POINTER_UNIQUE, "String",
5960 hf_notify_info_data_buffer,
5961 cb_notify_str_postprocess,
5962 GINT_TO_POINTER(printer_notify_hf_index(field)));
5966 case PRINTER_NOTIFY_ATTRIBUTES:
5968 /* Value 1 is the printer attributes */
5970 offset = dissect_printer_attributes(
5971 tvb, offset, pinfo, tree, drep);
5973 offset = dissect_ndr_uint32(
5974 tvb, offset, pinfo, NULL, drep,
5975 hf_notify_info_data_value2, NULL);
5979 case PRINTER_NOTIFY_STATUS: {
5982 /* Value 1 is the printer status */
5984 offset = dissect_ndr_uint32(
5985 tvb, offset, pinfo, tree, drep,
5986 hf_printer_status, &status);
5988 offset = dissect_ndr_uint32(
5989 tvb, offset, pinfo, NULL, drep,
5990 hf_notify_info_data_value2, NULL);
5992 proto_item_append_text(
5994 val_to_str(status, printer_status_vals, "Unknown"));
5999 /* Unknown notify data */
6001 case PRINTER_NOTIFY_SECURITY_DESCRIPTOR: /* Secdesc */
6002 case PRINTER_NOTIFY_DEVMODE: /* Devicemode */
6004 offset = dissect_ndr_uint32(
6005 tvb, offset, pinfo, tree, drep,
6006 hf_notify_info_data_bufsize, &value1);
6008 offset = dissect_ndr_pointer(
6009 tvb, offset, pinfo, tree, drep,
6010 dissect_notify_info_data_buffer,
6011 NDR_POINTER_UNIQUE, "Buffer",
6012 hf_notify_info_data_buffer);
6017 offset = dissect_ndr_uint32(
6018 tvb, offset, pinfo, tree, drep,
6019 hf_notify_info_data_value1, NULL);
6021 offset = dissect_ndr_uint32(
6022 tvb, offset, pinfo, tree, drep,
6023 hf_notify_info_data_value2, NULL);
6030 static void notify_job_time_cb(packet_info *pinfo, proto_tree *tree _U_,
6031 proto_item *item, tvbuff_t *tvb _U_,
6032 int start_offset _U_, int end_offset _U_,
6033 void *callback_args _U_)
6035 dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
6036 dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
6037 char *str = (char *)dcv->private_data;
6039 /* Append job string stored in dcv->private_data by
6040 dissect_SYSTEM_TIME_ptr() in the current item as well
6043 proto_item_append_text(item, ": %s", str);
6046 proto_item_append_text(item->parent, ": %s", str);
6050 dissect_NOTIFY_INFO_DATA_job(tvbuff_t *tvb, int offset, packet_info *pinfo,
6051 proto_tree *tree, proto_item *item, guint8 *drep,
6055 proto_item *hidden_item;
6059 /* String notify data */
6061 case JOB_NOTIFY_PRINTER_NAME:
6062 case JOB_NOTIFY_MACHINE_NAME:
6063 case JOB_NOTIFY_PORT_NAME:
6064 case JOB_NOTIFY_USER_NAME:
6065 case JOB_NOTIFY_NOTIFY_NAME:
6066 case JOB_NOTIFY_DATATYPE:
6067 case JOB_NOTIFY_PRINT_PROCESSOR:
6068 case JOB_NOTIFY_PARAMETERS:
6069 case JOB_NOTIFY_DRIVER_NAME:
6070 case JOB_NOTIFY_STATUS_STRING:
6071 case JOB_NOTIFY_DOCUMENT:
6073 offset = dissect_ndr_uint32(
6074 tvb, offset, pinfo, tree, drep,
6075 hf_notify_info_data_bufsize, &value1);
6077 offset = dissect_ndr_pointer_cb(
6078 tvb, offset, pinfo, tree, drep,
6079 dissect_notify_info_data_buffer,
6080 NDR_POINTER_UNIQUE, "String",
6081 hf_notify_info_data_buffer,
6082 cb_notify_str_postprocess,
6083 GINT_TO_POINTER(job_notify_hf_index(field)));
6087 case JOB_NOTIFY_STATUS:
6088 offset = dissect_job_status(
6089 tvb, offset, pinfo, tree, drep);
6091 offset = dissect_ndr_uint32(
6092 tvb, offset, pinfo, NULL, drep,
6093 hf_notify_info_data_value2, NULL);
6097 case JOB_NOTIFY_SUBMITTED:
6101 offset = dissect_ndr_uint32(
6102 tvb, offset, pinfo, tree, drep,
6103 hf_notify_info_data_buffer_len, NULL);
6105 offset = dissect_ndr_pointer_cb(
6106 tvb, offset, pinfo, tree, drep,
6107 dissect_SYSTEM_TIME_ptr, NDR_POINTER_UNIQUE,
6108 "Time submitted", -1, notify_job_time_cb, NULL);
6112 case JOB_NOTIFY_PRIORITY:
6113 case JOB_NOTIFY_POSITION:
6114 case JOB_NOTIFY_TOTAL_PAGES:
6115 case JOB_NOTIFY_PAGES_PRINTED:
6116 case JOB_NOTIFY_TOTAL_BYTES:
6117 case JOB_NOTIFY_BYTES_PRINTED: {
6120 offset = dissect_ndr_uint32(
6121 tvb, offset, pinfo, tree, drep,
6122 hf_notify_info_data_value1, &value);
6124 offset = dissect_ndr_uint32(
6125 tvb, offset, pinfo, tree, drep,
6126 hf_notify_info_data_value2, NULL);
6128 proto_item_append_text(item, ": %d", value);
6130 hidden_item = proto_tree_add_uint(
6131 tree, job_notify_hf_index(field), tvb,
6133 PROTO_ITEM_SET_HIDDEN(hidden_item);
6138 /* Unknown notify data */
6140 case JOB_NOTIFY_DEVMODE:
6142 offset = dissect_ndr_uint32(
6143 tvb, offset, pinfo, tree, drep,
6144 hf_notify_info_data_bufsize, &value1);
6146 offset = dissect_ndr_pointer(
6147 tvb, offset, pinfo, tree, drep,
6148 dissect_notify_info_data_buffer,
6149 NDR_POINTER_UNIQUE, "Buffer",
6150 hf_notify_info_data_buffer);
6155 offset = dissect_ndr_uint32(
6156 tvb, offset, pinfo, tree, drep,
6157 hf_notify_info_data_value1, NULL);
6159 offset = dissect_ndr_uint32(
6160 tvb, offset, pinfo, tree, drep,
6161 hf_notify_info_data_value2, NULL);
6166 static gint ett_NOTIFY_INFO_DATA = -1;
6169 dissect_NOTIFY_INFO_DATA(tvbuff_t *tvb, int offset, packet_info *pinfo,
6170 proto_tree *tree, guint8 *drep)
6173 proto_tree *subtree;
6175 guint16 type, field;
6176 const char *field_string;
6178 item = proto_tree_add_text(tree, tvb, offset, 0, "%s", "");
6180 subtree = proto_item_add_subtree(item, ett_NOTIFY_INFO_DATA);
6182 offset = dissect_ndr_uint16(
6183 tvb, offset, pinfo, subtree, drep,
6184 hf_notify_info_data_type, &type);
6186 offset = dissect_notify_field(
6187 tvb, offset, pinfo, subtree, drep, type, &field);
6190 case PRINTER_NOTIFY_TYPE:
6191 field_string = val_to_str(
6192 field, printer_notify_option_data_vals,
6195 case JOB_NOTIFY_TYPE:
6196 field_string = val_to_str(
6197 field, job_notify_option_data_vals,
6201 field_string = "Unknown field";
6205 proto_item_append_text(
6207 val_to_str(type, printer_notify_types, "Unknown (%d)"),
6210 offset = dissect_ndr_uint32(
6211 tvb, offset, pinfo, subtree, drep,
6212 hf_notify_info_data_count, &count);
6214 offset = dissect_ndr_uint32(
6215 tvb, offset, pinfo, subtree, drep,
6216 hf_notify_info_data_id, NULL);
6218 offset = dissect_ndr_uint32(
6219 tvb, offset, pinfo, subtree, drep,
6220 hf_notify_info_data_count, NULL);
6222 /* The value here depends on (type, field) */
6225 case PRINTER_NOTIFY_TYPE:
6226 offset = dissect_NOTIFY_INFO_DATA_printer(
6227 tvb, offset, pinfo, subtree, item, drep, field);
6229 case JOB_NOTIFY_TYPE:
6230 offset = dissect_NOTIFY_INFO_DATA_job(
6231 tvb, offset, pinfo, subtree, item, drep, field);
6234 proto_tree_add_text(
6235 tree, tvb, offset, 0,
6236 "[Unknown notify type %d]", type);
6244 dissect_NOTIFY_INFO(tvbuff_t *tvb, int offset, packet_info *pinfo,
6245 proto_tree *tree, guint8 *drep)
6247 dcerpc_info *di = pinfo->private_data;
6250 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6251 hf_notify_info_version, NULL);
6253 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6254 hf_notify_info_flags, NULL);
6256 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6257 hf_notify_info_count, &count);
6259 if (!di->conformant_run && check_col(pinfo->cinfo, COL_INFO))
6261 pinfo->cinfo, COL_INFO, ", %d %s", count,
6262 notify_plural(count));
6264 offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
6265 dissect_NOTIFY_INFO_DATA);
6274 static int SpoolssRFNPCNEX_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
6275 proto_tree *tree, guint8 *drep)
6281 offset = dissect_nt_policy_hnd(
6282 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6285 offset = dissect_ndr_uint32(
6286 tvb, offset, pinfo, tree, drep, hf_rrpcn_changelow, &changeid);
6288 if (check_col(pinfo->cinfo, COL_INFO))
6290 pinfo->cinfo, COL_INFO, ", changeid %d", changeid);
6292 offset = dissect_ndr_pointer(
6293 tvb, offset, pinfo, tree, drep,
6294 dissect_NOTIFY_OPTIONS_ARRAY_CTR, NDR_POINTER_UNIQUE,
6295 "Notify Options Array Container", -1);
6300 static int SpoolssRFNPCNEX_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
6301 proto_tree *tree, guint8 *drep)
6305 offset = dissect_ndr_pointer(
6306 tvb, offset, pinfo, tree, drep,
6307 dissect_NOTIFY_INFO, NDR_POINTER_UNIQUE,
6310 offset = dissect_doserror(
6311 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6320 static int SpoolssRRPCN_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
6321 proto_tree *tree, guint8 *drep)
6327 offset = dissect_nt_policy_hnd(
6328 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6331 offset = dissect_ndr_uint32(
6332 tvb, offset, pinfo, tree, drep, hf_rrpcn_changelow, &changeid);
6334 if (check_col(pinfo->cinfo, COL_INFO))
6336 pinfo->cinfo, COL_INFO, ", changeid %d", changeid);
6338 offset = dissect_ndr_uint32(
6339 tvb, offset, pinfo, tree, drep, hf_rrpcn_changehigh, NULL);
6341 offset = dissect_ndr_uint32(
6342 tvb, offset, pinfo, tree, drep, hf_rrpcn_unk0, NULL);
6344 offset = dissect_ndr_uint32(
6345 tvb, offset, pinfo, tree, drep, hf_rrpcn_unk1, NULL);
6347 offset = dissect_ndr_pointer(
6348 tvb, offset, pinfo, tree, drep,
6349 dissect_NOTIFY_INFO, NDR_POINTER_UNIQUE,
6357 static int SpoolssRRPCN_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
6358 proto_tree *tree, guint8 *drep)
6362 offset = dissect_ndr_uint32(
6363 tvb, offset, pinfo, tree, drep, hf_rrpcn_unk0, NULL);
6365 offset = dissect_doserror(
6366 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6375 static int SpoolssReplyClosePrinter_q(tvbuff_t *tvb, int offset,
6376 packet_info *pinfo, proto_tree *tree,
6381 offset = dissect_nt_policy_hnd(
6382 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6388 static int SpoolssReplyClosePrinter_r(tvbuff_t *tvb, int offset,
6389 packet_info *pinfo, proto_tree *tree,
6394 offset = dissect_nt_policy_hnd(
6395 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6398 offset = dissect_doserror(
6399 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6408 static int SpoolssFCPN_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
6409 proto_tree *tree, guint8 *drep)
6413 offset = dissect_nt_policy_hnd(
6414 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6420 static int SpoolssFCPN_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
6421 proto_tree *tree, guint8 *drep)
6425 offset = dissect_doserror(
6426 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6432 * RouterReplyPrinter
6435 static int hf_routerreplyprinter_condition = -1;
6436 static int hf_routerreplyprinter_unknown1 = -1;
6437 static int hf_routerreplyprinter_changeid = -1;
6439 static int SpoolssRouterReplyPrinter_q(tvbuff_t *tvb, int offset, packet_info *pinfo,
6440 proto_tree *tree, guint8 *drep)
6444 offset = dissect_nt_policy_hnd(
6445 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6448 offset = dissect_ndr_uint32(
6449 tvb, offset, pinfo, tree, drep,
6450 hf_routerreplyprinter_condition, NULL);
6452 offset = dissect_ndr_uint32(
6453 tvb, offset, pinfo, tree, drep,
6454 hf_routerreplyprinter_unknown1, NULL);
6456 offset = dissect_ndr_uint32(
6457 tvb, offset, pinfo, tree, drep,
6458 hf_routerreplyprinter_changeid, NULL);
6463 static int SpoolssRouterReplyPrinter_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
6464 proto_tree *tree, guint8 *drep)
6468 offset = dissect_doserror(
6469 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6474 static int hf_keybuffer_size = -1;
6475 static int hf_keybuffer_data = -1;
6478 dissect_spoolss_keybuffer(tvbuff_t *tvb, int offset, packet_info *pinfo,
6479 proto_tree *tree, guint8 *drep)
6481 dcerpc_info *di = pinfo->private_data;
6485 if (di->conformant_run)
6488 /* Dissect size and data */
6490 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6491 hf_keybuffer_size, &size);
6493 end_offset = offset + (size*2);
6494 if (end_offset < offset) {
6496 * Overflow - make the end offset one past the end of
6497 * the packet data, so we throw an exception (as the
6498 * size is almost certainly too big).
6500 end_offset = tvb_reported_length_remaining(tvb, offset) + 1;
6503 while (offset < end_offset)
6504 offset = dissect_spoolss_uint16uni(
6505 tvb, offset, pinfo, tree, drep, NULL, "Key");
6511 static int SpoolssEnumPrinterKey_q(tvbuff_t *tvb, int offset,
6512 packet_info *pinfo, proto_tree *tree,
6519 offset = dissect_nt_policy_hnd(
6520 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6523 offset = dissect_ndr_cvstring(
6524 tvb, offset, pinfo, tree, drep, sizeof(guint16),
6525 hf_printerdata_key, TRUE, &key_name);
6527 if (check_col(pinfo->cinfo, COL_INFO)) {
6528 const char *kn = key_name;
6533 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", kn);
6538 offset = dissect_ndr_uint32(
6539 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
6544 static int SpoolssEnumPrinterKey_r(tvbuff_t *tvb, int offset,
6545 packet_info *pinfo, proto_tree *tree,
6550 offset = dissect_spoolss_keybuffer(tvb, offset, pinfo, tree, drep);
6552 offset = dissect_ndr_uint32(
6553 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
6555 offset = dissect_doserror(
6556 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6561 static int hf_enumprinterdataex_num_values = -1;
6562 static int hf_enumprinterdataex_name_offset = -1;
6563 static int hf_enumprinterdataex_name_len = -1;
6564 static int hf_enumprinterdataex_name = -1;
6565 static int hf_enumprinterdataex_val_type = -1;
6566 static int hf_enumprinterdataex_val_offset = -1;
6567 static int hf_enumprinterdataex_val_len = -1;
6568 static int hf_enumprinterdataex_val_dword_low = -1;
6569 static int hf_enumprinterdataex_val_dword_high = -1;
6570 static int hf_enumprinterdataex_val_sz = -1;
6572 static int SpoolssEnumPrinterDataEx_q(tvbuff_t *tvb, int offset,
6573 packet_info *pinfo, proto_tree *tree,
6577 proto_item *hidden_item;
6579 hidden_item = proto_tree_add_uint(
6580 tree, hf_printerdata, tvb, offset, 0, 1);
6581 PROTO_ITEM_SET_HIDDEN(hidden_item);
6585 offset = dissect_nt_policy_hnd(
6586 tvb, offset, pinfo, tree, drep, hf_hnd, NULL, NULL,
6589 offset = dissect_ndr_cvstring(
6590 tvb, offset, pinfo, tree, drep, sizeof(guint16),
6591 hf_printerdata_key, TRUE, &key_name);
6593 if (check_col(pinfo->cinfo, COL_INFO))
6594 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", key_name);
6598 offset = dissect_ndr_uint32(
6599 tvb, offset, pinfo, tree, drep, hf_offered, NULL);
6604 static gint ett_printer_enumdataex_value = -1;
6607 dissect_spoolss_printer_enum_values(tvbuff_t *tvb, int offset,
6608 packet_info *pinfo, proto_tree *tree,
6611 guint32 start_offset = offset;
6612 guint32 name_offset, name_len, val_offset, val_len, val_type;
6615 proto_tree *subtree;
6617 /* Get offset of value name */
6619 offset = dissect_ndr_uint32(
6620 tvb, offset, pinfo, NULL, drep,
6621 hf_enumprinterdataex_name_offset, &name_offset);
6623 offset = dissect_ndr_uint32(
6624 tvb, offset, pinfo, NULL, drep,
6625 hf_enumprinterdataex_name_len, &name_len);
6627 dissect_spoolss_uint16uni(
6628 tvb, start_offset + name_offset, pinfo, NULL, drep,
6631 item = proto_tree_add_text(tree, tvb, offset, 0, "Name: ");
6633 subtree = proto_item_add_subtree(item, ett_printer_enumdataex_value);
6635 proto_item_append_text(item, "%s", name);
6637 proto_tree_add_text(
6638 subtree, tvb, offset - 8, 4, "Name offset: %d", name_offset);
6640 proto_tree_add_text(
6641 subtree, tvb, offset - 4, 4, "Name len: %d", name_len);
6643 proto_tree_add_text(
6644 subtree, tvb, start_offset + name_offset, ((int)strlen(name) + 1) * 2,
6647 offset = dissect_ndr_uint32(
6648 tvb, offset, pinfo, subtree, drep, hf_printerdata_type,
6651 offset = dissect_ndr_uint32(
6652 tvb, offset, pinfo, subtree, drep,
6653 hf_enumprinterdataex_val_offset, &val_offset);
6655 offset = dissect_ndr_uint32(
6656 tvb, offset, pinfo, subtree, drep,
6657 hf_enumprinterdataex_val_len, &val_len);
6660 proto_tree_add_text(subtree, tvb, start_offset + val_offset, 4,
6666 case DCERPC_REG_DWORD: {
6669 int offset2 = start_offset + val_offset;
6671 /* Needs to be broken into two 16-byte ints because it may
6674 offset2 = dissect_ndr_uint16(
6675 tvb, offset2, pinfo, subtree, drep,
6676 hf_enumprinterdataex_val_dword_low, &low);
6678 offset2 = dissect_ndr_uint16(
6679 tvb, offset2, pinfo, subtree, drep,
6680 hf_enumprinterdataex_val_dword_high, &high);
6682 value = (high << 16) | low;
6684 proto_tree_add_text(subtree, tvb, start_offset + val_offset, 4,
6685 "Value: %d", value);
6687 proto_item_append_text(item, ", Value: %d", value);
6691 case DCERPC_REG_SZ: {
6694 dissect_spoolss_uint16uni(
6695 tvb, start_offset + val_offset, pinfo, subtree, drep,
6698 proto_item_append_text(item, ", Value: %s", value);
6704 case DCERPC_REG_BINARY:
6706 /* FIXME: nicer way to display this */
6708 proto_tree_add_text(
6709 subtree, tvb, start_offset + val_offset, val_len,
6710 "Value: <binary data>");
6713 case DCERPC_REG_MULTI_SZ:
6715 /* FIXME: implement REG_MULTI_SZ support */
6717 proto_tree_add_text(
6718 subtree, tvb, start_offset + val_offset, val_len,
6719 "Value: <REG_MULTI_SZ not implemented>");
6723 proto_tree_add_text(
6724 subtree, tvb, start_offset + val_offset, val_len,
6725 "%s: unknown type %d", name, val_type);
6734 static gint ett_PRINTER_DATA_CTR = -1;
6736 static int SpoolssEnumPrinterDataEx_r(tvbuff_t *tvb, int offset,
6737 packet_info *pinfo, proto_tree *tree,
6740 guint32 size, num_values;
6741 proto_item *hidden_item;
6743 hidden_item = proto_tree_add_uint(
6744 tree, hf_printerdata, tvb, offset, 0, 1);
6745 PROTO_ITEM_SET_HIDDEN(hidden_item);
6749 offset = dissect_ndr_uint32(
6750 tvb, offset, pinfo, tree, drep,
6751 hf_buffer_size, &size);
6754 tvb, offset + size + 4, pinfo, NULL, drep, hf_returned,
6759 proto_tree *subtree;
6760 int offset2 = offset;
6763 item = proto_tree_add_text(
6764 tree, tvb, offset, 0, "Printer data");
6766 subtree = proto_item_add_subtree(item, ett_PRINTER_DATA_CTR);
6768 for (i=0; i < num_values; i++)
6769 offset2 = dissect_spoolss_printer_enum_values(
6770 tvb, offset2, pinfo, subtree, drep);
6775 offset = dissect_ndr_uint32(
6776 tvb, offset, pinfo, tree, drep, hf_needed, NULL);
6778 offset = dissect_ndr_uint32(
6779 tvb, offset, pinfo, tree, drep, hf_returned, NULL);
6781 offset = dissect_doserror(
6782 tvb, offset, pinfo, tree, drep, hf_rc, NULL);
6788 * List of subdissectors for this pipe.
6791 static dcerpc_sub_dissector dcerpc_spoolss_dissectors[] = {
6792 { SPOOLSS_ENUMPRINTERS, "EnumPrinters",
6793 SpoolssEnumPrinters_q, SpoolssEnumPrinters_r },
6794 { SPOOLSS_OPENPRINTER, "OpenPrinter",
6795 NULL, SpoolssGeneric_r },
6796 { SPOOLSS_SETJOB, "SetJob",
6797 SpoolssSetJob_q, SpoolssSetJob_r },
6798 { SPOOLSS_GETJOB, "GetJob",
6799 SpoolssGetJob_q, SpoolssGetJob_r },
6800 { SPOOLSS_ENUMJOBS, "EnumJobs",
6801 SpoolssEnumJobs_q, SpoolssEnumJobs_r },
6802 { SPOOLSS_ADDPRINTER, "AddPrinter",
6803 NULL, SpoolssGeneric_r },
6804 { SPOOLSS_DELETEPRINTER, "DeletePrinter",
6805 SpoolssDeletePrinter_q, SpoolssDeletePrinter_r },
6806 { SPOOLSS_SETPRINTER, "SetPrinter",
6807 SpoolssSetPrinter_q, SpoolssSetPrinter_r },
6808 { SPOOLSS_GETPRINTER, "GetPrinter",
6809 SpoolssGetPrinter_q, SpoolssGetPrinter_r },
6810 { SPOOLSS_ADDPRINTERDRIVER, "AddPrinterDriver",
6811 NULL, SpoolssAddPrinterDriver_r },
6812 { SPOOLSS_ENUMPRINTERDRIVERS, "EnumPrinterDrivers",
6813 SpoolssEnumPrinterDrivers_q, SpoolssEnumPrinterDrivers_r },
6814 { SPOOLSS_GETPRINTERDRIVER, "GetPrinterDriver",
6815 NULL, SpoolssGeneric_r },
6816 { SPOOLSS_GETPRINTERDRIVERDIRECTORY, "GetPrinterDriverDirectory",
6817 NULL, SpoolssGeneric_r },
6818 { SPOOLSS_DELETEPRINTERDRIVER, "DeletePrinterDriver",
6819 NULL, SpoolssGeneric_r },
6820 { SPOOLSS_ADDPRINTPROCESSOR, "AddPrintProcessor",
6821 NULL, SpoolssGeneric_r },
6822 { SPOOLSS_ENUMPRINTPROCESSORS, "EnumPrintProcessor",
6823 NULL, SpoolssGeneric_r },
6824 { SPOOLSS_GETPRINTPROCESSORDIRECTORY, "GetPrintProcessorDirectory",
6825 NULL, SpoolssGeneric_r },
6826 { SPOOLSS_STARTDOCPRINTER, "StartDocPrinter",
6827 SpoolssStartDocPrinter_q, SpoolssStartDocPrinter_r },
6828 { SPOOLSS_STARTPAGEPRINTER, "StartPagePrinter",
6829 SpoolssStartPagePrinter_q, SpoolssStartPagePrinter_r },
6830 { SPOOLSS_WRITEPRINTER, "WritePrinter",
6831 SpoolssWritePrinter_q, SpoolssWritePrinter_r },
6832 { SPOOLSS_ENDPAGEPRINTER, "EndPagePrinter",
6833 SpoolssEndPagePrinter_q, SpoolssEndPagePrinter_r },
6834 { SPOOLSS_ABORTPRINTER, "AbortPrinter",
6835 NULL, SpoolssGeneric_r },
6836 { SPOOLSS_READPRINTER, "ReadPrinter",
6837 NULL, SpoolssGeneric_r },
6838 { SPOOLSS_ENDDOCPRINTER, "EndDocPrinter",
6839 SpoolssEndDocPrinter_q, SpoolssEndDocPrinter_r },
6840 { SPOOLSS_ADDJOB, "AddJob",
6841 NULL, SpoolssGeneric_r },
6842 { SPOOLSS_SCHEDULEJOB, "ScheduleJob",
6843 NULL, SpoolssGeneric_r },
6844 { SPOOLSS_GETPRINTERDATA, "GetPrinterData",
6845 SpoolssGetPrinterData_q, SpoolssGetPrinterData_r },
6846 { SPOOLSS_SETPRINTERDATA, "SetPrinterData",
6847 SpoolssSetPrinterData_q, SpoolssSetPrinterData_r },
6848 { SPOOLSS_WAITFORPRINTERCHANGE, "WaitForPrinterChange",
6849 NULL, SpoolssGeneric_r },
6850 { SPOOLSS_CLOSEPRINTER, "ClosePrinter",
6851 SpoolssClosePrinter_q, SpoolssClosePrinter_r },
6852 { SPOOLSS_ADDFORM, "AddForm",
6853 SpoolssAddForm_q, SpoolssAddForm_r },
6854 { SPOOLSS_DELETEFORM, "DeleteForm",
6855 SpoolssDeleteForm_q, SpoolssDeleteForm_r },
6856 { SPOOLSS_GETFORM, "GetForm",
6857 SpoolssGetForm_q, SpoolssGetForm_r },
6858 { SPOOLSS_SETFORM, "SetForm",
6859 SpoolssSetForm_q, SpoolssSetForm_r },
6860 { SPOOLSS_ENUMFORMS, "EnumForms",
6861 SpoolssEnumForms_q, SpoolssEnumForms_r },
6862 { SPOOLSS_ENUMPORTS, "EnumPorts",
6863 NULL, SpoolssGeneric_r },
6864 { SPOOLSS_ENUMMONITORS, "EnumMonitors",
6865 NULL, SpoolssGeneric_r },
6866 { SPOOLSS_ADDPORT, "AddPort",
6867 NULL, SpoolssGeneric_r },
6868 { SPOOLSS_CONFIGUREPORT, "ConfigurePort",
6869 NULL, SpoolssGeneric_r },
6870 { SPOOLSS_DELETEPORT, "DeletePort",
6871 NULL, SpoolssGeneric_r },
6872 { SPOOLSS_CREATEPRINTERIC, "CreatePrinterIC",
6873 NULL, SpoolssGeneric_r },
6874 { SPOOLSS_PLAYGDISCRIPTONPRINTERIC, "PlayDiscriptOnPrinterIC",
6875 NULL, SpoolssGeneric_r },
6876 { SPOOLSS_DELETEPRINTERIC, "DeletePrinterIC",
6877 NULL, SpoolssGeneric_r },
6878 { SPOOLSS_ADDPRINTERCONNECTION, "AddPrinterConnection",
6879 NULL, SpoolssGeneric_r },
6880 { SPOOLSS_DELETEPRINTERCONNECTION, "DeletePrinterConnection",
6881 NULL, SpoolssGeneric_r },
6882 { SPOOLSS_PRINTERMESSAGEBOX, "PrinterMessageBox",
6883 NULL, SpoolssGeneric_r },
6884 { SPOOLSS_ADDMONITOR, "AddMonitor",
6885 NULL, SpoolssGeneric_r },
6886 { SPOOLSS_DELETEMONITOR, "DeleteMonitor",
6887 NULL, SpoolssGeneric_r },
6888 { SPOOLSS_DELETEPRINTPROCESSOR, "DeletePrintProcessor",
6889 NULL, SpoolssGeneric_r },
6890 { SPOOLSS_ADDPRINTPROVIDER, "AddPrintProvider",
6891 NULL, SpoolssGeneric_r },
6892 { SPOOLSS_DELETEPRINTPROVIDER, "DeletePrintProvider",
6893 NULL, SpoolssGeneric_r },
6894 { SPOOLSS_ENUMPRINTPROCDATATYPES, "EnumPrintProcDataTypes",
6895 NULL, SpoolssGeneric_r },
6896 { SPOOLSS_RESETPRINTER, "ResetPrinter",
6897 NULL, SpoolssGeneric_r },
6898 { SPOOLSS_GETPRINTERDRIVER2, "GetPrinterDriver2",
6899 SpoolssGetPrinterDriver2_q, SpoolssGetPrinterDriver2_r },
6900 { SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION,
6901 "FindFirstPrinterChangeNotification",
6902 NULL, SpoolssGeneric_r },
6903 { SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION,
6904 "FindNextPrinterChangeNotification",
6905 NULL, SpoolssGeneric_r },
6906 { SPOOLSS_FCPN, "FCPN",
6907 SpoolssFCPN_q, SpoolssFCPN_r },
6908 { SPOOLSS_ROUTERFINDFIRSTPRINTERNOTIFICATIONOLD,
6909 "RouterFindFirstPrinterNotificationOld",
6910 NULL, SpoolssGeneric_r },
6911 { SPOOLSS_REPLYOPENPRINTER, "ReplyOpenPrinter",
6912 SpoolssReplyOpenPrinter_q, SpoolssReplyOpenPrinter_r },
6913 { SPOOLSS_ROUTERREPLYPRINTER, "RouterReplyPrinter",
6914 SpoolssRouterReplyPrinter_q, SpoolssRouterReplyPrinter_r },
6915 { SPOOLSS_REPLYCLOSEPRINTER, "ReplyClosePrinter",
6916 SpoolssReplyClosePrinter_q, SpoolssReplyClosePrinter_r },
6917 { SPOOLSS_ADDPORTEX, "AddPortEx",
6918 NULL, SpoolssGeneric_r },
6919 { SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFICATION,
6920 "RemoteFindFirstPrinterChangeNotification",
6921 NULL, SpoolssGeneric_r },
6922 { SPOOLSS_SPOOLERINIT, "SpoolerInit",
6923 NULL, SpoolssGeneric_r },
6924 { SPOOLSS_RESETPRINTEREX, "ResetPrinterEx",
6925 NULL, SpoolssGeneric_r },
6926 { SPOOLSS_RFFPCNEX, "RFFPCNEX",
6927 SpoolssRFFPCNEX_q, SpoolssRFFPCNEX_r },
6928 { SPOOLSS_RRPCN, "RRPCN",
6929 SpoolssRRPCN_q, SpoolssRRPCN_r },
6930 { SPOOLSS_RFNPCNEX, "RFNPCNEX",
6931 SpoolssRFNPCNEX_q, SpoolssRFNPCNEX_r },
6932 { SPOOLSS_OPENPRINTEREX, "OpenPrinterEx",
6933 SpoolssOpenPrinterEx_q, SpoolssOpenPrinterEx_r },
6934 { SPOOLSS_ADDPRINTEREX, "AddPrinterEx",
6935 NULL, SpoolssAddPrinterEx_r },
6936 { SPOOLSS_ENUMPRINTERDATA, "EnumPrinterData",
6937 SpoolssEnumPrinterData_q, SpoolssEnumPrinterData_r },
6938 { SPOOLSS_DELETEPRINTERDATA, "DeletePrinterData",
6939 SpoolssDeletePrinterData_q, SpoolssDeletePrinterData_r },
6940 { SPOOLSS_GETPRINTERDATAEX, "GetPrinterDataEx",
6941 SpoolssGetPrinterDataEx_q, SpoolssGetPrinterDataEx_r },
6942 { SPOOLSS_SETPRINTERDATAEX, "SetPrinterDataEx",
6943 SpoolssSetPrinterDataEx_q, SpoolssSetPrinterDataEx_r },
6944 { SPOOLSS_ENUMPRINTERDATAEX, "EnumPrinterDataEx",
6945 SpoolssEnumPrinterDataEx_q, SpoolssEnumPrinterDataEx_r },
6946 { SPOOLSS_ENUMPRINTERKEY, "EnumPrinterKey",
6947 SpoolssEnumPrinterKey_q, SpoolssEnumPrinterKey_r },
6948 { SPOOLSS_DELETEPRINTERDATAEX, "DeletePrinterDataEx",
6949 NULL, SpoolssGeneric_r },
6950 { SPOOLSS_DELETEPRINTERDRIVEREX, "DeletePrinterDriverEx",
6951 NULL, SpoolssGeneric_r },
6952 { SPOOLSS_ADDPRINTERDRIVEREX, "AddPrinterDriverEx",
6953 NULL, SpoolssGeneric_r },
6955 { 0, NULL, NULL, NULL },
6959 * Dissector initialisation function
6962 /* Protocol registration */
6964 static int proto_dcerpc_spoolss = -1;
6965 static gint ett_dcerpc_spoolss = -1;
6968 proto_register_dcerpc_spoolss(void)
6970 static hf_register_info hf[] = {
6972 /* GetPrinterDriver2 */
6974 { &hf_clientmajorversion,
6975 { "Client major version", "spoolss.clientmajorversion", FT_UINT32, BASE_DEC,
6976 NULL, 0x0, "Client printer driver major version", HFILL }},
6977 { &hf_clientminorversion,
6978 { "Client minor version", "spoolss.clientminorversion", FT_UINT32, BASE_DEC,
6979 NULL, 0x0, "Client printer driver minor version", HFILL }},
6980 { &hf_servermajorversion,
6981 { "Server major version", "spoolss.servermajorversion", FT_UINT32, BASE_DEC,
6982 NULL, 0x0, "Server printer driver major version", HFILL }},
6983 { &hf_serverminorversion,
6984 { "Server minor version", "spoolss.serverminorversion", FT_UINT32, BASE_DEC,
6985 NULL, 0x0, "Server printer driver minor version", HFILL }},
6987 { "Driver path", "spoolss.driverpath", FT_STRING, BASE_NONE,
6988 NULL, 0, NULL, HFILL }},
6990 { "Data file", "spoolss.datafile", FT_STRING, BASE_NONE,
6991 NULL, 0, NULL, HFILL }},
6993 { "Config file", "spoolss.configfile", FT_STRING, BASE_NONE,
6994 NULL, 0, "Printer name", HFILL }},
6996 { "Help file", "spoolss.helpfile", FT_STRING, BASE_NONE,
6997 NULL, 0, NULL, HFILL }},
6999 { "Monitor name", "spoolss.monitorname", FT_STRING, BASE_NONE,
7000 NULL, 0, NULL, HFILL }},
7001 { &hf_defaultdatatype,
7002 { "Default data type", "spoolss.defaultdatatype", FT_STRING, BASE_NONE,
7003 NULL, 0, NULL, HFILL }},
7004 { &hf_driverinfo_cversion,
7005 { "Driver version", "spoolss.driverversion", FT_UINT32, BASE_DEC,
7006 VALS(driverinfo_cversion_vals), 0, "Printer name", HFILL }},
7007 { &hf_dependentfiles,
7008 { "Dependent files", "spoolss.dependentfiles", FT_STRING, BASE_NONE,
7009 NULL, 0, NULL, HFILL }},
7011 { &hf_printer_status,
7012 { "Status", "spoolss.printer_status", FT_UINT32, BASE_DEC,
7013 VALS(printer_status_vals), 0, NULL, HFILL }},
7015 { &hf_previousdrivernames,
7016 { "Previous Driver Names", "spoolss.previousdrivernames", FT_STRING, BASE_NONE,
7017 NULL, 0, NULL, HFILL }},
7020 { "Driver Date", "spoolss.driverdate", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
7021 NULL, 0, "Date of driver creation", HFILL }},
7024 { "Padding", "spoolss.padding", FT_UINT32, BASE_HEX,
7025 NULL, 0, "Some padding - conveys no semantic information", HFILL }},
7027 { &hf_driver_version_low,
7028 { "Minor Driver Version", "spoolss.minordriverversion", FT_UINT32, BASE_DEC,
7029 NULL, 0, "Driver Version Low", HFILL }},
7031 { &hf_driver_version_high,
7032 { "Major Driver Version", "spoolss.majordriverversion", FT_UINT32, BASE_DEC,
7033 NULL, 0, "Driver Version High", HFILL }},
7036 { "Mfgname", "spoolss.mfgname", FT_STRING, BASE_NONE,
7037 NULL, 0, "Manufacturer Name", HFILL }},
7040 { "OEM URL", "spoolss.oemrul", FT_STRING, BASE_NONE,
7041 NULL, 0, "OEM URL - Website of Vendor", HFILL }},
7044 { "Hardware ID", "spoolss.hardwareid", FT_STRING, BASE_NONE,
7045 NULL, 0, "Hardware Identification Information", HFILL }},
7048 { "Provider", "spoolss.provider", FT_STRING, BASE_NONE,
7049 NULL, 0, "Provider of Driver", HFILL }},
7051 /* Setprinter RPC */
7053 { &hf_setprinter_cmd,
7054 { "Command", "spoolss.setprinter_cmd", FT_UINT32, BASE_DEC,
7055 VALS(setprinter_cmd_vals), 0, NULL, HFILL }},
7059 { &hf_enumprinters_flags,
7060 { "Flags", "spoolss.enumprinters.flags",
7061 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7063 { &hf_enumprinters_flags_local,
7064 { "Enum local", "spoolss.enumprinters.flags.enum_local",
7065 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7066 PRINTER_ENUM_LOCAL, NULL, HFILL }},
7068 { &hf_enumprinters_flags_name,
7069 { "Enum name", "spoolss.enumprinters.flags.enum_name",
7070 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7071 PRINTER_ENUM_NAME, NULL, HFILL }},
7073 { &hf_enumprinters_flags_shared,
7074 { "Enum shared", "spoolss.enumprinters.flags.enum_shared",
7075 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7076 PRINTER_ENUM_SHARED, NULL, HFILL }},
7078 { &hf_enumprinters_flags_default,
7079 { "Enum default", "spoolss.enumprinters.flags.enum_default",
7080 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7081 PRINTER_ENUM_DEFAULT, NULL, HFILL }},
7083 { &hf_enumprinters_flags_connections,
7084 { "Enum connections", "spoolss.enumprinters.flags.enum_connections",
7085 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7086 PRINTER_ENUM_CONNECTIONS, NULL, HFILL }},
7088 { &hf_enumprinters_flags_network,
7089 { "Enum network", "spoolss.enumprinters.flags.enum_network",
7090 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7091 PRINTER_ENUM_NETWORK, NULL, HFILL }},
7093 { &hf_enumprinters_flags_remote,
7094 { "Enum remote", "spoolss.enumprinters.flags.enum_remote",
7095 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7096 PRINTER_ENUM_REMOTE, NULL, HFILL }},
7101 { "Start time", "spoolss.start_time",
7102 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7105 { "End time", "spoolss.end_time",
7106 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7109 { "Elapsed time", "spoolss.elapsed_time",
7110 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7113 * New hf index values
7117 { "Operation", "spoolss.opnum", FT_UINT16, BASE_DEC,
7118 NULL, 0x0, NULL, HFILL }},
7121 { "Context handle", "spoolss.hnd", FT_BYTES, BASE_NONE,
7122 NULL, 0x0, "SPOOLSS policy handle", HFILL }},
7125 { "Return code", "spoolss.rc", FT_UINT32, BASE_HEX,
7126 VALS(DOS_errors), 0x0, "SPOOLSS return code", HFILL }},
7129 { "Offered", "spoolss.offered", FT_UINT32, BASE_DEC,
7130 NULL, 0x0, "Size of buffer offered in this request",
7134 { "Needed", "spoolss.needed", FT_UINT32, BASE_DEC,
7135 NULL, 0x0, "Size of buffer required for request", HFILL }},
7138 { "Returned", "spoolss.returned", FT_UINT32, BASE_DEC,
7139 NULL, 0x0, "Number of items returned", HFILL }},
7142 { "Buffer size", "spoolss.buffer.size", FT_UINT32, BASE_DEC,
7143 NULL, 0x0, "Size of buffer", HFILL }},
7146 { "Buffer data", "spoolss.buffer.data", FT_BYTES, BASE_NONE,
7147 NULL, 0x0, "Contents of buffer", HFILL }},
7150 { "Offset", "spoolss.offset", FT_UINT32, BASE_DEC,
7151 NULL, 0x0, "Offset of data", HFILL }},
7154 { "Info level", "spoolss.enumjobs.level", FT_UINT32,
7155 BASE_DEC, NULL, 0x0, NULL, HFILL }},
7159 { "Printer name", "spoolss.printername", FT_STRING,
7160 BASE_NONE, NULL, 0, NULL, HFILL }},
7163 { "Machine name", "spoolss.machinename", FT_STRING,
7164 BASE_NONE, NULL, 0, NULL, HFILL }},
7167 { "Notify name", "spoolss.notifyname", FT_STRING,
7168 BASE_NONE, NULL, 0, NULL, HFILL }},
7171 { "Printer description", "spoolss.printerdesc", FT_STRING,
7172 BASE_NONE, NULL, 0, NULL, HFILL }},
7174 { &hf_printercomment,
7175 { "Printer comment", "spoolss.printercomment", FT_STRING,
7176 BASE_NONE, NULL, 0, NULL, HFILL }},
7179 { "Server name", "spoolss.servername", FT_STRING, BASE_NONE,
7180 NULL, 0, NULL, HFILL }},
7183 { "Share name", "spoolss.sharename", FT_STRING, BASE_NONE,
7184 NULL, 0, NULL, HFILL }},
7187 { "Port name", "spoolss.portname", FT_STRING, BASE_NONE,
7188 NULL, 0, NULL, HFILL }},
7190 { &hf_printerlocation,
7191 { "Printer location", "spoolss.printerlocation", FT_STRING,
7192 BASE_NONE, NULL, 0, NULL, HFILL }},
7195 { "Architecture name", "spoolss.architecture", FT_STRING,
7196 BASE_NONE, NULL, 0, NULL, HFILL }},
7199 { "Driver name", "spoolss.drivername", FT_STRING, BASE_NONE,
7200 NULL, 0, NULL, HFILL }},
7203 { "User name", "spoolss.username", FT_STRING, BASE_NONE,
7204 NULL, 0, NULL, HFILL }},
7207 { "Document name", "spoolss.document", FT_STRING, BASE_NONE,
7208 NULL, 0, NULL, HFILL }},
7211 { "Output file", "spoolss.outputfile", FT_STRING, BASE_NONE,
7212 NULL, 0, NULL, HFILL }},
7215 { "Datatype", "spoolss.Datatype", FT_STRING, BASE_NONE,
7216 NULL, 0, NULL, HFILL }},
7219 { "Text status", "spoolss.textstatus", FT_STRING, BASE_NONE,
7220 NULL, 0, NULL, HFILL }},
7223 { "Separator file", "spoolss.setpfile", FT_STRING, BASE_NONE,
7224 NULL, 0, NULL, HFILL }},
7227 { "Parameters", "spoolss.parameters", FT_STRING, BASE_NONE,
7228 NULL, 0, NULL, HFILL }},
7230 { &hf_printprocessor,
7231 { "Print processor", "spoolss.printprocessor", FT_STRING,
7232 BASE_NONE, NULL, 0, NULL, HFILL }},
7237 { "Data", "spoolss.printerdata", FT_UINT32,
7238 BASE_HEX, NULL, 0, NULL, HFILL }},
7240 { &hf_printerdata_key,
7241 { "Key", "spoolss.printerdata.key", FT_STRING,
7242 BASE_NONE, NULL, 0, "Printer data key", HFILL }},
7244 { &hf_printerdata_value,
7245 { "Value", "spoolss.printerdata.value",
7246 FT_STRING, BASE_NONE, NULL, 0, "Printer data value",
7249 { &hf_printerdata_type,
7250 { "Type", "spoolss.printerdata.type",
7251 FT_UINT32, BASE_DEC, VALS(reg_datatypes), 0,
7252 "Printer data type", HFILL }},
7254 { &hf_printerdata_size,
7255 { "Size", "spoolss.printerdata.size",
7256 FT_UINT32, BASE_DEC, NULL, 0, "Printer data size",
7259 { &hf_printerdata_data,
7260 { "Data", "spoolss.printerdata.data", FT_BYTES, BASE_NONE,
7261 NULL, 0x0, "Printer data", HFILL }},
7263 { &hf_printerdata_data_dword,
7264 { "DWORD data", "spoolss.printerdata.data.dword",
7265 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7267 { &hf_printerdata_data_sz,
7268 { "String data", "spoolss.printerdata.data.sz",
7269 FT_STRING, BASE_NONE, NULL, 0, NULL,
7274 { &hf_devmodectr_size,
7275 { "Devicemode ctr size", "spoolss.devicemodectr.size",
7276 FT_UINT32, BASE_DEC, NULL, 0, NULL,
7280 { "Devicemode", "spoolss.devmode", FT_UINT32,
7281 BASE_HEX, NULL, 0, NULL, HFILL }},
7284 { "Size", "spoolss.devmode.size",
7285 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7287 { &hf_devmode_spec_version,
7288 { "Spec version", "spoolss.devmode.spec_version",
7289 FT_UINT16, BASE_DEC, VALS(devmode_specversion_vals),
7292 { &hf_devmode_driver_version,
7293 { "Driver version", "spoolss.devmode.driver_version",
7294 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
7296 { &hf_devmode_size2,
7297 { "Size2", "spoolss.devmode.size2",
7298 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
7300 { &hf_devmode_fields,
7301 { "Fields", "spoolss.devmode.fields",
7302 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7304 { &hf_devmode_orientation,
7305 { "Orientation", "spoolss.devmode.orientation",
7306 FT_UINT16, BASE_DEC, VALS(devmode_orientation_vals),
7309 { &hf_devmode_paper_size,
7310 { "Paper size", "spoolss.devmode.paper_size",
7311 FT_UINT16, BASE_DEC, VALS(devmode_papersize_vals),
7314 { &hf_devmode_paper_width,
7315 { "Paper width", "spoolss.devmode.paper_width",
7316 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
7318 { &hf_devmode_paper_length,
7319 { "Paper length", "spoolss.devmode.paper_length",
7320 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
7322 { &hf_devmode_scale,
7323 { "Scale", "spoolss.devmode.scale",
7324 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
7326 { &hf_devmode_copies,
7327 { "Copies", "spoolss.devmode.copies",
7328 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
7330 { &hf_devmode_default_source,
7331 { "Default source", "spoolss.devmode.default_source",
7332 FT_UINT16, BASE_DEC, VALS(devmode_papersource_vals),
7335 { &hf_devmode_print_quality,
7336 { "Print quality", "spoolss.devmode.print_quality",
7337 FT_UINT16, BASE_DEC, VALS(devmode_printquality_vals),
7340 { &hf_devmode_color,
7341 { "Color", "spoolss.devmode.color",
7342 FT_UINT16, BASE_DEC, VALS(devmode_colour_vals), 0,
7345 { &hf_devmode_duplex,
7346 { "Duplex", "spoolss.devmode.duplex",
7347 FT_UINT16, BASE_DEC, VALS(devmode_duplex_vals), 0,
7350 { &hf_devmode_y_resolution,
7351 { "Y resolution", "spoolss.devmode.y_resolution",
7352 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
7354 { &hf_devmode_tt_option,
7355 { "TT option", "spoolss.devmode.tt_option",
7356 FT_UINT16, BASE_DEC, VALS(devmode_ttoption_vals), 0,
7359 { &hf_devmode_collate,
7360 { "Collate", "spoolss.devmode.collate",
7361 FT_UINT16, BASE_DEC, VALS(devmode_collate_vals), 0,
7364 { &hf_devmode_log_pixels,
7365 { "Log pixels", "spoolss.devmode.log_pixels",
7366 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
7368 { &hf_devmode_bits_per_pel,
7369 { "Bits per pel", "spoolss.devmode.bits_per_pel",
7370 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7372 { &hf_devmode_pels_width,
7373 { "Pels width", "spoolss.devmode.pels_width",
7374 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7376 { &hf_devmode_pels_height,
7377 { "Pels height", "spoolss.devmode.pels_height",
7378 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7380 { &hf_devmode_display_flags,
7381 { "Display flags", "spoolss.devmode.display_flags",
7382 FT_UINT32, BASE_DEC, VALS(devmode_displayflags_vals), 0,
7385 { &hf_devmode_display_freq,
7386 { "Display frequency", "spoolss.devmode.display_freq",
7387 FT_UINT32, BASE_DEC, NULL, 0, NULL,
7390 { &hf_devmode_icm_method,
7391 { "ICM method", "spoolss.devmode.icm_method",
7392 FT_UINT32, BASE_DEC, VALS(devmode_icmmethod_vals), 0,
7395 { &hf_devmode_icm_intent,
7396 { "ICM intent", "spoolss.devmode.icm_intent",
7397 FT_UINT32, BASE_DEC, VALS(devmode_icmintent_vals), 0,
7400 { &hf_devmode_media_type,
7401 { "Media type", "spoolss.devmode.media_type",
7402 FT_UINT32, BASE_DEC, VALS(devmode_mediatype_vals), 0,
7405 { &hf_devmode_dither_type,
7406 { "Dither type", "spoolss.devmode.dither_type",
7407 FT_UINT32, BASE_DEC, VALS(devmode_dithertype_vals), 0,
7410 { &hf_devmode_reserved1,
7411 { "Reserved1", "spoolss.devmode.reserved1",
7412 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7414 { &hf_devmode_reserved2,
7415 { "Reserved2", "spoolss.devmode.reserved2",
7416 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7418 { &hf_devmode_panning_width,
7419 { "Panning width", "spoolss.devmode.panning_width",
7420 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7422 { &hf_devmode_panning_height,
7423 { "Panning height", "spoolss.devmode.panning_height",
7424 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7426 { &hf_devmode_driver_extra_len,
7427 { "Driver extra length",
7428 "spoolss.devmode.driver_extra_len",
7429 FT_UINT32, BASE_DEC, NULL, 0, NULL,
7432 { &hf_devmode_driver_extra,
7433 { "Driver extra", "spoolss.devmode.driver_extra",
7434 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
7436 /* Devicemode fields */
7438 { &hf_devmode_fields_orientation,
7439 { "Orientation", "spoolss.devmode.fields.orientation",
7440 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7441 DEVMODE_ORIENTATION, NULL, HFILL }},
7443 { &hf_devmode_fields_papersize,
7444 { "Paper size", "spoolss.devmode.fields.paper_size",
7445 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7446 DEVMODE_PAPERSIZE, NULL, HFILL }},
7448 { &hf_devmode_fields_paperlength,
7449 { "Paper length", "spoolss.devmode.fields.paper_length",
7450 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7451 DEVMODE_PAPERLENGTH, NULL, HFILL }},
7453 { &hf_devmode_fields_paperwidth,
7454 { "Paper width", "spoolss.devmode.fields.paper_width",
7455 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7456 DEVMODE_PAPERWIDTH, NULL, HFILL }},
7458 { &hf_devmode_fields_scale,
7459 { "Scale", "spoolss.devmode.fields.scale",
7460 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7461 DEVMODE_SCALE, NULL, HFILL }},
7463 { &hf_devmode_fields_position,
7464 { "Position", "spoolss.devmode.fields.position",
7465 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7466 DEVMODE_POSITION, NULL, HFILL }},
7468 { &hf_devmode_fields_nup,
7469 { "N-up", "spoolss.devmode.fields.nup",
7470 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7471 DEVMODE_NUP, NULL, HFILL }},
7473 { &hf_devmode_fields_copies,
7474 { "Copies", "spoolss.devmode.fields.copies",
7475 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7476 DEVMODE_COPIES, NULL, HFILL }},
7478 { &hf_devmode_fields_defaultsource,
7479 { "Default source", "spoolss.devmode.fields.default_source",
7480 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7481 DEVMODE_DEFAULTSOURCE, NULL, HFILL }},
7483 { &hf_devmode_fields_printquality,
7484 { "Print quality", "spoolss.devmode.fields.print_quality",
7485 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7486 DEVMODE_PRINTQUALITY, NULL, HFILL }},
7488 { &hf_devmode_fields_color,
7489 { "Color", "spoolss.devmode.fields.color",
7490 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7491 DEVMODE_COLOR, NULL, HFILL }},
7493 { &hf_devmode_fields_duplex,
7494 { "Duplex", "spoolss.devmode.fields.duplex",
7495 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7496 DEVMODE_DUPLEX, NULL, HFILL }},
7498 { &hf_devmode_fields_yresolution,
7499 { "Y resolution", "spoolss.devmode.fields.y_resolution",
7500 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7501 DEVMODE_YRESOLUTION, NULL, HFILL }},
7503 { &hf_devmode_fields_ttoption,
7504 { "TT option", "spoolss.devmode.fields.tt_option",
7505 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7506 DEVMODE_TTOPTION, NULL, HFILL }},
7508 { &hf_devmode_fields_collate,
7509 { "Collate", "spoolss.devmode.fields.collate",
7510 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7511 DEVMODE_COLLATE, NULL, HFILL }},
7513 { &hf_devmode_fields_formname,
7514 { "Form name", "spoolss.devmode.fields.form_name",
7515 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7516 DEVMODE_FORMNAME, NULL, HFILL }},
7518 { &hf_devmode_fields_logpixels,
7519 { "Log pixels", "spoolss.devmode.fields.log_pixels",
7520 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7521 DEVMODE_LOGPIXELS, NULL, HFILL }},
7523 { &hf_devmode_fields_bitsperpel,
7524 { "Bits per pel", "spoolss.devmode.fields.bits_per_pel",
7525 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7526 DEVMODE_BITSPERPEL, NULL, HFILL }},
7528 { &hf_devmode_fields_pelswidth,
7529 { "Pels width", "spoolss.devmode.fields.pels_width",
7530 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7531 DEVMODE_PELSWIDTH, NULL, HFILL }},
7533 { &hf_devmode_fields_pelsheight,
7534 { "Pels height", "spoolss.devmode.fields.pels_height",
7535 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7536 DEVMODE_PELSHEIGHT, NULL, HFILL }},
7538 { &hf_devmode_fields_displayflags,
7539 { "Display flags", "spoolss.devmode.fields.display_flags",
7540 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7541 DEVMODE_DISPLAYFLAGS, NULL, HFILL }},
7543 { &hf_devmode_fields_displayfrequency,
7544 { "Display frequency",
7545 "spoolss.devmode.fields.display_frequency",
7546 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7547 DEVMODE_DISPLAYFREQUENCY, NULL, HFILL }},
7549 { &hf_devmode_fields_icmmethod,
7550 { "ICM method", "spoolss.devmode.fields.icm_method",
7551 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7552 DEVMODE_ICMMETHOD, NULL, HFILL }},
7554 { &hf_devmode_fields_icmintent,
7555 { "ICM intent", "spoolss.devmode.fields.icm_intent",
7556 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7557 DEVMODE_ICMINTENT, NULL, HFILL }},
7559 { &hf_devmode_fields_mediatype,
7560 { "Media type", "spoolss.devmode.fields.media_type",
7561 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7562 DEVMODE_MEDIATYPE, NULL, HFILL }},
7564 { &hf_devmode_fields_dithertype,
7565 { "Dither type", "spoolss.devmode.fields.dither_type",
7566 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7567 DEVMODE_DITHERTYPE, NULL, HFILL }},
7569 { &hf_devmode_fields_panningwidth,
7570 { "Panning width", "spoolss.devmode.fields.panning_width",
7571 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7572 DEVMODE_PANNINGWIDTH, NULL, HFILL }},
7574 { &hf_devmode_fields_panningheight,
7575 { "Panning height", "spoolss.devmode.fields.panning_height",
7576 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
7577 DEVMODE_PANNINGHEIGHT, NULL, HFILL }},
7579 /* EnumPrinterData RPC */
7581 { &hf_enumprinterdata_enumindex,
7582 { "Enum index", "spoolss.enumprinterdata.enumindex",
7583 FT_UINT32, BASE_DEC, NULL, 0x0,
7584 "Index for start of enumeration", HFILL }},
7586 { &hf_enumprinterdata_value_offered,
7587 { "Value size offered",
7588 "spoolss.enumprinterdata.value_offered", FT_UINT32,
7589 BASE_DEC, NULL, 0x0,
7590 "Buffer size offered for printerdata value", HFILL }},
7592 { &hf_enumprinterdata_data_offered,
7593 { "Data size offered",
7594 "spoolss.enumprinterdata.data_offered", FT_UINT32,
7595 BASE_DEC, NULL, 0x0,
7596 "Buffer size offered for printerdata data", HFILL }},
7598 { &hf_enumprinterdata_value_len,
7600 "spoolss.enumprinterdata.value_len", FT_UINT32,
7601 BASE_DEC, NULL, 0x0,
7602 "Size of printerdata value", HFILL }},
7604 { &hf_enumprinterdata_value_needed,
7605 { "Value size needed",
7606 "spoolss.enumprinterdata.value_needed", FT_UINT32,
7607 BASE_DEC, NULL, 0x0,
7608 "Buffer size needed for printerdata value", HFILL }},
7610 { &hf_enumprinterdata_data_needed,
7611 { "Data size needed",
7612 "spoolss.enumprinterdata.data_needed", FT_UINT32, BASE_DEC,
7613 NULL, 0x0, "Buffer size needed for printerdata data",
7619 { "Job ID", "spoolss.job.id", FT_UINT32, BASE_DEC,
7620 NULL, 0x0, "Job identification number", HFILL }},
7623 { "Job status", "spoolss.job.status", FT_UINT32, BASE_DEC,
7624 NULL, 0x0, NULL, HFILL }},
7626 { &hf_job_status_paused,
7627 { "Paused", "spoolss.job.status.paused", FT_BOOLEAN, 32,
7628 TFS(&tfs_job_status_paused), JOB_STATUS_PAUSED,
7631 { &hf_job_status_error,
7632 { "Error", "spoolss.job.status.error", FT_BOOLEAN, 32,
7633 TFS(&tfs_job_status_error), JOB_STATUS_ERROR,
7636 { &hf_job_status_deleting,
7637 { "Deleting", "spoolss.job.status.deleting", FT_BOOLEAN, 32,
7638 TFS(&tfs_job_status_deleting), JOB_STATUS_DELETING,
7641 { &hf_job_status_spooling,
7642 { "Spooling", "spoolss.job.status.spooling", FT_BOOLEAN, 32,
7643 TFS(&tfs_job_status_spooling), JOB_STATUS_SPOOLING,
7646 { &hf_job_status_printing,
7647 { "Printing", "spoolss.job.status.printing", FT_BOOLEAN, 32,
7648 TFS(&tfs_job_status_printing), JOB_STATUS_PRINTING,
7651 { &hf_job_status_offline,
7652 { "Offline", "spoolss.job.status.offline", FT_BOOLEAN, 32,
7653 TFS(&tfs_job_status_offline), JOB_STATUS_OFFLINE,
7656 { &hf_job_status_paperout,
7657 { "Paperout", "spoolss.job.status.paperout", FT_BOOLEAN, 32,
7658 TFS(&tfs_job_status_paperout), JOB_STATUS_PAPEROUT,
7661 { &hf_job_status_printed,
7662 { "Printed", "spoolss.job.status.printed", FT_BOOLEAN, 32,
7663 TFS(&tfs_job_status_printed), JOB_STATUS_PRINTED,
7666 { &hf_job_status_deleted,
7667 { "Deleted", "spoolss.job.status.deleted", FT_BOOLEAN, 32,
7668 TFS(&tfs_job_status_deleted), JOB_STATUS_DELETED,
7671 { &hf_job_status_blocked,
7672 { "Blocked", "spoolss.job.status.blocked", FT_BOOLEAN, 32,
7673 TFS(&tfs_job_status_blocked), JOB_STATUS_BLOCKED,
7676 { &hf_job_status_user_intervention,
7677 { "User intervention",
7678 "spoolss.job.status.user_intervention", FT_BOOLEAN, 32,
7679 TFS(&tfs_job_status_user_intervention),
7680 JOB_STATUS_USER_INTERVENTION, NULL,
7684 { "Job priority", "spoolss.job.priority", FT_UINT32,
7685 BASE_DEC, NULL, 0x0, NULL, HFILL }},
7688 { "Job position", "spoolss.job.position", FT_UINT32,
7689 BASE_DEC, NULL, 0x0, NULL, HFILL }},
7691 { &hf_job_totalpages,
7692 { "Job total pages", "spoolss.job.totalpages", FT_UINT32,
7693 BASE_DEC, NULL, 0x0, NULL, HFILL }},
7695 { &hf_job_totalbytes,
7696 { "Job total bytes", "spoolss.job.totalbytes", FT_UINT32,
7697 BASE_DEC, NULL, 0x0, NULL, HFILL }},
7699 { &hf_job_bytesprinted,
7700 { "Job bytes printed", "spoolss.job.bytesprinted",
7701 FT_UINT32, BASE_DEC, NULL, 0x0, NULL,
7704 { &hf_job_pagesprinted,
7705 { "Job pages printed", "spoolss.job.pagesprinted",
7706 FT_UINT32, BASE_DEC, NULL, 0x0, NULL,
7710 { "Job size", "spoolss.job.size", FT_UINT32, BASE_DEC,
7711 NULL, 0x0, NULL, HFILL }},
7716 { "Data", "spoolss.form", FT_UINT32,
7717 BASE_HEX, NULL, 0, NULL, HFILL }},
7720 { "Level", "spoolss.form.level", FT_UINT32,
7721 BASE_DEC, NULL, 0, NULL, HFILL }},
7724 { "Name", "spoolss.form.name", FT_STRING, BASE_NONE,
7725 NULL, 0, NULL, HFILL }},
7728 { "Flags", "spoolss.form.flags", FT_UINT32,
7729 BASE_DEC, VALS(form_type_vals), 0, NULL, HFILL }},
7732 { "Unknown", "spoolss.form.unknown", FT_UINT32,
7733 BASE_HEX, NULL, 0, NULL, HFILL }},
7736 { "Width", "spoolss.form.width", FT_UINT32,
7737 BASE_DEC, NULL, 0, NULL, HFILL }},
7740 { "Height", "spoolss.form.height", FT_UINT32,
7741 BASE_DEC, NULL, 0, NULL, HFILL }},
7743 { &hf_form_left_margin,
7744 { "Left margin", "spoolss.form.left", FT_UINT32,
7745 BASE_DEC, NULL, 0, "Left", HFILL }},
7747 { &hf_form_top_margin,
7748 { "Top", "spoolss.form.top", FT_UINT32,
7749 BASE_DEC, NULL, 0, NULL, HFILL }},
7751 { &hf_form_horiz_len,
7752 { "Horizontal", "spoolss.form.horiz", FT_UINT32,
7753 BASE_DEC, NULL, 0, NULL, HFILL }},
7755 { &hf_form_vert_len,
7756 { "Vertical", "spoolss.form.vert", FT_UINT32,
7757 BASE_DEC, NULL, 0, NULL, HFILL }},
7759 { &hf_enumforms_num,
7760 { "Num", "spoolss.enumforms.num", FT_UINT32,
7761 BASE_DEC, NULL, 0, NULL, HFILL }},
7765 { &hf_notify_options_version,
7766 { "Version", "spoolss.notify_options.version", FT_UINT32,
7767 BASE_DEC, NULL, 0, NULL, HFILL }},
7769 { &hf_notify_options_flags,
7770 { "Flags", "spoolss.notify_options.flags", FT_UINT32,
7771 BASE_DEC, NULL, 0, NULL, HFILL }},
7773 { &hf_notify_options_count,
7774 { "Count", "spoolss.notify_options.count", FT_UINT32,
7775 BASE_DEC, NULL, 0, NULL, HFILL }},
7777 { &hf_notify_option_type,
7778 { "Type", "spoolss.notify_option.type", FT_UINT16, BASE_DEC,
7779 VALS(printer_notify_types), 0, NULL, HFILL }},
7781 { &hf_notify_option_reserved1,
7782 { "Reserved1", "spoolss.notify_option.reserved1", FT_UINT16,
7783 BASE_DEC, NULL, 0, NULL, HFILL }},
7785 { &hf_notify_option_reserved2,
7786 { "Reserved2", "spoolss.notify_option.reserved2", FT_UINT32,
7787 BASE_DEC, NULL, 0, NULL, HFILL }},
7789 { &hf_notify_option_reserved3,
7790 { "Reserved3", "spoolss.notify_option.reserved3", FT_UINT32,
7791 BASE_DEC, NULL, 0, NULL, HFILL }},
7793 { &hf_notify_option_count,
7794 { "Count", "spoolss.notify_option.count", FT_UINT32,
7795 BASE_DEC, NULL, 0, NULL, HFILL }},
7797 { &hf_notify_option_data_count,
7798 { "Count", "spoolss.notify_option_data.count", FT_UINT32,
7799 BASE_DEC, NULL, 0, NULL, HFILL }},
7801 { &hf_notify_options_flags_refresh,
7802 { "Refresh", "spoolss.notify_options.flags", FT_BOOLEAN, 32,
7803 TFS(&tfs_notify_options_flags_refresh),
7804 PRINTER_NOTIFY_OPTIONS_REFRESH, NULL, HFILL }},
7806 { &hf_notify_info_count,
7807 { "Count", "spoolss.notify_info.count", FT_UINT32, BASE_DEC,
7808 NULL, 0, NULL, HFILL }},
7810 { &hf_notify_info_version,
7811 { "Version", "spoolss.notify_info.version", FT_UINT32,
7812 BASE_DEC, NULL, 0, NULL, HFILL }},
7814 { &hf_notify_info_flags,
7815 { "Flags", "spoolss.notify_info.flags", FT_UINT32, BASE_HEX,
7816 NULL, 0, NULL, HFILL }},
7818 { &hf_notify_info_data_type,
7819 { "Type", "spoolss.notify_info_data.type", FT_UINT16,
7820 BASE_DEC, VALS(printer_notify_types), 0, NULL, HFILL }},
7823 { "Field", "spoolss.notify_field", FT_UINT16, BASE_DEC,
7824 NULL, 0, NULL, HFILL }},
7826 { &hf_notify_info_data_count,
7827 { "Count", "spoolss.notify_info_data.count", FT_UINT32,
7828 BASE_DEC, NULL, 0, NULL, HFILL }},
7830 { &hf_notify_info_data_id,
7831 { "Job Id", "spoolss.notify_info_data.jobid", FT_UINT32,
7832 BASE_DEC, NULL, 0, NULL, HFILL }},
7834 { &hf_notify_info_data_value1,
7835 { "Value1", "spoolss.notify_info_data.value1", FT_UINT32,
7836 BASE_HEX, NULL, 0, NULL, HFILL }},
7838 { &hf_notify_info_data_value2,
7839 { "Value2", "spoolss.notify_info_data.value2", FT_UINT32,
7840 BASE_HEX, NULL, 0, NULL, HFILL }},
7842 { &hf_notify_info_data_bufsize,
7843 { "Buffer size", "spoolss.notify_info_data.bufsize",
7844 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7846 { &hf_notify_info_data_buffer,
7847 { "Buffer", "spoolss.notify_info_data.buffer", FT_UINT32,
7848 BASE_HEX, NULL, 0, NULL, HFILL }},
7850 { &hf_notify_info_data_buffer_len,
7851 { "Buffer length", "spoolss.notify_info_data.buffer.len",
7852 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7854 { &hf_notify_info_data_buffer_data,
7855 { "Buffer data", "spoolss.notify_info_data.buffer.data",
7856 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
7860 { &hf_rffpcnex_options,
7861 { "Options", "spoolss.rffpcnex.options", FT_UINT32, BASE_DEC,
7862 NULL, 0, "RFFPCNEX options", HFILL }},
7864 { &hf_printerlocal, /* XXX: move me */
7865 { "Printer local", "spoolss.printer_local", FT_UINT32,
7866 BASE_DEC, NULL, 0, NULL, HFILL }},
7868 { &hf_rffpcnex_flags,
7869 { "RFFPCNEX flags", "spoolss.rffpcnex.flags", FT_UINT32,
7870 BASE_DEC, NULL, 0, NULL, HFILL }},
7872 { &hf_rffpcnex_flags_add_printer,
7873 { "Add printer", "spoolss.rffpcnex.flags.add_printer",
7874 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_add_printer),
7875 SPOOLSS_PRINTER_CHANGE_ADD_PRINTER, NULL,
7878 { &hf_rffpcnex_flags_set_printer,
7879 { "Set printer", "spoolss.rffpcnex.flags.set_printer",
7880 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_set_printer),
7881 SPOOLSS_PRINTER_CHANGE_SET_PRINTER, NULL,
7884 { &hf_rffpcnex_flags_delete_printer,
7885 { "Delete printer", "spoolss.rffpcnex.flags.delete_printer",
7886 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_delete_printer),
7887 SPOOLSS_PRINTER_CHANGE_DELETE_PRINTER, NULL,
7890 { &hf_rffpcnex_flags_add_job,
7891 { "Add job", "spoolss.rffpcnex.flags.add_job",
7892 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_add_job),
7893 SPOOLSS_PRINTER_CHANGE_ADD_JOB, NULL, HFILL }},
7895 { &hf_rffpcnex_flags_set_job,
7896 { "Set job", "spoolss.rffpcnex.flags.set_job",
7897 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_set_job),
7898 SPOOLSS_PRINTER_CHANGE_SET_JOB, NULL, HFILL }},
7900 { &hf_rffpcnex_flags_delete_job,
7901 { "Delete job", "spoolss.rffpcnex.flags.delete_job",
7902 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_delete_job),
7903 SPOOLSS_PRINTER_CHANGE_DELETE_JOB, NULL, HFILL }},
7905 { &hf_rffpcnex_flags_write_job,
7906 { "Write job", "spoolss.rffpcnex.flags.write_job",
7907 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_write_job),
7908 SPOOLSS_PRINTER_CHANGE_WRITE_JOB, NULL, HFILL }},
7910 { &hf_rffpcnex_flags_add_form,
7911 { "Add form", "spoolss.rffpcnex.flags.add_form",
7912 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_add_form),
7913 SPOOLSS_PRINTER_CHANGE_ADD_FORM, NULL, HFILL }},
7915 { &hf_rffpcnex_flags_set_form,
7916 { "Set form", "spoolss.rffpcnex.flags.set_form",
7917 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_set_form),
7918 SPOOLSS_PRINTER_CHANGE_SET_FORM, NULL, HFILL }},
7920 { &hf_rffpcnex_flags_delete_form,
7921 { "Delete form", "spoolss.rffpcnex.flags.delete_form",
7922 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_delete_form),
7923 SPOOLSS_PRINTER_CHANGE_DELETE_FORM, NULL,
7926 { &hf_rffpcnex_flags_add_port,
7927 { "Add port", "spoolss.rffpcnex.flags.add_port",
7928 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_add_port),
7929 SPOOLSS_PRINTER_CHANGE_ADD_PORT, NULL, HFILL }},
7931 { &hf_rffpcnex_flags_configure_port,
7932 { "Configure port", "spoolss.rffpcnex.flags.configure_port",
7933 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_configure_port),
7934 SPOOLSS_PRINTER_CHANGE_CONFIGURE_PORT, NULL,
7937 { &hf_rffpcnex_flags_delete_port,
7938 { "Delete port", "spoolss.rffpcnex.flags.delete_port",
7939 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_delete_port),
7940 SPOOLSS_PRINTER_CHANGE_DELETE_PORT, NULL,
7943 { &hf_rffpcnex_flags_add_print_processor,
7944 { "Add processor", "spoolss.rffpcnex.flags.add_processor",
7946 TFS(&tfs_rffpcnex_flags_add_print_processor),
7947 SPOOLSS_PRINTER_CHANGE_ADD_PRINT_PROCESSOR,
7950 { &hf_rffpcnex_flags_delete_print_processor,
7951 { "Delete processor",
7952 "spoolss.rffpcnex.flags.delete_processor", FT_BOOLEAN, 32,
7953 TFS(&tfs_rffpcnex_flags_delete_print_processor),
7954 SPOOLSS_PRINTER_CHANGE_DELETE_PRINT_PROCESSOR,
7957 { &hf_rffpcnex_flags_add_driver,
7958 { "Add driver", "spoolss.rffpcnex.flags.add_driver",
7959 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_add_driver),
7960 SPOOLSS_PRINTER_CHANGE_ADD_PRINTER_DRIVER, NULL,
7963 { &hf_rffpcnex_flags_set_driver,
7964 { "Set driver", "spoolss.rffpcnex.flags.set_driver",
7965 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_set_driver),
7966 SPOOLSS_PRINTER_CHANGE_SET_PRINTER_DRIVER, NULL,
7969 { &hf_rffpcnex_flags_delete_driver,
7970 { "Delete driver", "spoolss.rffpcnex.flags.delete_driver",
7971 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_delete_driver),
7972 SPOOLSS_PRINTER_CHANGE_DELETE_PRINTER_DRIVER,
7975 { &hf_rffpcnex_flags_timeout,
7976 { "Timeout", "spoolss.rffpcnex.flags.timeout",
7977 FT_BOOLEAN, 32, TFS(&tfs_rffpcnex_flags_timeout),
7978 SPOOLSS_PRINTER_CHANGE_TIMEOUT, NULL, HFILL }},
7980 { &hf_rffpcnex_flags_failed_printer_connection,
7981 { "Failed printer connection",
7982 "spoolss.rffpcnex.flags.failed_connection_printer",
7984 TFS(&tfs_rffpcnex_flags_failed_connection_printer),
7985 SPOOLSS_PRINTER_CHANGE_FAILED_CONNECTION_PRINTER,
7990 { &hf_rrpcn_changelow,
7991 { "Change low", "spoolss.rrpcn.changelow", FT_UINT32,
7992 BASE_DEC, NULL, 0, NULL, HFILL }},
7994 { &hf_rrpcn_changehigh,
7995 { "Change high", "spoolss.rrpcn.changehigh", FT_UINT32,
7996 BASE_DEC, NULL, 0, NULL, HFILL }},
7999 { "Unknown 0", "spoolss.rrpcn.unk0", FT_UINT32, BASE_DEC,
8000 NULL, 0, NULL, HFILL }},
8003 { "Unknown 1", "spoolss.rrpcn.unk1", FT_UINT32, BASE_DEC,
8004 NULL, 0, NULL, HFILL }},
8006 /* ReplyOpenPrinter RPC */
8008 { &hf_replyopenprinter_unk0,
8009 { "Unknown 0", "spoolss.replyopenprinter.unk0", FT_UINT32,
8010 BASE_DEC, NULL, 0, NULL, HFILL }},
8012 { &hf_replyopenprinter_unk1,
8013 { "Unknown 1", "spoolss.replyopenprinter.unk1", FT_UINT32,
8014 BASE_DEC, NULL, 0, NULL, HFILL }},
8016 /* Printer attributes */
8018 { &hf_printer_attributes,
8019 { "Attributes", "spoolss.printer_attributes", FT_UINT32,
8020 BASE_HEX, NULL, 0, NULL, HFILL }},
8022 { &hf_printer_attributes_queued,
8023 { "Queued", "spoolss.printer_attributes.queued", FT_BOOLEAN,
8024 32, TFS(&tfs_printer_attributes_queued),
8025 PRINTER_ATTRIBUTE_QUEUED, NULL, HFILL }},
8027 { &hf_printer_attributes_direct,
8028 { "Direct", "spoolss.printer_attributes.direct", FT_BOOLEAN,
8029 32, TFS(&tfs_printer_attributes_direct),
8030 PRINTER_ATTRIBUTE_DIRECT, NULL, HFILL }},
8032 { &hf_printer_attributes_default,
8033 { "Default (9x/ME only)",
8034 "spoolss.printer_attributes.default",FT_BOOLEAN,
8035 32, TFS(&tfs_printer_attributes_default),
8036 PRINTER_ATTRIBUTE_DEFAULT, "Default", HFILL }},
8038 { &hf_printer_attributes_shared,
8039 { "Shared", "spoolss.printer_attributes.shared", FT_BOOLEAN,
8040 32, TFS(&tfs_printer_attributes_shared),
8041 PRINTER_ATTRIBUTE_SHARED, NULL, HFILL }},
8043 { &hf_printer_attributes_network,
8044 { "Network", "spoolss.printer_attributes.network",
8045 FT_BOOLEAN, 32, TFS(&tfs_printer_attributes_network),
8046 PRINTER_ATTRIBUTE_NETWORK, NULL, HFILL }},
8048 { &hf_printer_attributes_hidden,
8049 { "Hidden", "spoolss.printer_attributes.hidden", FT_BOOLEAN,
8050 32, TFS(&tfs_printer_attributes_hidden),
8051 PRINTER_ATTRIBUTE_HIDDEN, NULL, HFILL }},
8053 { &hf_printer_attributes_local,
8054 { "Local", "spoolss.printer_attributes.local", FT_BOOLEAN,
8055 32, TFS(&tfs_printer_attributes_local),
8056 PRINTER_ATTRIBUTE_LOCAL, NULL, HFILL }},
8058 { &hf_printer_attributes_enable_devq,
8059 { "Enable devq", "spoolss.printer_attributes.enable_devq",
8060 FT_BOOLEAN, 32, TFS(&tfs_printer_attributes_enable_devq),
8061 PRINTER_ATTRIBUTE_ENABLE_DEVQ, "Enable evq", HFILL }},
8063 { &hf_printer_attributes_keep_printed_jobs,
8064 { "Keep printed jobs",
8065 "spoolss.printer_attributes.keep_printed_jobs", FT_BOOLEAN,
8066 32, TFS(&tfs_printer_attributes_keep_printed_jobs),
8067 PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS, NULL,
8070 { &hf_printer_attributes_do_complete_first,
8071 { "Do complete first",
8072 "spoolss.printer_attributes.do_complete_first", FT_BOOLEAN,
8073 32, TFS(&tfs_printer_attributes_do_complete_first),
8074 PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST, NULL,
8077 { &hf_printer_attributes_work_offline,
8078 { "Work offline (9x/ME only)",
8079 "spoolss.printer_attributes.work_offline", FT_BOOLEAN,
8080 32, TFS(&tfs_printer_attributes_work_offline),
8081 PRINTER_ATTRIBUTE_WORK_OFFLINE, "Work offline", HFILL }},
8083 { &hf_printer_attributes_enable_bidi,
8084 { "Enable bidi (9x/ME only)",
8085 "spoolss.printer_attributes.enable_bidi", FT_BOOLEAN,
8086 32, TFS(&tfs_printer_attributes_enable_bidi),
8087 PRINTER_ATTRIBUTE_ENABLE_BIDI, "Enable bidi", HFILL }},
8089 { &hf_printer_attributes_raw_only,
8090 { "Raw only", "spoolss.printer_attributes.raw_only",
8091 FT_BOOLEAN, 32, TFS(&tfs_printer_attributes_raw_only),
8092 PRINTER_ATTRIBUTE_RAW_ONLY, NULL, HFILL }},
8094 { &hf_printer_attributes_published,
8095 { "Published", "spoolss.printer_attributes.published",
8096 FT_BOOLEAN, 32, TFS(&tfs_printer_attributes_published),
8097 PRINTER_ATTRIBUTE_PUBLISHED, NULL, HFILL }},
8102 { "Year", "spoolss.time.year", FT_UINT32, BASE_DEC,
8103 NULL, 0x0, NULL, HFILL }},
8106 { "Month", "spoolss.time.month", FT_UINT32, BASE_DEC,
8107 NULL, 0x0, NULL, HFILL }},
8110 { "Day of week", "spoolss.time.dow", FT_UINT32, BASE_DEC,
8111 NULL, 0x0, NULL, HFILL }},
8114 { "Day", "spoolss.time.day", FT_UINT32, BASE_DEC,
8115 NULL, 0x0, NULL, HFILL }},
8118 { "Hour", "spoolss.time.hour", FT_UINT32, BASE_DEC,
8119 NULL, 0x0, NULL, HFILL }},
8122 { "Minute", "spoolss.time.minute", FT_UINT32, BASE_DEC,
8123 NULL, 0x0, NULL, HFILL }},
8126 { "Second", "spoolss.time.second", FT_UINT32, BASE_DEC,
8127 NULL, 0x0, NULL, HFILL }},
8130 { "Millisecond", "spoolss.time.msec", FT_UINT32, BASE_DEC,
8131 NULL, 0x0, NULL, HFILL }},
8135 { &hf_userlevel_size,
8136 { "Size", "spoolss.userlevel.size",
8137 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8139 { &hf_userlevel_client,
8140 { "Client", "spoolss.userlevel.client", FT_STRING,
8141 BASE_NONE, NULL, 0, NULL, HFILL }},
8143 { &hf_userlevel_user,
8144 { "User", "spoolss.userlevel.user", FT_STRING,
8145 BASE_NONE, NULL, 0, NULL, HFILL }},
8147 { &hf_userlevel_build,
8148 { "Build", "spoolss.userlevel.build",
8149 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8151 { &hf_userlevel_major,
8152 { "Major", "spoolss.userlevel.major",
8153 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8155 { &hf_userlevel_minor,
8156 { "Minor", "spoolss.userlevel.minor",
8157 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8159 { &hf_userlevel_processor,
8160 { "Processor", "spoolss.userlevel.processor",
8161 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8163 /* EnumprinterdataEx RPC */
8165 { &hf_enumprinterdataex_num_values,
8166 { "Num values", "spoolss.enumprinterdataex.num_values",
8167 FT_UINT32, BASE_DEC, NULL, 0x0,
8168 "Number of values returned", HFILL }},
8170 { &hf_enumprinterdataex_name_offset,
8171 { "Name offset", "spoolss.enumprinterdataex.name_offset",
8172 FT_UINT32, BASE_DEC, NULL, 0x0,
8175 { &hf_enumprinterdataex_name_len,
8176 { "Name len", "spoolss.enumprinterdataex.name_len",
8177 FT_UINT32, BASE_DEC, NULL, 0x0,
8180 { &hf_enumprinterdataex_name,
8181 { "Name", "spoolss.enumprinterdataex.name",
8182 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
8184 { &hf_enumprinterdataex_val_type,
8185 { "Value type", "spoolss.enumprinterdataex.value_type",
8186 FT_UINT32, BASE_DEC, NULL, 0x0,
8189 { &hf_enumprinterdataex_val_offset,
8190 { "Value offset", "spoolss.enumprinterdataex.value_offset",
8191 FT_UINT32, BASE_DEC, NULL, 0x0,
8194 { &hf_enumprinterdataex_val_len,
8195 { "Value len", "spoolss.enumprinterdataex.value_len",
8196 FT_UINT32, BASE_DEC, NULL, 0x0,
8199 { &hf_enumprinterdataex_val_dword_high,
8200 { "DWORD value (high)",
8201 "spoolss.enumprinterdataex.val_dword.high",
8202 FT_UINT16, BASE_DEC, NULL, 0x0,
8205 { &hf_enumprinterdataex_val_dword_low,
8206 { "DWORD value (low)",
8207 "spoolss.enumprinterdataex.val_dword.low",
8208 FT_UINT16, BASE_DEC, NULL, 0x0,
8211 { &hf_enumprinterdataex_val_sz,
8212 { "SZ value", "spoolss.printerdata.val_sz",
8213 FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
8215 /* RouterReplyPrinter RPC */
8217 { &hf_routerreplyprinter_condition,
8218 { "Condition", "spoolss.routerreplyprinter.condition",
8219 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8221 { &hf_routerreplyprinter_unknown1,
8222 { "Unknown1", "spoolss.routerreplyprinter.unknown1",
8223 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8225 { &hf_routerreplyprinter_changeid,
8226 { "Change id", "spoolss.routerreplyprinter.changeid",
8227 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8229 /* EnumPrinterKey RPC */
8231 { &hf_keybuffer_size,
8232 { "Key Buffer size", "spoolss.keybuffer.size", FT_UINT32,
8233 BASE_DEC, NULL, 0x0, "Size of buffer", HFILL }},
8235 { &hf_keybuffer_data,
8236 { "Key Buffer data", "spoolss.keybuffer.data", FT_BYTES,
8237 BASE_NONE, NULL, 0x0, "Contents of buffer", HFILL }},
8242 { "Set job command", "spoolss.setjob.cmd", FT_UINT32,
8243 BASE_DEC, VALS(setjob_commands), 0x0, "Printer data name",
8248 { &hf_enumjobs_firstjob,
8249 { "First job", "spoolss.enumjobs.firstjob", FT_UINT32,
8250 BASE_DEC, NULL, 0x0, "Index of first job to return",
8253 { &hf_enumjobs_numjobs,
8254 { "Num jobs", "spoolss.enumjobs.numjobs", FT_UINT32,
8255 BASE_DEC, NULL, 0x0, "Number of jobs to return", HFILL }},
8257 /* Security descriptor buffer */
8259 { &hf_secdescbuf_maxlen,
8260 { "Max len", "secdescbuf.max_len",
8261 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8263 { &hf_secdescbuf_undoc,
8264 { "Undocumented", "secdescbuf.undoc",
8265 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8267 { &hf_secdescbuf_len,
8268 { "Length", "secdescbuf.len",
8269 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8271 /* Spool printer info */
8273 { &hf_spool_printer_info_devmode_ptr,
8274 { "Devmode pointer", "spoolprinterinfo.devmode_ptr",
8275 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8277 { &hf_spool_printer_info_secdesc_ptr,
8278 { "Secdesc pointer", "spoolprinterinfo.secdesc_ptr",
8279 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8281 /* WritePrinter RPC */
8283 { &hf_writeprinter_numwritten,
8284 { "Num written", "spoolss.writeprinter.numwritten",
8285 FT_UINT32, BASE_DEC, NULL, 0x0, "Number of bytes written",
8288 /* Setprinterdataex RPC */
8290 { &hf_setprinterdataex_max_len,
8291 { "Max len", "setprinterdataex.max_len",
8292 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8294 { &hf_setprinterdataex_real_len,
8295 { "Real len", "setprinterdataex.real_len",
8296 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8298 { &hf_setprinterdataex_data,
8299 { "Data", "setprinterdataex.data",
8300 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
8302 /* Specific access rights */
8304 { &hf_access_required,
8305 { "Access required", "spoolss.access_required",
8306 FT_UINT32, BASE_HEX, NULL, 0x0, NULL,
8309 { &hf_server_access_admin,
8310 { "Server admin", "spoolss.access_mask.server_admin",
8311 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
8312 SERVER_ACCESS_ADMINISTER, NULL, HFILL }},
8314 { &hf_server_access_enum,
8315 { "Server enum", "spoolss.access_mask.server_enum",
8316 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
8317 SERVER_ACCESS_ENUMERATE, NULL, HFILL }},
8319 { &hf_printer_access_admin,
8320 { "Printer admin", "spoolss.access_mask.printer_admin",
8321 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
8322 PRINTER_ACCESS_ADMINISTER, NULL, HFILL }},
8324 { &hf_printer_access_use,
8325 { "Printer use", "spoolss.access_mask.printer_use",
8326 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
8327 PRINTER_ACCESS_USE, NULL, HFILL }},
8329 { &hf_job_access_admin,
8330 { "Job admin", "spoolss.access_mask.job_admin",
8331 FT_BOOLEAN, 32, TFS(&tfs_set_notset),
8332 JOB_ACCESS_ADMINISTER, NULL, HFILL }},
8334 /* Printer information */
8336 { &hf_printer_cjobs,
8337 { "CJobs", "spoolss.printer.cjobs", FT_UINT32,
8338 BASE_DEC, NULL, 0, NULL, HFILL }},
8340 { &hf_printer_total_jobs,
8341 { "Total jobs", "spoolss.printer.total_jobs", FT_UINT32,
8342 BASE_DEC, NULL, 0, NULL, HFILL }},
8344 { &hf_printer_total_bytes,
8345 { "Total bytes", "spoolss.printer.total_bytes", FT_UINT32,
8346 BASE_DEC, NULL, 0, NULL, HFILL }},
8348 { &hf_printer_global_counter,
8349 { "Global counter", "spoolss.printer.global_counter",
8350 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8352 { &hf_printer_total_pages,
8353 { "Total pages", "spoolss.printer.total_pages", FT_UINT32,
8354 BASE_DEC, NULL, 0, NULL, HFILL }},
8356 { &hf_printer_major_version,
8357 { "Major version", "spoolss.printer.major_version",
8358 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8360 { &hf_printer_build_version,
8361 { "Build version", "spoolss.printer.build_version",
8362 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8365 { "Unknown 7", "spoolss.printer.unknown7", FT_UINT32,
8366 BASE_DEC, NULL, 0, NULL, HFILL }},
8369 { "Unknown 8", "spoolss.printer.unknown8", FT_UINT32,
8370 BASE_DEC, NULL, 0, NULL, HFILL }},
8373 { "Unknown 9", "spoolss.printer.unknown9", FT_UINT32,
8374 BASE_DEC, NULL, 0, NULL, HFILL }},
8376 { &hf_printer_session_ctr,
8377 { "Session counter", "spoolss.printer.session_ctr",
8378 FT_UINT32, BASE_DEC, NULL, 0, "Sessopm counter", HFILL }},
8380 { &hf_printer_unk11,
8381 { "Unknown 11", "spoolss.printer.unknown11", FT_UINT32,
8382 BASE_DEC, NULL, 0, NULL, HFILL }},
8384 { &hf_printer_printer_errors,
8385 { "Printer errors", "spoolss.printer.printer_errors",
8386 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8388 { &hf_printer_unk13,
8389 { "Unknown 13", "spoolss.printer.unknown13", FT_UINT32,
8390 BASE_DEC, NULL, 0, NULL, HFILL }},
8392 { &hf_printer_unk14,
8393 { "Unknown 14", "spoolss.printer.unknown14", FT_UINT32,
8394 BASE_DEC, NULL, 0, NULL, HFILL }},
8396 { &hf_printer_unk15,
8397 { "Unknown 15", "spoolss.printer.unknown15", FT_UINT32,
8398 BASE_DEC, NULL, 0, NULL, HFILL }},
8400 { &hf_printer_unk16,
8401 { "Unknown 16", "spoolss.printer.unknown16", FT_UINT32,
8402 BASE_DEC, NULL, 0, NULL, HFILL }},
8404 { &hf_printer_changeid,
8405 { "Change id", "spoolss.printer.changeid", FT_UINT32,
8406 BASE_DEC, NULL, 0, NULL, HFILL }},
8408 { &hf_printer_unk18,
8409 { "Unknown 18", "spoolss.printer.unknown18", FT_UINT32,
8410 BASE_DEC, NULL, 0, NULL, HFILL }},
8412 { &hf_printer_unk20,
8413 { "Unknown 20", "spoolss.printer.unknown20", FT_UINT32,
8414 BASE_DEC, NULL, 0, NULL, HFILL }},
8416 { &hf_printer_c_setprinter,
8417 { "Csetprinter", "spoolss.printer.c_setprinter",
8418 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8420 { &hf_printer_unk22,
8421 { "Unknown 22", "spoolss.printer.unknown22",
8422 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8424 { &hf_printer_unk23,
8425 { "Unknown 23", "spoolss.printer.unknown23",
8426 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8428 { &hf_printer_unk24,
8429 { "Unknown 24", "spoolss.printer.unknown24",
8430 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8432 { &hf_printer_unk25,
8433 { "Unknown 25", "spoolss.printer.unknown25",
8434 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8436 { &hf_printer_unk26,
8437 { "Unknown 26", "spoolss.printer.unknown26",
8438 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8440 { &hf_printer_unk27,
8441 { "Unknown 27", "spoolss.printer.unknown27",
8442 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8444 { &hf_printer_unk28,
8445 { "Unknown 28", "spoolss.printer.unknown28",
8446 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8448 { &hf_printer_unk29,
8449 { "Unknown 29", "spoolss.printer.unknown29",
8450 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8452 { &hf_printer_flags,
8453 { "Flags", "spoolss.printer.flags",
8454 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8456 { &hf_printer_priority,
8457 { "Priority", "spoolss.printer.priority",
8458 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8460 { &hf_printer_default_priority,
8461 { "Default Priority", "spoolss.printer.default_priority",
8462 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8464 { &hf_printer_averageppm,
8465 { "Average PPM", "spoolss.printer.averageppm",
8466 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8469 { "Jobs", "spoolss.printer.jobs",
8470 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8473 { "GUID", "spoolss.printer.guid", FT_STRING,
8474 BASE_NONE, NULL, 0, NULL, HFILL }},
8476 { &hf_printer_action,
8477 { "Action", "spoolss.printer.action", FT_UINT32, BASE_DEC,
8478 VALS(getprinter_action_vals), 0, NULL, HFILL }},
8481 static gint *ett[] = {
8482 &ett_dcerpc_spoolss,
8483 &ett_PRINTER_DATATYPE,
8486 &ett_DEVMODE_fields,
8487 &ett_USER_LEVEL_CTR,
8491 &ett_SPOOL_PRINTER_INFO_LEVEL,
8492 &ett_PRINTER_INFO_0,
8493 &ett_PRINTER_INFO_1,
8494 &ett_PRINTER_INFO_2,
8495 &ett_PRINTER_INFO_3,
8496 &ett_PRINTER_INFO_7,
8509 &ett_printerdata_value,
8510 &ett_printerdata_data,
8511 &ett_writeprinter_buffer,
8516 &ett_DRIVER_INFO_101,
8517 &ett_rffpcnex_flags,
8518 &ett_notify_options_flags,
8519 &ett_NOTIFY_INFO_DATA,
8521 &ett_printer_attributes,
8523 &ett_enumprinters_flags,
8524 &ett_PRINTER_DATA_CTR,
8525 &ett_printer_enumdataex_value,
8528 proto_dcerpc_spoolss = proto_register_protocol(
8529 "Microsoft Spool Subsystem", "SPOOLSS", "spoolss");
8531 proto_register_field_array(proto_dcerpc_spoolss, hf, array_length(hf));
8533 proto_register_subtree_array(ett, array_length(ett));
8536 /* Protocol handoff */
8538 static e_uuid_t uuid_dcerpc_spoolss = {
8539 0x12345678, 0x1234, 0xabcd,
8540 { 0xef, 0x00, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab }
8543 static guint16 ver_dcerpc_spoolss = 1;
8546 proto_reg_handoff_dcerpc_spoolss(void)
8549 /* Register protocol as dcerpc */
8551 dcerpc_init_uuid(proto_dcerpc_spoolss, ett_dcerpc_spoolss,
8552 &uuid_dcerpc_spoolss, ver_dcerpc_spoolss,
8553 dcerpc_spoolss_dissectors, hf_opnum);