1 /* packet-dcerpc-spoolss.h
2 * Routines for SMB \PIPE\spoolss packet disassembly
3 * Copyright 2001, Tim Potter <tpot@samba.org>
5 * $Id: packet-dcerpc-spoolss.h,v 1.9 2002/06/17 06:45:42 tpot Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 #ifndef __PACKET_DCERPC_SPOOLSS_H
27 #define __PACKET_DCERPC_SPOOLSS_H
29 /* Functions available on the SPOOLSS pipe. From Samba,
30 include/rpc_spoolss.h */
32 #define SPOOLSS_ENUMPRINTERS 0x00
33 #define SPOOLSS_OPENPRINTER 0x01
34 #define SPOOLSS_SETJOB 0x02
35 #define SPOOLSS_GETJOB 0x03
36 #define SPOOLSS_ENUMJOBS 0x04
37 #define SPOOLSS_ADDPRINTER 0x05
38 #define SPOOLSS_DELETEPRINTER 0x06
39 #define SPOOLSS_SETPRINTER 0x07
40 #define SPOOLSS_GETPRINTER 0x08
41 #define SPOOLSS_ADDPRINTERDRIVER 0x09
42 #define SPOOLSS_ENUMPRINTERDRIVERS 0x0a
43 #define SPOOLSS_GETPRINTERDRIVER 0x0b
44 #define SPOOLSS_GETPRINTERDRIVERDIRECTORY 0x0c
45 #define SPOOLSS_DELETEPRINTERDRIVER 0x0d
46 #define SPOOLSS_ADDPRINTPROCESSOR 0x0e
47 #define SPOOLSS_ENUMPRINTPROCESSORS 0x0f
48 #define SPOOLSS_GETPRINTPROCESSORDIRECTORY 0x10
49 #define SPOOLSS_STARTDOCPRINTER 0x11
50 #define SPOOLSS_STARTPAGEPRINTER 0x12
51 #define SPOOLSS_WRITEPRINTER 0x13
52 #define SPOOLSS_ENDPAGEPRINTER 0x14
53 #define SPOOLSS_ABORTPRINTER 0x15
54 #define SPOOLSS_READPRINTER 0x16
55 #define SPOOLSS_ENDDOCPRINTER 0x17
56 #define SPOOLSS_ADDJOB 0x18
57 #define SPOOLSS_SCHEDULEJOB 0x19
58 #define SPOOLSS_GETPRINTERDATA 0x1a
59 #define SPOOLSS_SETPRINTERDATA 0x1b
60 #define SPOOLSS_WAITFORPRINTERCHANGE 0x1c
61 #define SPOOLSS_CLOSEPRINTER 0x1d
62 #define SPOOLSS_ADDFORM 0x1e
63 #define SPOOLSS_DELETEFORM 0x1f
64 #define SPOOLSS_GETFORM 0x20
65 #define SPOOLSS_SETFORM 0x21
66 #define SPOOLSS_ENUMFORMS 0x22
67 #define SPOOLSS_ENUMPORTS 0x23
68 #define SPOOLSS_ENUMMONITORS 0x24
69 #define SPOOLSS_ADDPORT 0x25
70 #define SPOOLSS_CONFIGUREPORT 0x26
71 #define SPOOLSS_DELETEPORT 0x27
72 #define SPOOLSS_CREATEPRINTERIC 0x28
73 #define SPOOLSS_PLAYGDISCRIPTONPRINTERIC 0x29
74 #define SPOOLSS_DELETEPRINTERIC 0x2a
75 #define SPOOLSS_ADDPRINTERCONNECTION 0x2b
76 #define SPOOLSS_DELETEPRINTERCONNECTION 0x2c
77 #define SPOOLSS_PRINTERMESSAGEBOX 0x2d
78 #define SPOOLSS_ADDMONITOR 0x2e
79 #define SPOOLSS_DELETEMONITOR 0x2f
80 #define SPOOLSS_DELETEPRINTPROCESSOR 0x30
81 #define SPOOLSS_ADDPRINTPROVIDER 0x31
82 #define SPOOLSS_DELETEPRINTPROVIDER 0x32
83 #define SPOOLSS_ENUMPRINTPROCDATATYPES 0x33
84 #define SPOOLSS_RESETPRINTER 0x34
85 #define SPOOLSS_GETPRINTERDRIVER2 0x35
86 #define SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION 0x36
87 #define SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION 0x37
88 #define SPOOLSS_FCPN 0x38
89 #define SPOOLSS_ROUTERFINDFIRSTPRINTERNOTIFICATIONOLD 0x39
90 #define SPOOLSS_REPLYOPENPRINTER 0x3a
91 #define SPOOLSS_ROUTERREPLYPRINTER 0x3b
92 #define SPOOLSS_REPLYCLOSEPRINTER 0x3c
93 #define SPOOLSS_ADDPORTEX 0x3d
94 #define SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFICATION 0x3e
95 #define SPOOLSS_SPOOLERINIT 0x3f
96 #define SPOOLSS_RESETPRINTEREX 0x40
97 #define SPOOLSS_RFFPCNEX 0x41
98 #define SPOOLSS_RRPCN 0x42
99 #define SPOOLSS_RFNPCNEX 0x43
100 #define SPOOLSS_OPENPRINTEREX 0x45
101 #define SPOOLSS_ADDPRINTEREX 0x46
102 #define SPOOLSS_ENUMPRINTERDATA 0x48
103 #define SPOOLSS_DELETEPRINTERDATA 0x49
104 #define SPOOLSS_SETPRINTERDATAEX 0x4d
105 #define SPOOLSS_GETPRINTERDATAEX 0x4e
106 #define SPOOLSS_ENUMPRINTERDATAEX 0x4f
107 #define SPOOLSS_ENUMPRINTERKEY 0x50
108 #define SPOOLSS_DELETEPRINTERDATAEX 0x51
109 #define SPOOLSS_DELETEPRINTERDRIVEREX 0x54
110 #define SPOOLSS_ADDPRINTERDRIVEREX 0x59
115 #define FORM_BUILTIN 1
116 #define FORM_PRINTER 2
118 /* Printer change notification flags */
120 #define PRINTER_CHANGE_ADD_PRINTER 0x00000001
121 #define PRINTER_CHANGE_SET_PRINTER 0x00000002
122 #define PRINTER_CHANGE_DELETE_PRINTER 0x00000004
123 #define PRINTER_CHANGE_FAILED_CONNECTION_PRINTER 0x00000008
124 #define PRINTER_CHANGE_PRINTER (PRINTER_CHANGE_ADD_PRINTER | \
125 PRINTER_CHANGE_SET_PRINTER | \
126 PRINTER_CHANGE_DELETE_PRINTER | \
127 PRINTER_CHANGE_FAILED_CONNECTION_PRINTER )
128 #define PRINTER_CHANGE_ADD_JOB 0x00000100
129 #define PRINTER_CHANGE_SET_JOB 0x00000200
130 #define PRINTER_CHANGE_DELETE_JOB 0x00000400
131 #define PRINTER_CHANGE_WRITE_JOB 0x00000800
132 #define PRINTER_CHANGE_JOB (PRINTER_CHANGE_ADD_JOB | \
133 PRINTER_CHANGE_SET_JOB | \
134 PRINTER_CHANGE_DELETE_JOB | \
135 PRINTER_CHANGE_WRITE_JOB )
136 #define PRINTER_CHANGE_ADD_FORM 0x00010000
137 #define PRINTER_CHANGE_SET_FORM 0x00020000
138 #define PRINTER_CHANGE_DELETE_FORM 0x00040000
139 #define PRINTER_CHANGE_FORM (PRINTER_CHANGE_ADD_FORM | \
140 PRINTER_CHANGE_SET_FORM | \
141 PRINTER_CHANGE_DELETE_FORM )
143 #define PRINTER_CHANGE_ADD_PORT 0x00100000
144 #define PRINTER_CHANGE_CONFIGURE_PORT 0x00200000
145 #define PRINTER_CHANGE_DELETE_PORT 0x00400000
146 #define PRINTER_CHANGE_PORT (PRINTER_CHANGE_ADD_PORT | \
147 PRINTER_CHANGE_CONFIGURE_PORT | \
148 PRINTER_CHANGE_DELETE_PORT )
150 #define PRINTER_CHANGE_ADD_PRINT_PROCESSOR 0x01000000
151 #define PRINTER_CHANGE_DELETE_PRINT_PROCESSOR 0x04000000
152 #define PRINTER_CHANGE_PRINT_PROCESSOR (PRINTER_CHANGE_ADD_PRINT_PROCESSOR | \
153 PRINTER_CHANGE_DELETE_PRINT_PROCESSOR )
155 #define PRINTER_CHANGE_ADD_PRINTER_DRIVER 0x10000000
156 #define PRINTER_CHANGE_SET_PRINTER_DRIVER 0x20000000
157 #define PRINTER_CHANGE_DELETE_PRINTER_DRIVER 0x40000000
158 #define PRINTER_CHANGE_PRINTER_DRIVER (PRINTER_CHANGE_ADD_PRINTER_DRIVER | \
159 PRINTER_CHANGE_SET_PRINTER_DRIVER | \
160 PRINTER_CHANGE_DELETE_PRINTER_DRIVER )
162 #define PRINTER_CHANGE_TIMEOUT 0x80000000
163 #define PRINTER_CHANGE_ALL (PRINTER_CHANGE_JOB | \
164 PRINTER_CHANGE_FORM | \
165 PRINTER_CHANGE_PORT | \
166 PRINTER_CHANGE_PRINT_PROCESSOR | \
167 PRINTER_CHANGE_PRINTER_DRIVER )
169 /* Printer notify option types */
171 #define PRINTER_NOTIFY_TYPE 0x00
172 #define JOB_NOTIFY_TYPE 0x01
174 /* Printer notify option flags */
176 #define PRINTER_NOTIFY_OPTIONS_REFRESH 0x01
178 /* Printer notify options */
180 #define PRINTER_NOTIFY_SERVER_NAME 0x00
181 #define PRINTER_NOTIFY_PRINTER_NAME 0x01
182 #define PRINTER_NOTIFY_SHARE_NAME 0x02
183 #define PRINTER_NOTIFY_PORT_NAME 0x03
184 #define PRINTER_NOTIFY_DRIVER_NAME 0x04
185 #define PRINTER_NOTIFY_COMMENT 0x05
186 #define PRINTER_NOTIFY_LOCATION 0x06
187 #define PRINTER_NOTIFY_DEVMODE 0x07
188 #define PRINTER_NOTIFY_SEPFILE 0x08
189 #define PRINTER_NOTIFY_PRINT_PROCESSOR 0x09
190 #define PRINTER_NOTIFY_PARAMETERS 0x0A
191 #define PRINTER_NOTIFY_DATATYPE 0x0B
192 #define PRINTER_NOTIFY_SECURITY_DESCRIPTOR 0x0C
193 #define PRINTER_NOTIFY_ATTRIBUTES 0x0D
194 #define PRINTER_NOTIFY_PRIORITY 0x0E
195 #define PRINTER_NOTIFY_DEFAULT_PRIORITY 0x0F
196 #define PRINTER_NOTIFY_START_TIME 0x10
197 #define PRINTER_NOTIFY_UNTIL_TIME 0x11
198 #define PRINTER_NOTIFY_STATUS 0x12
199 #define PRINTER_NOTIFY_STATUS_STRING 0x13
200 #define PRINTER_NOTIFY_CJOBS 0x14
201 #define PRINTER_NOTIFY_AVERAGE_PPM 0x15
202 #define PRINTER_NOTIFY_TOTAL_PAGES 0x16
203 #define PRINTER_NOTIFY_PAGES_PRINTED 0x17
204 #define PRINTER_NOTIFY_TOTAL_BYTES 0x18
205 #define PRINTER_NOTIFY_BYTES_PRINTED 0x19
207 /* Job notify options */
209 #define JOB_NOTIFY_PRINTER_NAME 0x00
210 #define JOB_NOTIFY_MACHINE_NAME 0x01
211 #define JOB_NOTIFY_PORT_NAME 0x02
212 #define JOB_NOTIFY_USER_NAME 0x03
213 #define JOB_NOTIFY_NOTIFY_NAME 0x04
214 #define JOB_NOTIFY_DATATYPE 0x05
215 #define JOB_NOTIFY_PRINT_PROCESSOR 0x06
216 #define JOB_NOTIFY_PARAMETERS 0x07
217 #define JOB_NOTIFY_DRIVER_NAME 0x08
218 #define JOB_NOTIFY_DEVMODE 0x09
219 #define JOB_NOTIFY_STATUS 0x0A
220 #define JOB_NOTIFY_STATUS_STRING 0x0B
221 #define JOB_NOTIFY_SECURITY_DESCRIPTOR 0x0C
222 #define JOB_NOTIFY_DOCUMENT 0x0D
223 #define JOB_NOTIFY_PRIORITY 0x0E
224 #define JOB_NOTIFY_POSITION 0x0F
225 #define JOB_NOTIFY_SUBMITTED 0x10
226 #define JOB_NOTIFY_START_TIME 0x11
227 #define JOB_NOTIFY_UNTIL_TIME 0x12
228 #define JOB_NOTIFY_TIME 0x13
229 #define JOB_NOTIFY_TOTAL_PAGES 0x14
230 #define JOB_NOTIFY_PAGES_PRINTED 0x15
231 #define JOB_NOTIFY_TOTAL_BYTES 0x16
232 #define JOB_NOTIFY_BYTES_PRINTED 0x17
234 /* Printer status codes */
236 #define PRINTER_STATUS_OK 0x00000000
237 #define PRINTER_STATUS_PAUSED 0x00000001
238 #define PRINTER_STATUS_ERROR 0x00000002
239 #define PRINTER_STATUS_PENDING_DELETION 0x00000004
240 #define PRINTER_STATUS_PAPER_JAM 0x00000008
241 #define PRINTER_STATUS_PAPER_OUT 0x00000010
242 #define PRINTER_STATUS_MANUAL_FEED 0x00000020
243 #define PRINTER_STATUS_PAPER_PROBLEM 0x00000040
244 #define PRINTER_STATUS_OFFLINE 0x00000080
245 #define PRINTER_STATUS_IO_ACTIVE 0x00000100
246 #define PRINTER_STATUS_BUSY 0x00000200
247 #define PRINTER_STATUS_PRINTING 0x00000400
248 #define PRINTER_STATUS_OUTPUT_BIN_FULL 0x00000800
249 #define PRINTER_STATUS_NOT_AVAILABLE 0x00001000
250 #define PRINTER_STATUS_WAITING 0x00002000
251 #define PRINTER_STATUS_PROCESSING 0x00004000
252 #define PRINTER_STATUS_INITIALIZING 0x00008000
253 #define PRINTER_STATUS_WARMING_UP 0x00010000
254 #define PRINTER_STATUS_TONER_LOW 0x00020000
255 #define PRINTER_STATUS_NO_TONER 0x00040000
256 #define PRINTER_STATUS_PAGE_PUNT 0x00080000
257 #define PRINTER_STATUS_USER_INTERVENTION 0x00100000
258 #define PRINTER_STATUS_OUT_OF_MEMORY 0x00200000
259 #define PRINTER_STATUS_DOOR_OPEN 0x00400000
260 #define PRINTER_STATUS_SERVER_UNKNOWN 0x00800000
261 #define PRINTER_STATUS_POWER_SAVE 0x01000000
263 /* Job status codes */
265 #define JOB_STATUS_PAUSED 0x00000001
266 #define JOB_STATUS_ERROR 0x00000002
267 #define JOB_STATUS_DELETING 0x00000004
268 #define JOB_STATUS_SPOOLING 0x00000008
269 #define JOB_STATUS_PRINTING 0x00000010
270 #define JOB_STATUS_OFFLINE 0x00000020
271 #define JOB_STATUS_PAPEROUT 0x00000040
272 #define JOB_STATUS_PRINTED 0x00000080
273 #define JOB_STATUS_DELETED 0x00000100
274 #define JOB_STATUS_BLOCKED 0x00000200
275 #define JOB_STATUS_USER_INTERVENTION 0x00000400
277 /* Printer attributes */
279 #define PRINTER_ATTRIBUTE_QUEUED 0x00000001
280 #define PRINTER_ATTRIBUTE_DIRECT 0x00000002
281 #define PRINTER_ATTRIBUTE_DEFAULT 0x00000004
282 #define PRINTER_ATTRIBUTE_SHARED 0x00000008
283 #define PRINTER_ATTRIBUTE_NETWORK 0x00000010
284 #define PRINTER_ATTRIBUTE_HIDDEN 0x00000020
285 #define PRINTER_ATTRIBUTE_LOCAL 0x00000040
286 #define PRINTER_ATTRIBUTE_ENABLE_DEVQ 0x00000080
287 #define PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS 0x00000100
288 #define PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST 0x00000200
289 #define PRINTER_ATTRIBUTE_WORK_OFFLINE 0x00000400
290 #define PRINTER_ATTRIBUTE_ENABLE_BIDI 0x00000800
291 #define PRINTER_ATTRIBUTE_RAW_ONLY 0x00001000
292 #define PRINTER_ATTRIBUTE_PUBLISHED 0x00002000
295 #endif /* packet-dcerpc-spoolss.h */