~vcs-imports/samba/main

« back to all changes in this revision

Viewing changes to source/include/rpc_spoolss.h

  • Committer: jerry
  • Date: 2006-07-14 21:48:39 UTC
  • Revision ID: vcs-imports@canonical.com-20060714214839-586d8c489a8fcead
gutting trunk to move to svn:externals

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 
2
 
   Unix SMB/Netbios implementation.
3
 
 
4
 
   Copyright (C) Andrew Tridgell              1992-2000,
5
 
   Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
6
 
   Copyright (C) Jean Francois Micouleau      1998-2000.
7
 
   Copyright (C) Gerald Carter                2001-2006.
8
 
   
9
 
   This program is free software; you can redistribute it and/or modify
10
 
   it under the terms of the GNU General Public License as published by
11
 
   the Free Software Foundation; either version 2 of the License, or
12
 
   (at your option) any later version.
13
 
   
14
 
   This program is distributed in the hope that it will be useful,
15
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 
   GNU General Public License for more details.
18
 
   
19
 
   You should have received a copy of the GNU General Public License
20
 
   along with this program; if not, write to the Free Software
21
 
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
 
*/
23
 
 
24
 
#ifndef _RPC_SPOOLSS_H          /* _RPC_SPOOLSS_H */
25
 
#define _RPC_SPOOLSS_H
26
 
 
27
 
/* spoolss pipe: this are the calls which are not implemented ...
28
 
#define SPOOLSS_GETPRINTERDRIVER                        0x0b
29
 
#define SPOOLSS_READPRINTER                             0x16
30
 
#define SPOOLSS_WAITFORPRINTERCHANGE                    0x1c
31
 
#define SPOOLSS_ADDPORT                                 0x25
32
 
#define SPOOLSS_CONFIGUREPORT                           0x26
33
 
#define SPOOLSS_DELETEPORT                              0x27
34
 
#define SPOOLSS_CREATEPRINTERIC                         0x28
35
 
#define SPOOLSS_PLAYGDISCRIPTONPRINTERIC                0x29
36
 
#define SPOOLSS_DELETEPRINTERIC                         0x2a
37
 
#define SPOOLSS_ADDPRINTERCONNECTION                    0x2b
38
 
#define SPOOLSS_DELETEPRINTERCONNECTION                 0x2c
39
 
#define SPOOLSS_PRINTERMESSAGEBOX                       0x2d
40
 
#define SPOOLSS_ADDMONITOR                              0x2e
41
 
#define SPOOLSS_DELETEMONITOR                           0x2f
42
 
#define SPOOLSS_DELETEPRINTPROCESSOR                    0x30
43
 
#define SPOOLSS_ADDPRINTPROVIDOR                        0x31
44
 
#define SPOOLSS_DELETEPRINTPROVIDOR                     0x32
45
 
#define SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION      0x36
46
 
#define SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION       0x37
47
 
#define SPOOLSS_ROUTERFINDFIRSTPRINTERNOTIFICATIONOLD   0x39
48
 
#define SPOOLSS_ADDPORTEX                               0x3d
49
 
#define SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFICATION0x3e
50
 
#define SPOOLSS_SPOOLERINIT                             0x3f
51
 
#define SPOOLSS_RESETPRINTEREX                          0x40
52
 
*/
53
 
 
54
 
/* those are implemented */
55
 
#define SPOOLSS_ENUMPRINTERS                            0x00
56
 
#define SPOOLSS_OPENPRINTER                             0x01
57
 
#define SPOOLSS_SETJOB                                  0x02
58
 
#define SPOOLSS_GETJOB                                  0x03
59
 
#define SPOOLSS_ENUMJOBS                                0x04
60
 
#define SPOOLSS_ADDPRINTER                              0x05
61
 
#define SPOOLSS_DELETEPRINTER                           0x06
62
 
#define SPOOLSS_SETPRINTER                              0x07
63
 
#define SPOOLSS_GETPRINTER                              0x08
64
 
#define SPOOLSS_ADDPRINTERDRIVER                        0x09
65
 
#define SPOOLSS_ENUMPRINTERDRIVERS                      0x0a
66
 
#define SPOOLSS_GETPRINTERDRIVERDIRECTORY               0x0c
67
 
#define SPOOLSS_DELETEPRINTERDRIVER                     0x0d
68
 
#define SPOOLSS_ADDPRINTPROCESSOR                       0x0e
69
 
#define SPOOLSS_ENUMPRINTPROCESSORS                     0x0f
70
 
#define SPOOLSS_GETPRINTPROCESSORDIRECTORY              0x10
71
 
#define SPOOLSS_STARTDOCPRINTER                         0x11
72
 
#define SPOOLSS_STARTPAGEPRINTER                        0x12
73
 
#define SPOOLSS_WRITEPRINTER                            0x13
74
 
#define SPOOLSS_ENDPAGEPRINTER                          0x14
75
 
#define SPOOLSS_ABORTPRINTER                            0x15
76
 
#define SPOOLSS_ENDDOCPRINTER                           0x17
77
 
#define SPOOLSS_ADDJOB                                  0x18
78
 
#define SPOOLSS_SCHEDULEJOB                             0x19
79
 
#define SPOOLSS_GETPRINTERDATA                          0x1a
80
 
#define SPOOLSS_SETPRINTERDATA                          0x1b
81
 
#define SPOOLSS_CLOSEPRINTER                            0x1d
82
 
#define SPOOLSS_ADDFORM                                 0x1e
83
 
#define SPOOLSS_DELETEFORM                              0x1f
84
 
#define SPOOLSS_GETFORM                                 0x20
85
 
#define SPOOLSS_SETFORM                                 0x21
86
 
#define SPOOLSS_ENUMFORMS                               0x22
87
 
#define SPOOLSS_ENUMPORTS                               0x23
88
 
#define SPOOLSS_ENUMMONITORS                            0x24
89
 
#define SPOOLSS_ENUMPRINTPROCDATATYPES                  0x33
90
 
#define SPOOLSS_RESETPRINTER                            0x34
91
 
#define SPOOLSS_GETPRINTERDRIVER2                       0x35
92
 
#define SPOOLSS_FCPN                                    0x38    /* FindClosePrinterNotify */
93
 
#define SPOOLSS_REPLYOPENPRINTER                        0x3a
94
 
#define SPOOLSS_ROUTERREPLYPRINTER                      0x3b
95
 
#define SPOOLSS_REPLYCLOSEPRINTER                       0x3c
96
 
#define SPOOLSS_RFFPCNEX                                0x41    /* RemoteFindFirstPrinterChangeNotifyEx */
97
 
#define SPOOLSS_RRPCN                                   0x42    /* RouteRefreshPrinterChangeNotification */
98
 
#define SPOOLSS_RFNPCNEX                                0x43    /* RemoteFindNextPrinterChangeNotifyEx */
99
 
#define SPOOLSS_OPENPRINTEREX                           0x45
100
 
#define SPOOLSS_ADDPRINTEREX                            0x46
101
 
#define SPOOLSS_ENUMPRINTERDATA                         0x48
102
 
#define SPOOLSS_DELETEPRINTERDATA                       0x49
103
 
#define SPOOLSS_SETPRINTERDATAEX                        0x4d
104
 
#define SPOOLSS_GETPRINTERDATAEX                        0x4e
105
 
#define SPOOLSS_ENUMPRINTERDATAEX                       0x4f
106
 
#define SPOOLSS_ENUMPRINTERKEY                          0x50
107
 
#define SPOOLSS_DELETEPRINTERDATAEX                     0x51
108
 
#define SPOOLSS_DELETEPRINTERKEY                        0x52
109
 
#define SPOOLSS_DELETEPRINTERDRIVEREX                   0x54
110
 
#define SPOOLSS_XCVDATAPORT                             0x58
111
 
#define SPOOLSS_ADDPRINTERDRIVEREX                      0x59
112
 
 
113
 
/* 
114
 
 * Special strings for the OpenPrinter() call.  See the MSDN DDK
115
 
 * docs on the XcvDataPort() for more details.
116
 
 */
117
 
 
118
 
#define SPL_LOCAL_PORT            "Local Port"
119
 
#define SPL_TCPIP_PORT            "Standard TCP/IP Port"
120
 
#define SPL_XCV_MONITOR_LOCALMON  ",XcvMonitor Local Port"
121
 
#define SPL_XCV_MONITOR_TCPMON    ",XcvMonitor Standard TCP/IP Port"
122
 
 
123
 
 
124
 
#define PRINTER_CONTROL_UNPAUSE         0x00000000
125
 
#define PRINTER_CONTROL_PAUSE           0x00000001
126
 
#define PRINTER_CONTROL_RESUME          0x00000002
127
 
#define PRINTER_CONTROL_PURGE           0x00000003
128
 
#define PRINTER_CONTROL_SET_STATUS      0x00000004
129
 
 
130
 
#define PRINTER_STATUS_OK               0x00000000
131
 
#define PRINTER_STATUS_PAUSED           0x00000001
132
 
#define PRINTER_STATUS_ERROR            0x00000002
133
 
#define PRINTER_STATUS_PENDING_DELETION 0x00000004
134
 
#define PRINTER_STATUS_PAPER_JAM        0x00000008
135
 
 
136
 
#define PRINTER_STATUS_PAPER_OUT        0x00000010
137
 
#define PRINTER_STATUS_MANUAL_FEED      0x00000020
138
 
#define PRINTER_STATUS_PAPER_PROBLEM    0x00000040
139
 
#define PRINTER_STATUS_OFFLINE          0x00000080
140
 
 
141
 
#define PRINTER_STATUS_IO_ACTIVE        0x00000100
142
 
#define PRINTER_STATUS_BUSY             0x00000200
143
 
#define PRINTER_STATUS_PRINTING         0x00000400
144
 
#define PRINTER_STATUS_OUTPUT_BIN_FULL  0x00000800
145
 
 
146
 
#define PRINTER_STATUS_NOT_AVAILABLE    0x00001000
147
 
#define PRINTER_STATUS_WAITING          0x00002000
148
 
#define PRINTER_STATUS_PROCESSING       0x00004000
149
 
#define PRINTER_STATUS_INITIALIZING     0x00008000
150
 
 
151
 
#define PRINTER_STATUS_WARMING_UP       0x00010000
152
 
#define PRINTER_STATUS_TONER_LOW        0x00020000
153
 
#define PRINTER_STATUS_NO_TONER         0x00040000
154
 
#define PRINTER_STATUS_PAGE_PUNT        0x00080000
155
 
 
156
 
#define PRINTER_STATUS_USER_INTERVENTION        0x00100000
157
 
#define PRINTER_STATUS_OUT_OF_MEMORY    0x00200000
158
 
#define PRINTER_STATUS_DOOR_OPEN        0x00400000
159
 
#define PRINTER_STATUS_SERVER_UNKNOWN   0x00800000
160
 
 
161
 
#define PRINTER_STATUS_POWER_SAVE       0x01000000
162
 
 
163
 
#define SERVER_ACCESS_ADMINISTER        0x00000001
164
 
#define SERVER_ACCESS_ENUMERATE         0x00000002
165
 
#define PRINTER_ACCESS_ADMINISTER       0x00000004
166
 
#define PRINTER_ACCESS_USE              0x00000008
167
 
#define JOB_ACCESS_ADMINISTER           0x00000010
168
 
 
169
 
/* JOB status codes. */
170
 
 
171
 
#define JOB_STATUS_QUEUED               0x0000
172
 
#define JOB_STATUS_PAUSED               0x0001
173
 
#define JOB_STATUS_ERROR                0x0002
174
 
#define JOB_STATUS_DELETING             0x0004
175
 
#define JOB_STATUS_SPOOLING             0x0008
176
 
#define JOB_STATUS_PRINTING             0x0010
177
 
#define JOB_STATUS_OFFLINE              0x0020
178
 
#define JOB_STATUS_PAPEROUT             0x0040
179
 
#define JOB_STATUS_PRINTED              0x0080
180
 
#define JOB_STATUS_DELETED              0x0100
181
 
#define JOB_STATUS_BLOCKED              0x0200
182
 
#define JOB_STATUS_USER_INTERVENTION    0x0400
183
 
 
184
 
/* Access rights for print servers */
185
 
#define SERVER_ALL_ACCESS       STANDARD_RIGHTS_REQUIRED_ACCESS|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE
186
 
#define SERVER_READ             STANDARD_RIGHTS_READ_ACCESS|SERVER_ACCESS_ENUMERATE
187
 
#define SERVER_WRITE            STANDARD_RIGHTS_WRITE_ACCESS|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE
188
 
#define SERVER_EXECUTE          STANDARD_RIGHTS_EXECUTE_ACCESS|SERVER_ACCESS_ENUMERATE
189
 
 
190
 
/* Access rights for printers */
191
 
#define PRINTER_ALL_ACCESS      STANDARD_RIGHTS_REQUIRED_ACCESS|PRINTER_ACCESS_ADMINISTER|PRINTER_ACCESS_USE
192
 
#define PRINTER_READ          STANDARD_RIGHTS_READ_ACCESS|PRINTER_ACCESS_USE
193
 
#define PRINTER_WRITE         STANDARD_RIGHTS_WRITE_ACCESS|PRINTER_ACCESS_USE
194
 
#define PRINTER_EXECUTE       STANDARD_RIGHTS_EXECUTE_ACCESS|PRINTER_ACCESS_USE
195
 
 
196
 
/* Access rights for jobs */
197
 
#define JOB_ALL_ACCESS  STANDARD_RIGHTS_REQUIRED_ACCESS|JOB_ACCESS_ADMINISTER
198
 
#define JOB_READ        STANDARD_RIGHTS_READ_ACCESS|JOB_ACCESS_ADMINISTER
199
 
#define JOB_WRITE       STANDARD_RIGHTS_WRITE_ACCESS|JOB_ACCESS_ADMINISTER
200
 
#define JOB_EXECUTE     STANDARD_RIGHTS_EXECUTE_ACCESS|JOB_ACCESS_ADMINISTER
201
 
 
202
 
/* ACE masks for the various print permissions */
203
 
 
204
 
#define PRINTER_ACE_FULL_CONTROL      (GENERIC_ALL_ACCESS|PRINTER_ALL_ACCESS)
205
 
#define PRINTER_ACE_MANAGE_DOCUMENTS  (GENERIC_ALL_ACCESS|READ_CONTROL_ACCESS)
206
 
#define PRINTER_ACE_PRINT             (GENERIC_EXECUTE_ACCESS|READ_CONTROL_ACCESS|PRINTER_ACCESS_USE)
207
 
 
208
 
 
209
 
/* Notify field types */
210
 
 
211
 
#define NOTIFY_ONE_VALUE 1              /* Notify data is stored in value1 */
212
 
#define NOTIFY_TWO_VALUE 2              /* Notify data is stored in value2 */
213
 
#define NOTIFY_POINTER   3              /* Data is a pointer to a buffer */
214
 
#define NOTIFY_STRING    4              /* Data is a pointer to a buffer w/length */
215
 
#define NOTIFY_SECDESC   5              /* Data is a security descriptor */
216
 
 
217
 
#define PRINTER_NOTIFY_TYPE 0x00
218
 
#define JOB_NOTIFY_TYPE     0x01
219
 
#define PRINT_TABLE_END     0xFF
220
 
 
221
 
#define MAX_PRINTER_NOTIFY 26
222
 
#define MAX_JOB_NOTIFY 24
223
 
 
224
 
#define MAX_NOTIFY_TYPE_FOR_NOW 26
225
 
 
226
 
#define PRINTER_NOTIFY_SERVER_NAME              0x00
227
 
#define PRINTER_NOTIFY_PRINTER_NAME             0x01
228
 
#define PRINTER_NOTIFY_SHARE_NAME               0x02
229
 
#define PRINTER_NOTIFY_PORT_NAME                0x03
230
 
#define PRINTER_NOTIFY_DRIVER_NAME              0x04
231
 
#define PRINTER_NOTIFY_COMMENT                  0x05
232
 
#define PRINTER_NOTIFY_LOCATION                 0x06
233
 
#define PRINTER_NOTIFY_DEVMODE                  0x07
234
 
#define PRINTER_NOTIFY_SEPFILE                  0x08
235
 
#define PRINTER_NOTIFY_PRINT_PROCESSOR          0x09
236
 
#define PRINTER_NOTIFY_PARAMETERS               0x0A
237
 
#define PRINTER_NOTIFY_DATATYPE                 0x0B
238
 
#define PRINTER_NOTIFY_SECURITY_DESCRIPTOR      0x0C
239
 
#define PRINTER_NOTIFY_ATTRIBUTES               0x0D
240
 
#define PRINTER_NOTIFY_PRIORITY                 0x0E
241
 
#define PRINTER_NOTIFY_DEFAULT_PRIORITY         0x0F
242
 
#define PRINTER_NOTIFY_START_TIME               0x10
243
 
#define PRINTER_NOTIFY_UNTIL_TIME               0x11
244
 
#define PRINTER_NOTIFY_STATUS                   0x12
245
 
#define PRINTER_NOTIFY_STATUS_STRING            0x13
246
 
#define PRINTER_NOTIFY_CJOBS                    0x14
247
 
#define PRINTER_NOTIFY_AVERAGE_PPM              0x15
248
 
#define PRINTER_NOTIFY_TOTAL_PAGES              0x16
249
 
#define PRINTER_NOTIFY_PAGES_PRINTED            0x17
250
 
#define PRINTER_NOTIFY_TOTAL_BYTES              0x18
251
 
#define PRINTER_NOTIFY_BYTES_PRINTED            0x19
252
 
 
253
 
#define JOB_NOTIFY_PRINTER_NAME                 0x00
254
 
#define JOB_NOTIFY_MACHINE_NAME                 0x01
255
 
#define JOB_NOTIFY_PORT_NAME                    0x02
256
 
#define JOB_NOTIFY_USER_NAME                    0x03
257
 
#define JOB_NOTIFY_NOTIFY_NAME                  0x04
258
 
#define JOB_NOTIFY_DATATYPE                     0x05
259
 
#define JOB_NOTIFY_PRINT_PROCESSOR              0x06
260
 
#define JOB_NOTIFY_PARAMETERS                   0x07
261
 
#define JOB_NOTIFY_DRIVER_NAME                  0x08
262
 
#define JOB_NOTIFY_DEVMODE                      0x09
263
 
#define JOB_NOTIFY_STATUS                       0x0A
264
 
#define JOB_NOTIFY_STATUS_STRING                0x0B
265
 
#define JOB_NOTIFY_SECURITY_DESCRIPTOR          0x0C
266
 
#define JOB_NOTIFY_DOCUMENT                     0x0D
267
 
#define JOB_NOTIFY_PRIORITY                     0x0E
268
 
#define JOB_NOTIFY_POSITION                     0x0F
269
 
#define JOB_NOTIFY_SUBMITTED                    0x10
270
 
#define JOB_NOTIFY_START_TIME                   0x11
271
 
#define JOB_NOTIFY_UNTIL_TIME                   0x12
272
 
#define JOB_NOTIFY_TIME                         0x13
273
 
#define JOB_NOTIFY_TOTAL_PAGES                  0x14
274
 
#define JOB_NOTIFY_PAGES_PRINTED                0x15
275
 
#define JOB_NOTIFY_TOTAL_BYTES                  0x16
276
 
#define JOB_NOTIFY_BYTES_PRINTED                0x17
277
 
 
278
 
#define PRINTER_NOTIFY_OPTIONS_REFRESH          0x01
279
 
 
280
 
#define PRINTER_CHANGE_ADD_PRINTER                      0x00000001
281
 
#define PRINTER_CHANGE_SET_PRINTER                      0x00000002
282
 
#define PRINTER_CHANGE_DELETE_PRINTER                   0x00000004
283
 
#define PRINTER_CHANGE_FAILED_CONNECTION_PRINTER        0x00000008
284
 
#define PRINTER_CHANGE_PRINTER  (PRINTER_CHANGE_ADD_PRINTER | \
285
 
                                 PRINTER_CHANGE_SET_PRINTER | \
286
 
                                 PRINTER_CHANGE_DELETE_PRINTER | \
287
 
                                 PRINTER_CHANGE_FAILED_CONNECTION_PRINTER )
288
 
 
289
 
#define PRINTER_CHANGE_ADD_JOB                          0x00000100
290
 
#define PRINTER_CHANGE_SET_JOB                          0x00000200
291
 
#define PRINTER_CHANGE_DELETE_JOB                       0x00000400
292
 
#define PRINTER_CHANGE_WRITE_JOB                        0x00000800
293
 
#define PRINTER_CHANGE_JOB      (PRINTER_CHANGE_ADD_JOB | \
294
 
                                 PRINTER_CHANGE_SET_JOB | \
295
 
                                 PRINTER_CHANGE_DELETE_JOB | \
296
 
                                 PRINTER_CHANGE_WRITE_JOB )
297
 
 
298
 
#define PRINTER_CHANGE_ADD_FORM                         0x00010000
299
 
#define PRINTER_CHANGE_SET_FORM                         0x00020000
300
 
#define PRINTER_CHANGE_DELETE_FORM                      0x00040000
301
 
#define PRINTER_CHANGE_FORM     (PRINTER_CHANGE_ADD_FORM | \
302
 
                                 PRINTER_CHANGE_SET_FORM | \
303
 
                                 PRINTER_CHANGE_DELETE_FORM )
304
 
 
305
 
#define PRINTER_CHANGE_ADD_PORT                         0x00100000
306
 
#define PRINTER_CHANGE_CONFIGURE_PORT                   0x00200000
307
 
#define PRINTER_CHANGE_DELETE_PORT                      0x00400000
308
 
#define PRINTER_CHANGE_PORT     (PRINTER_CHANGE_ADD_PORT | \
309
 
                                 PRINTER_CHANGE_CONFIGURE_PORT | \
310
 
                                 PRINTER_CHANGE_DELETE_PORT )
311
 
 
312
 
#define PRINTER_CHANGE_ADD_PRINT_PROCESSOR              0x01000000
313
 
#define PRINTER_CHANGE_DELETE_PRINT_PROCESSOR           0x04000000
314
 
#define PRINTER_CHANGE_PRINT_PROCESSOR  (PRINTER_CHANGE_ADD_PRINT_PROCESSOR | \
315
 
                                         PRINTER_CHANGE_DELETE_PRINT_PROCESSOR )
316
 
 
317
 
#define PRINTER_CHANGE_ADD_PRINTER_DRIVER               0x10000000
318
 
#define PRINTER_CHANGE_SET_PRINTER_DRIVER               0x20000000
319
 
#define PRINTER_CHANGE_DELETE_PRINTER_DRIVER            0x40000000
320
 
#define PRINTER_CHANGE_PRINTER_DRIVER   (PRINTER_CHANGE_ADD_PRINTER_DRIVER | \
321
 
                                         PRINTER_CHANGE_SET_PRINTER_DRIVER | \
322
 
                                         PRINTER_CHANGE_DELETE_PRINTER_DRIVER )
323
 
 
324
 
#define PRINTER_CHANGE_TIMEOUT                          0x80000000
325
 
#define PRINTER_CHANGE_ALL      (PRINTER_CHANGE_JOB | \
326
 
                                 PRINTER_CHANGE_FORM | \
327
 
                                 PRINTER_CHANGE_PORT | \
328
 
                                 PRINTER_CHANGE_PRINT_PROCESSOR | \
329
 
                                 PRINTER_CHANGE_PRINTER_DRIVER )
330
 
 
331
 
#define PRINTER_NOTIFY_INFO_DISCARDED   0x1
332
 
 
333
 
/*
334
 
 * Set of macros for flagging what changed in the PRINTER_INFO_2 struct
335
 
 * when sending messages to other smbd's
336
 
 */
337
 
#define PRINTER_MESSAGE_NULL            0x00000000
338
 
#define PRINTER_MESSAGE_DRIVER          0x00000001
339
 
#define PRINTER_MESSAGE_COMMENT         0x00000002
340
 
#define PRINTER_MESSAGE_PRINTERNAME     0x00000004
341
 
#define PRINTER_MESSAGE_LOCATION        0x00000008
342
 
#define PRINTER_MESSAGE_DEVMODE         0x00000010      /* not curently supported */
343
 
#define PRINTER_MESSAGE_SEPFILE         0x00000020
344
 
#define PRINTER_MESSAGE_PRINTPROC       0x00000040
345
 
#define PRINTER_MESSAGE_PARAMS          0x00000080
346
 
#define PRINTER_MESSAGE_DATATYPE        0x00000100
347
 
#define PRINTER_MESSAGE_SECDESC         0x00000200
348
 
#define PRINTER_MESSAGE_CJOBS           0x00000400
349
 
#define PRINTER_MESSAGE_PORT            0x00000800
350
 
#define PRINTER_MESSAGE_SHARENAME       0x00001000
351
 
#define PRINTER_MESSAGE_ATTRIBUTES      0x00002000
352
 
 
353
 
typedef struct printer_message_info {
354
 
        uint32 low;             /* PRINTER_CHANGE_XXX */
355
 
        uint32 high;            /* PRINTER_CHANGE_XXX */
356
 
        fstring printer_name;
357
 
        uint32 flags;           /* PRINTER_MESSAGE_XXX */
358
 
}
359
 
PRINTER_MESSAGE_INFO;
360
 
 
361
 
/*
362
 
 * The printer attributes.
363
 
 * I #defined all of them (grabbed form MSDN)
364
 
 * I'm only using:
365
 
 * ( SHARED | NETWORK | RAW_ONLY )
366
 
 * RAW_ONLY _MUST_ be present otherwise NT will send an EMF file
367
 
 */
368
 
 
369
 
#define PRINTER_ATTRIBUTE_QUEUED                0x00000001
370
 
#define PRINTER_ATTRIBUTE_DIRECT                0x00000002
371
 
#define PRINTER_ATTRIBUTE_DEFAULT               0x00000004
372
 
#define PRINTER_ATTRIBUTE_SHARED                0x00000008
373
 
 
374
 
#define PRINTER_ATTRIBUTE_NETWORK               0x00000010
375
 
#define PRINTER_ATTRIBUTE_HIDDEN                0x00000020
376
 
#define PRINTER_ATTRIBUTE_LOCAL                 0x00000040
377
 
#define PRINTER_ATTRIBUTE_ENABLE_DEVQ           0x00000080
378
 
 
379
 
#define PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS       0x00000100
380
 
#define PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST     0x00000200
381
 
#define PRINTER_ATTRIBUTE_WORK_OFFLINE          0x00000400
382
 
#define PRINTER_ATTRIBUTE_ENABLE_BIDI           0x00000800
383
 
 
384
 
#define PRINTER_ATTRIBUTE_RAW_ONLY              0x00001000
385
 
#define PRINTER_ATTRIBUTE_PUBLISHED             0x00002000
386
 
 
387
 
#define PRINTER_ATTRIBUTE_SAMBA                 (PRINTER_ATTRIBUTE_RAW_ONLY|\
388
 
                                                 PRINTER_ATTRIBUTE_SHARED|\
389
 
                                                 PRINTER_ATTRIBUTE_LOCAL)
390
 
#define PRINTER_ATTRIBUTE_NOT_SAMBA             (PRINTER_ATTRIBUTE_NETWORK)
391
 
 
392
 
#define NO_PRIORITY      0
393
 
#define MAX_PRIORITY    99
394
 
#define MIN_PRIORITY     1
395
 
#define DEF_PRIORITY     1
396
 
 
397
 
/* the flags of the query */
398
 
#define PRINTER_ENUM_DEFAULT            0x00000001
399
 
#define PRINTER_ENUM_LOCAL              0x00000002
400
 
#define PRINTER_ENUM_CONNECTIONS        0x00000004
401
 
#define PRINTER_ENUM_FAVORITE           0x00000004
402
 
#define PRINTER_ENUM_NAME               0x00000008
403
 
#define PRINTER_ENUM_REMOTE             0x00000010
404
 
#define PRINTER_ENUM_SHARED             0x00000020
405
 
#define PRINTER_ENUM_NETWORK            0x00000040
406
 
 
407
 
/* the flags of each printers */
408
 
#define PRINTER_ENUM_UNKNOWN_8          0x00000008
409
 
#define PRINTER_ENUM_EXPAND             0x00004000
410
 
#define PRINTER_ENUM_CONTAINER          0x00008000
411
 
#define PRINTER_ENUM_ICONMASK           0x00ff0000
412
 
#define PRINTER_ENUM_ICON1              0x00010000
413
 
#define PRINTER_ENUM_ICON2              0x00020000
414
 
#define PRINTER_ENUM_ICON3              0x00040000
415
 
#define PRINTER_ENUM_ICON4              0x00080000
416
 
#define PRINTER_ENUM_ICON5              0x00100000
417
 
#define PRINTER_ENUM_ICON6              0x00200000
418
 
#define PRINTER_ENUM_ICON7              0x00400000
419
 
#define PRINTER_ENUM_ICON8              0x00800000
420
 
 
421
 
/* FLAGS for SPOOLSS_DELETEPRINTERDRIVEREX */
422
 
 
423
 
#define DPD_DELETE_UNUSED_FILES         0x00000001
424
 
#define DPD_DELETE_SPECIFIC_VERSION     0x00000002
425
 
#define DPD_DELETE_ALL_FILES            0x00000004
426
 
 
427
 
#define DRIVER_ANY_VERSION              0xffffffff
428
 
#define DRIVER_MAX_VERSION              4
429
 
 
430
 
/* FLAGS for SPOOLSS_ADDPRINTERDRIVEREX */
431
 
 
432
 
#define APD_STRICT_UPGRADE              0x00000001
433
 
#define APD_STRICT_DOWNGRADE            0x00000002
434
 
#define APD_COPY_ALL_FILES              0x00000004
435
 
#define APD_COPY_NEW_FILES              0x00000008
436
 
 
437
 
 
438
 
/* this struct is undocumented */
439
 
/* thanks to the ddk ... */
440
 
typedef struct {
441
 
        uint32 size;            /* length of user_name & client_name + 2? */
442
 
        UNISTR2 *client_name;
443
 
        UNISTR2 *user_name;
444
 
        uint32 build;
445
 
        uint32 major;
446
 
        uint32 minor;
447
 
        uint32 processor;
448
 
} SPOOL_USER_1;
449
 
 
450
 
typedef struct {
451
 
        uint32 level;
452
 
        union {
453
 
                SPOOL_USER_1 *user1;
454
 
        } user;
455
 
} SPOOL_USER_CTR;
456
 
 
457
 
/*
458
 
 * various bits in the DEVICEMODE.fields member
459
 
 */
460
 
 
461
 
#define DEVMODE_ORIENTATION             0x00000001
462
 
#define DEVMODE_PAPERSIZE               0x00000002
463
 
#define DEVMODE_PAPERLENGTH             0x00000004
464
 
#define DEVMODE_PAPERWIDTH              0x00000008
465
 
#define DEVMODE_SCALE                   0x00000010
466
 
#define DEVMODE_POSITION                0x00000020
467
 
#define DEVMODE_NUP                     0x00000040
468
 
#define DEVMODE_COPIES                  0x00000100
469
 
#define DEVMODE_DEFAULTSOURCE           0x00000200
470
 
#define DEVMODE_PRINTQUALITY            0x00000400
471
 
#define DEVMODE_COLOR                   0x00000800
472
 
#define DEVMODE_DUPLEX                  0x00001000
473
 
#define DEVMODE_YRESOLUTION             0x00002000
474
 
#define DEVMODE_TTOPTION                0x00004000
475
 
#define DEVMODE_COLLATE                 0x00008000
476
 
#define DEVMODE_FORMNAME                0x00010000
477
 
#define DEVMODE_LOGPIXELS               0x00020000
478
 
#define DEVMODE_BITSPERPEL              0x00040000
479
 
#define DEVMODE_PELSWIDTH               0x00080000
480
 
#define DEVMODE_PELSHEIGHT              0x00100000
481
 
#define DEVMODE_DISPLAYFLAGS            0x00200000
482
 
#define DEVMODE_DISPLAYFREQUENCY        0x00400000
483
 
#define DEVMODE_ICMMETHOD               0x00800000
484
 
#define DEVMODE_ICMINTENT               0x01000000
485
 
#define DEVMODE_MEDIATYPE               0x02000000
486
 
#define DEVMODE_DITHERTYPE              0x04000000
487
 
#define DEVMODE_PANNINGWIDTH            0x08000000
488
 
#define DEVMODE_PANNINGHEIGHT           0x10000000
489
 
 
490
 
 
491
 
/* 
492
 
 * Devicemode structure
493
 
 */
494
 
 
495
 
typedef struct devicemode
496
 
{
497
 
        UNISTR devicename;
498
 
        uint16 specversion;
499
 
        uint16 driverversion;
500
 
        uint16 size;
501
 
        uint16 driverextra;
502
 
        uint32 fields;
503
 
        uint16 orientation;
504
 
        uint16 papersize;
505
 
        uint16 paperlength;
506
 
        uint16 paperwidth;
507
 
        uint16 scale;
508
 
        uint16 copies;
509
 
        uint16 defaultsource;
510
 
        uint16 printquality;
511
 
        uint16 color;
512
 
        uint16 duplex;
513
 
        uint16 yresolution;
514
 
        uint16 ttoption;
515
 
        uint16 collate;
516
 
        UNISTR formname;
517
 
        uint16 logpixels;
518
 
        uint32 bitsperpel;
519
 
        uint32 pelswidth;
520
 
        uint32 pelsheight;
521
 
        uint32 displayflags;
522
 
        uint32 displayfrequency;
523
 
        uint32 icmmethod;
524
 
        uint32 icmintent;
525
 
        uint32 mediatype;
526
 
        uint32 dithertype;
527
 
        uint32 reserved1;
528
 
        uint32 reserved2;
529
 
        uint32 panningwidth;
530
 
        uint32 panningheight;
531
 
        uint8 *dev_private;
532
 
}
533
 
DEVICEMODE;
534
 
 
535
 
typedef struct _devmode_cont
536
 
{
537
 
        uint32 size;
538
 
        uint32 devmode_ptr;
539
 
        DEVICEMODE *devmode;
540
 
}
541
 
DEVMODE_CTR;
542
 
 
543
 
typedef struct _printer_default
544
 
{
545
 
        uint32 datatype_ptr;
546
 
        UNISTR2 datatype;
547
 
        DEVMODE_CTR devmode_cont;
548
 
        uint32 access_required;
549
 
}
550
 
PRINTER_DEFAULT;
551
 
 
552
 
/********************************************/
553
 
 
554
 
typedef struct {
555
 
        UNISTR2 *printername;
556
 
        PRINTER_DEFAULT printer_default;
557
 
} SPOOL_Q_OPEN_PRINTER;
558
 
 
559
 
typedef struct {
560
 
        POLICY_HND handle;      /* handle used along all transactions (20*uint8) */
561
 
        WERROR status;
562
 
} SPOOL_R_OPEN_PRINTER;
563
 
 
564
 
/********************************************/
565
 
 
566
 
typedef struct {
567
 
        UNISTR2 *printername;
568
 
        PRINTER_DEFAULT printer_default;
569
 
        uint32 user_switch;
570
 
        SPOOL_USER_CTR user_ctr;
571
 
} SPOOL_Q_OPEN_PRINTER_EX;
572
 
 
573
 
typedef struct {
574
 
        POLICY_HND handle;      /* handle used along all transactions (20*uint8) */
575
 
        WERROR status;
576
 
} SPOOL_R_OPEN_PRINTER_EX;
577
 
 
578
 
/********************************************/
579
 
 
580
 
typedef struct spool_notify_option_type
581
 
{
582
 
        uint16 type;
583
 
        uint16 reserved0;
584
 
        uint32 reserved1;
585
 
        uint32 reserved2;
586
 
        uint32 count;
587
 
        uint32 fields_ptr;
588
 
        uint32 count2;
589
 
        uint16 fields[MAX_NOTIFY_TYPE_FOR_NOW];
590
 
}
591
 
SPOOL_NOTIFY_OPTION_TYPE;
592
 
 
593
 
typedef struct spool_notify_option_type_ctr
594
 
{
595
 
        uint32 count;
596
 
        SPOOL_NOTIFY_OPTION_TYPE *type;
597
 
}
598
 
SPOOL_NOTIFY_OPTION_TYPE_CTR;
599
 
 
600
 
 
601
 
 
602
 
typedef struct s_header_type
603
 
{
604
 
        uint32 type;
605
 
        union
606
 
        {
607
 
                uint32 value;
608
 
                UNISTR string;
609
 
        }
610
 
        data;
611
 
}
612
 
HEADER_TYPE;
613
 
 
614
 
 
615
 
typedef struct spool_q_getprinterdata
616
 
{
617
 
        POLICY_HND handle;
618
 
        UNISTR2 valuename;
619
 
        uint32 size;
620
 
}
621
 
SPOOL_Q_GETPRINTERDATA;
622
 
 
623
 
typedef struct spool_r_getprinterdata
624
 
{
625
 
        uint32 type;
626
 
        uint32 size;
627
 
        uint8 *data;
628
 
        uint32 needed;
629
 
        WERROR status;
630
 
}
631
 
SPOOL_R_GETPRINTERDATA;
632
 
 
633
 
typedef struct spool_q_deleteprinterdata
634
 
{
635
 
        POLICY_HND handle;
636
 
        UNISTR2 valuename;
637
 
}
638
 
SPOOL_Q_DELETEPRINTERDATA;
639
 
 
640
 
typedef struct spool_r_deleteprinterdata
641
 
{
642
 
        WERROR status;
643
 
}
644
 
SPOOL_R_DELETEPRINTERDATA;
645
 
 
646
 
typedef struct spool_q_closeprinter
647
 
{
648
 
        POLICY_HND handle;
649
 
}
650
 
SPOOL_Q_CLOSEPRINTER;
651
 
 
652
 
typedef struct spool_r_closeprinter
653
 
{
654
 
        POLICY_HND handle;
655
 
        WERROR status;
656
 
}
657
 
SPOOL_R_CLOSEPRINTER;
658
 
 
659
 
typedef struct spool_q_startpageprinter
660
 
{
661
 
        POLICY_HND handle;
662
 
}
663
 
SPOOL_Q_STARTPAGEPRINTER;
664
 
 
665
 
typedef struct spool_r_startpageprinter
666
 
{
667
 
        WERROR status;
668
 
}
669
 
SPOOL_R_STARTPAGEPRINTER;
670
 
 
671
 
typedef struct spool_q_endpageprinter
672
 
{
673
 
        POLICY_HND handle;
674
 
}
675
 
SPOOL_Q_ENDPAGEPRINTER;
676
 
 
677
 
typedef struct spool_r_endpageprinter
678
 
{
679
 
        WERROR status;
680
 
}
681
 
SPOOL_R_ENDPAGEPRINTER;
682
 
 
683
 
 
684
 
typedef struct spool_q_deleteprinterdriver
685
 
{
686
 
        uint32 server_ptr;
687
 
        UNISTR2 server;
688
 
        UNISTR2 arch;
689
 
        UNISTR2 driver;
690
 
}
691
 
SPOOL_Q_DELETEPRINTERDRIVER;
692
 
 
693
 
typedef struct spool_r_deleteprinterdriver
694
 
{
695
 
        WERROR status;
696
 
}
697
 
SPOOL_R_DELETEPRINTERDRIVER;
698
 
 
699
 
typedef struct spool_q_deleteprinterdriverex
700
 
{
701
 
        uint32 server_ptr;
702
 
        UNISTR2 server;
703
 
        UNISTR2 arch;
704
 
        UNISTR2 driver;
705
 
        uint32 delete_flags;
706
 
        uint32 version;
707
 
}
708
 
SPOOL_Q_DELETEPRINTERDRIVEREX;
709
 
 
710
 
typedef struct spool_r_deleteprinterdriverex
711
 
{
712
 
        WERROR status;
713
 
}
714
 
SPOOL_R_DELETEPRINTERDRIVEREX;
715
 
 
716
 
 
717
 
typedef struct spool_doc_info_1
718
 
{
719
 
        uint32 p_docname;
720
 
        uint32 p_outputfile;
721
 
        uint32 p_datatype;
722
 
        UNISTR2 docname;
723
 
        UNISTR2 outputfile;
724
 
        UNISTR2 datatype;
725
 
}
726
 
DOC_INFO_1;
727
 
 
728
 
typedef struct spool_doc_info
729
 
{
730
 
        uint32 switch_value;
731
 
        DOC_INFO_1 doc_info_1;
732
 
}
733
 
DOC_INFO;
734
 
 
735
 
typedef struct spool_doc_info_container
736
 
{
737
 
        uint32 level;
738
 
        DOC_INFO docinfo;
739
 
}
740
 
DOC_INFO_CONTAINER;
741
 
 
742
 
typedef struct spool_q_startdocprinter
743
 
{
744
 
        POLICY_HND handle;
745
 
        DOC_INFO_CONTAINER doc_info_container;
746
 
}
747
 
SPOOL_Q_STARTDOCPRINTER;
748
 
 
749
 
typedef struct spool_r_startdocprinter
750
 
{
751
 
        uint32 jobid;
752
 
        WERROR status;
753
 
}
754
 
SPOOL_R_STARTDOCPRINTER;
755
 
 
756
 
typedef struct spool_q_enddocprinter
757
 
{
758
 
        POLICY_HND handle;
759
 
}
760
 
SPOOL_Q_ENDDOCPRINTER;
761
 
 
762
 
typedef struct spool_r_enddocprinter
763
 
{
764
 
        WERROR status;
765
 
}
766
 
SPOOL_R_ENDDOCPRINTER;
767
 
 
768
 
typedef struct spool_q_writeprinter
769
 
{
770
 
        POLICY_HND handle;
771
 
        uint32 buffer_size;
772
 
        uint8 *buffer;
773
 
        uint32 buffer_size2;
774
 
}
775
 
SPOOL_Q_WRITEPRINTER;
776
 
 
777
 
typedef struct spool_r_writeprinter
778
 
{
779
 
        uint32 buffer_written;
780
 
        WERROR status;
781
 
}
782
 
SPOOL_R_WRITEPRINTER;
783
 
 
784
 
typedef struct spool_notify_option
785
 
{
786
 
        uint32 version;
787
 
        uint32 flags;
788
 
        uint32 count;
789
 
        uint32 option_type_ptr;
790
 
        SPOOL_NOTIFY_OPTION_TYPE_CTR ctr;
791
 
}
792
 
SPOOL_NOTIFY_OPTION;
793
 
 
794
 
typedef struct spool_notify_info_data
795
 
{
796
 
        uint16 type;
797
 
        uint16 field;
798
 
        uint32 reserved;
799
 
        uint32 id;
800
 
        union {
801
 
                uint32 value[2];
802
 
                struct {
803
 
                        uint32 length;
804
 
                        uint16 *string;
805
 
                } data;
806
 
                struct {
807
 
                        uint32  size;
808
 
                        SEC_DESC *desc;
809
 
                } sd;
810
 
        }
811
 
        notify_data;
812
 
        uint32 size;
813
 
        uint32 enc_type;
814
 
} SPOOL_NOTIFY_INFO_DATA;
815
 
 
816
 
typedef struct spool_notify_info
817
 
{
818
 
        uint32 version;
819
 
        uint32 flags;
820
 
        uint32 count;
821
 
        SPOOL_NOTIFY_INFO_DATA *data;
822
 
}
823
 
SPOOL_NOTIFY_INFO;
824
 
 
825
 
/* If the struct name looks obscure, yes it is ! */
826
 
/* RemoteFindFirstPrinterChangeNotificationEx query struct */
827
 
typedef struct spoolss_q_rffpcnex
828
 
{
829
 
        POLICY_HND handle;
830
 
        uint32 flags;
831
 
        uint32 options;
832
 
        uint32 localmachine_ptr;
833
 
        UNISTR2 localmachine;
834
 
        uint32 printerlocal;
835
 
        uint32 option_ptr;
836
 
        SPOOL_NOTIFY_OPTION *option;
837
 
}
838
 
SPOOL_Q_RFFPCNEX;
839
 
 
840
 
typedef struct spool_r_rffpcnex
841
 
{
842
 
        WERROR status;
843
 
}
844
 
SPOOL_R_RFFPCNEX;
845
 
 
846
 
/* Remote Find Next Printer Change Notify Ex */
847
 
typedef struct spool_q_rfnpcnex
848
 
{
849
 
        POLICY_HND handle;
850
 
        uint32 change;
851
 
        uint32 option_ptr;
852
 
        SPOOL_NOTIFY_OPTION *option;
853
 
}
854
 
SPOOL_Q_RFNPCNEX;
855
 
 
856
 
typedef struct spool_r_rfnpcnex
857
 
{
858
 
        uint32 info_ptr;
859
 
        SPOOL_NOTIFY_INFO info;
860
 
        WERROR status;
861
 
}
862
 
SPOOL_R_RFNPCNEX;
863
 
 
864
 
/* Find Close Printer Notify */
865
 
typedef struct spool_q_fcpn
866
 
{
867
 
        POLICY_HND handle;
868
 
}
869
 
SPOOL_Q_FCPN;
870
 
 
871
 
typedef struct spool_r_fcpn
872
 
{
873
 
        WERROR status;
874
 
}
875
 
SPOOL_R_FCPN;
876
 
 
877
 
 
878
 
typedef struct printer_info_0
879
 
{
880
 
        UNISTR printername;
881
 
        UNISTR servername;
882
 
        uint32 cjobs;
883
 
        uint32 total_jobs;
884
 
        uint32 total_bytes;
885
 
        
886
 
        uint16 year;
887
 
        uint16 month;
888
 
        uint16 dayofweek;
889
 
        uint16 day;
890
 
        uint16 hour;
891
 
        uint16 minute;
892
 
        uint16 second;
893
 
        uint16 milliseconds;
894
 
 
895
 
        uint32 global_counter;
896
 
        uint32 total_pages;
897
 
 
898
 
        uint16 major_version;
899
 
        uint16 build_version;
900
 
 
901
 
        uint32 unknown7;
902
 
        uint32 unknown8;
903
 
        uint32 unknown9;
904
 
        uint32 session_counter;
905
 
        uint32 unknown11;
906
 
        uint32 printer_errors;
907
 
        uint32 unknown13;
908
 
        uint32 unknown14;
909
 
        uint32 unknown15;
910
 
        uint32 unknown16;
911
 
        uint32 change_id;
912
 
        uint32 unknown18;
913
 
        uint32 status;
914
 
        uint32 unknown20;
915
 
        uint32 c_setprinter;
916
 
 
917
 
        uint16 unknown22;
918
 
        uint16 unknown23;
919
 
        uint16 unknown24;
920
 
        uint16 unknown25;
921
 
        uint16 unknown26;
922
 
        uint16 unknown27;
923
 
        uint16 unknown28;
924
 
        uint16 unknown29;
925
 
} PRINTER_INFO_0;
926
 
 
927
 
typedef struct printer_info_1
928
 
{
929
 
        uint32 flags;
930
 
        UNISTR description;
931
 
        UNISTR name;
932
 
        UNISTR comment;
933
 
}
934
 
PRINTER_INFO_1;
935
 
 
936
 
typedef struct printer_info_2
937
 
{
938
 
        UNISTR servername;
939
 
        UNISTR printername;
940
 
        UNISTR sharename;
941
 
        UNISTR portname;
942
 
        UNISTR drivername;
943
 
        UNISTR comment;
944
 
        UNISTR location;
945
 
        DEVICEMODE *devmode;
946
 
        UNISTR sepfile;
947
 
        UNISTR printprocessor;
948
 
        UNISTR datatype;
949
 
        UNISTR parameters;
950
 
        SEC_DESC *secdesc;
951
 
        uint32 attributes;
952
 
        uint32 priority;
953
 
        uint32 defaultpriority;
954
 
        uint32 starttime;
955
 
        uint32 untiltime;
956
 
        uint32 status;
957
 
        uint32 cjobs;
958
 
        uint32 averageppm;
959
 
}
960
 
PRINTER_INFO_2;
961
 
 
962
 
typedef struct printer_info_3
963
 
{
964
 
        uint32 flags;
965
 
        SEC_DESC *secdesc;
966
 
}
967
 
PRINTER_INFO_3;
968
 
 
969
 
typedef struct printer_info_4
970
 
{
971
 
        UNISTR printername;
972
 
        UNISTR servername;
973
 
        uint32 attributes;
974
 
}
975
 
PRINTER_INFO_4;
976
 
 
977
 
typedef struct printer_info_5
978
 
{
979
 
        UNISTR printername;
980
 
        UNISTR portname;
981
 
        uint32 attributes;
982
 
        uint32 device_not_selected_timeout;
983
 
        uint32 transmission_retry_timeout;
984
 
}
985
 
PRINTER_INFO_5;
986
 
 
987
 
#define SPOOL_DS_PUBLISH        1
988
 
#define SPOOL_DS_UPDATE         2
989
 
#define SPOOL_DS_UNPUBLISH      4
990
 
#define SPOOL_DS_PENDING        0x80000000
991
 
 
992
 
typedef struct printer_info_7
993
 
{
994
 
        UNISTR guid; /* text form of printer guid */
995
 
        uint32 action;
996
 
}
997
 
PRINTER_INFO_7;
998
 
 
999
 
typedef struct spool_q_enumprinters
1000
 
{
1001
 
        uint32 flags;
1002
 
        uint32 servername_ptr;
1003
 
        UNISTR2 servername;
1004
 
        uint32 level;
1005
 
        RPC_BUFFER *buffer;
1006
 
        uint32 offered;
1007
 
}
1008
 
SPOOL_Q_ENUMPRINTERS;
1009
 
 
1010
 
typedef struct printer_info_ctr_info
1011
 
{
1012
 
        PRINTER_INFO_0 *printers_0;
1013
 
        PRINTER_INFO_1 *printers_1;
1014
 
        PRINTER_INFO_2 *printers_2;
1015
 
        PRINTER_INFO_3 *printers_3;
1016
 
        PRINTER_INFO_4 *printers_4;
1017
 
        PRINTER_INFO_5 *printers_5;
1018
 
        PRINTER_INFO_7 *printers_7;
1019
 
}
1020
 
PRINTER_INFO_CTR;
1021
 
 
1022
 
typedef struct spool_r_enumprinters
1023
 
{
1024
 
        RPC_BUFFER *buffer;
1025
 
        uint32 needed;          /* bytes needed */
1026
 
        uint32 returned;        /* number of printers */
1027
 
        WERROR status;
1028
 
}
1029
 
SPOOL_R_ENUMPRINTERS;
1030
 
 
1031
 
 
1032
 
typedef struct spool_q_getprinter
1033
 
{
1034
 
        POLICY_HND handle;
1035
 
        uint32 level;
1036
 
        RPC_BUFFER *buffer;
1037
 
        uint32 offered;
1038
 
}
1039
 
SPOOL_Q_GETPRINTER;
1040
 
 
1041
 
typedef struct printer_info_info
1042
 
{
1043
 
        union
1044
 
        {
1045
 
                PRINTER_INFO_0 *info0;
1046
 
                PRINTER_INFO_1 *info1;
1047
 
                PRINTER_INFO_2 *info2;
1048
 
                void *info;
1049
 
        } printer;
1050
 
} PRINTER_INFO;
1051
 
 
1052
 
typedef struct spool_r_getprinter
1053
 
{
1054
 
        RPC_BUFFER *buffer;
1055
 
        uint32 needed;
1056
 
        WERROR status;
1057
 
} SPOOL_R_GETPRINTER;
1058
 
 
1059
 
typedef struct driver_info_1
1060
 
{
1061
 
        UNISTR name;
1062
 
} DRIVER_INFO_1;
1063
 
 
1064
 
typedef struct driver_info_2
1065
 
{
1066
 
        uint32 version;
1067
 
        UNISTR name;
1068
 
        UNISTR architecture;
1069
 
        UNISTR driverpath;
1070
 
        UNISTR datafile;
1071
 
        UNISTR configfile;
1072
 
} DRIVER_INFO_2;
1073
 
 
1074
 
typedef struct driver_info_3
1075
 
{
1076
 
        uint32 version;
1077
 
        UNISTR name;
1078
 
        UNISTR architecture;
1079
 
        UNISTR driverpath;
1080
 
        UNISTR datafile;
1081
 
        UNISTR configfile;
1082
 
        UNISTR helpfile;
1083
 
        uint16 *dependentfiles;
1084
 
        UNISTR monitorname;
1085
 
        UNISTR defaultdatatype;
1086
 
}
1087
 
DRIVER_INFO_3;
1088
 
 
1089
 
typedef struct driver_info_6
1090
 
{
1091
 
        uint32 version;
1092
 
        UNISTR name;
1093
 
        UNISTR architecture;
1094
 
        UNISTR driverpath;
1095
 
        UNISTR datafile;
1096
 
        UNISTR configfile;
1097
 
        UNISTR helpfile;
1098
 
        uint16 *dependentfiles;
1099
 
        UNISTR monitorname;
1100
 
        UNISTR defaultdatatype;
1101
 
        uint16* previousdrivernames;
1102
 
        NTTIME driver_date;
1103
 
        uint32 padding;
1104
 
        uint32 driver_version_low;
1105
 
        uint32 driver_version_high;
1106
 
        UNISTR mfgname;
1107
 
        UNISTR oem_url;
1108
 
        UNISTR hardware_id;
1109
 
        UNISTR provider;
1110
 
}
1111
 
DRIVER_INFO_6;
1112
 
 
1113
 
typedef struct driver_info_info
1114
 
{
1115
 
        DRIVER_INFO_1 *info1;
1116
 
        DRIVER_INFO_2 *info2;
1117
 
        DRIVER_INFO_3 *info3;
1118
 
        DRIVER_INFO_6 *info6;
1119
 
}
1120
 
PRINTER_DRIVER_CTR;
1121
 
 
1122
 
typedef struct spool_q_getprinterdriver2
1123
 
{
1124
 
        POLICY_HND handle;
1125
 
        uint32 architecture_ptr;
1126
 
        UNISTR2 architecture;
1127
 
        uint32 level;
1128
 
        RPC_BUFFER *buffer;
1129
 
        uint32 offered;
1130
 
        uint32 clientmajorversion;
1131
 
        uint32 clientminorversion;
1132
 
}
1133
 
SPOOL_Q_GETPRINTERDRIVER2;
1134
 
 
1135
 
typedef struct spool_r_getprinterdriver2
1136
 
{
1137
 
        RPC_BUFFER *buffer;
1138
 
        uint32 needed;
1139
 
        uint32 servermajorversion;
1140
 
        uint32 serverminorversion;
1141
 
        WERROR status;
1142
 
}
1143
 
SPOOL_R_GETPRINTERDRIVER2;
1144
 
 
1145
 
 
1146
 
typedef struct add_jobinfo_1
1147
 
{
1148
 
        UNISTR path;
1149
 
        uint32 job_number;
1150
 
}
1151
 
ADD_JOBINFO_1;
1152
 
 
1153
 
 
1154
 
typedef struct spool_q_addjob
1155
 
{
1156
 
        POLICY_HND handle;
1157
 
        uint32 level;
1158
 
        RPC_BUFFER *buffer;
1159
 
        uint32 offered;
1160
 
}
1161
 
SPOOL_Q_ADDJOB;
1162
 
 
1163
 
typedef struct spool_r_addjob
1164
 
{
1165
 
        RPC_BUFFER *buffer;
1166
 
        uint32 needed;
1167
 
        WERROR status;
1168
 
}
1169
 
SPOOL_R_ADDJOB;
1170
 
 
1171
 
/*
1172
 
 * I'm really wondering how many different time formats
1173
 
 * I will have to cope with
1174
 
 *
1175
 
 * JFM, 09/13/98 In a mad mood ;-(
1176
 
*/
1177
 
typedef struct systemtime
1178
 
{
1179
 
        uint16 year;
1180
 
        uint16 month;
1181
 
        uint16 dayofweek;
1182
 
        uint16 day;
1183
 
        uint16 hour;
1184
 
        uint16 minute;
1185
 
        uint16 second;
1186
 
        uint16 milliseconds;
1187
 
}
1188
 
SYSTEMTIME;
1189
 
 
1190
 
typedef struct s_job_info_1
1191
 
{
1192
 
        uint32 jobid;
1193
 
        UNISTR printername;
1194
 
        UNISTR machinename;
1195
 
        UNISTR username;
1196
 
        UNISTR document;
1197
 
        UNISTR datatype;
1198
 
        UNISTR text_status;
1199
 
        uint32 status;
1200
 
        uint32 priority;
1201
 
        uint32 position;
1202
 
        uint32 totalpages;
1203
 
        uint32 pagesprinted;
1204
 
        SYSTEMTIME submitted;
1205
 
}
1206
 
JOB_INFO_1;
1207
 
 
1208
 
typedef struct s_job_info_2
1209
 
{
1210
 
        uint32 jobid;
1211
 
        UNISTR printername;
1212
 
        UNISTR machinename;
1213
 
        UNISTR username;
1214
 
        UNISTR document;
1215
 
        UNISTR notifyname;
1216
 
        UNISTR datatype;
1217
 
        UNISTR printprocessor;
1218
 
        UNISTR parameters;
1219
 
        UNISTR drivername;
1220
 
        DEVICEMODE *devmode;
1221
 
        UNISTR text_status;
1222
 
/*      SEC_DESC sec_desc;*/
1223
 
        uint32 status;
1224
 
        uint32 priority;
1225
 
        uint32 position;
1226
 
        uint32 starttime;
1227
 
        uint32 untiltime;
1228
 
        uint32 totalpages;
1229
 
        uint32 size;
1230
 
        SYSTEMTIME submitted;
1231
 
        uint32 timeelapsed;
1232
 
        uint32 pagesprinted;
1233
 
}
1234
 
JOB_INFO_2;
1235
 
 
1236
 
typedef struct spool_q_enumjobs
1237
 
{
1238
 
        POLICY_HND handle;
1239
 
        uint32 firstjob;
1240
 
        uint32 numofjobs;
1241
 
        uint32 level;
1242
 
        RPC_BUFFER *buffer;
1243
 
        uint32 offered;
1244
 
}
1245
 
SPOOL_Q_ENUMJOBS;
1246
 
 
1247
 
typedef struct job_info_ctr_info
1248
 
{
1249
 
        union
1250
 
        {
1251
 
                JOB_INFO_1 *job_info_1;
1252
 
                JOB_INFO_2 *job_info_2;
1253
 
                void *info;
1254
 
        } job;
1255
 
 
1256
 
} JOB_INFO_CTR;
1257
 
 
1258
 
typedef struct spool_r_enumjobs
1259
 
{
1260
 
        RPC_BUFFER *buffer;
1261
 
        uint32 needed;
1262
 
        uint32 returned;
1263
 
        WERROR status;
1264
 
}
1265
 
SPOOL_R_ENUMJOBS;
1266
 
 
1267
 
typedef struct spool_q_schedulejob
1268
 
{
1269
 
        POLICY_HND handle;
1270
 
        uint32 jobid;
1271
 
}
1272
 
SPOOL_Q_SCHEDULEJOB;
1273
 
 
1274
 
typedef struct spool_r_schedulejob
1275
 
{
1276
 
        WERROR status;
1277
 
}
1278
 
SPOOL_R_SCHEDULEJOB;
1279
 
 
1280
 
typedef struct s_port_info_1
1281
 
{
1282
 
        UNISTR port_name;
1283
 
}
1284
 
PORT_INFO_1;
1285
 
 
1286
 
typedef struct s_port_info_2
1287
 
{
1288
 
        UNISTR port_name;
1289
 
        UNISTR monitor_name;
1290
 
        UNISTR description;
1291
 
        uint32 port_type;
1292
 
        uint32 reserved;
1293
 
}
1294
 
PORT_INFO_2;
1295
 
 
1296
 
/* Port Type bits */
1297
 
#define PORT_TYPE_WRITE         0x0001
1298
 
#define PORT_TYPE_READ          0x0002
1299
 
#define PORT_TYPE_REDIRECTED    0x0004
1300
 
#define PORT_TYPE_NET_ATTACHED  0x0008
1301
 
 
1302
 
typedef struct spool_q_enumports
1303
 
{
1304
 
        uint32 name_ptr;
1305
 
        UNISTR2 name;
1306
 
        uint32 level;
1307
 
        RPC_BUFFER *buffer;
1308
 
        uint32 offered;
1309
 
}
1310
 
SPOOL_Q_ENUMPORTS;
1311
 
 
1312
 
typedef struct port_info_ctr_info
1313
 
{
1314
 
        union
1315
 
        {
1316
 
                PORT_INFO_1 *info_1;
1317
 
                PORT_INFO_2 *info_2;
1318
 
        }
1319
 
        port;
1320
 
 
1321
 
}
1322
 
PORT_INFO_CTR;
1323
 
 
1324
 
typedef struct spool_r_enumports
1325
 
{
1326
 
        RPC_BUFFER *buffer;
1327
 
        uint32 needed;          /* bytes needed */
1328
 
        uint32 returned;        /* number of printers */
1329
 
        WERROR status;
1330
 
}
1331
 
SPOOL_R_ENUMPORTS;
1332
 
 
1333
 
#define JOB_CONTROL_PAUSE              1
1334
 
#define JOB_CONTROL_RESUME             2
1335
 
#define JOB_CONTROL_CANCEL             3
1336
 
#define JOB_CONTROL_RESTART            4
1337
 
#define JOB_CONTROL_DELETE             5
1338
 
 
1339
 
typedef struct job_info_info
1340
 
{
1341
 
        union
1342
 
        {
1343
 
                JOB_INFO_1 job_info_1;
1344
 
                JOB_INFO_2 job_info_2;
1345
 
        }
1346
 
        job;
1347
 
 
1348
 
}
1349
 
JOB_INFO;
1350
 
 
1351
 
typedef struct spool_q_setjob
1352
 
{
1353
 
        POLICY_HND handle;
1354
 
        uint32 jobid;
1355
 
        uint32 level;
1356
 
        JOB_INFO ctr;
1357
 
        uint32 command;
1358
 
 
1359
 
}
1360
 
SPOOL_Q_SETJOB;
1361
 
 
1362
 
typedef struct spool_r_setjob
1363
 
{
1364
 
        WERROR status;
1365
 
 
1366
 
}
1367
 
SPOOL_R_SETJOB;
1368
 
 
1369
 
typedef struct spool_q_enumprinterdrivers
1370
 
{
1371
 
        uint32 name_ptr;
1372
 
        UNISTR2 name;
1373
 
        uint32 environment_ptr;
1374
 
        UNISTR2 environment;
1375
 
        uint32 level;
1376
 
        RPC_BUFFER *buffer;
1377
 
        uint32 offered;
1378
 
}
1379
 
SPOOL_Q_ENUMPRINTERDRIVERS;
1380
 
 
1381
 
typedef struct spool_r_enumprinterdrivers
1382
 
{
1383
 
        RPC_BUFFER *buffer;
1384
 
        uint32 needed;
1385
 
        uint32 returned;
1386
 
        WERROR status;
1387
 
}
1388
 
SPOOL_R_ENUMPRINTERDRIVERS;
1389
 
 
1390
 
#define FORM_USER    0
1391
 
#define FORM_BUILTIN 1
1392
 
#define FORM_PRINTER 2
1393
 
 
1394
 
typedef struct spool_form_1
1395
 
{
1396
 
        uint32 flag;
1397
 
        UNISTR name;
1398
 
        uint32 width;
1399
 
        uint32 length;
1400
 
        uint32 left;
1401
 
        uint32 top;
1402
 
        uint32 right;
1403
 
        uint32 bottom;
1404
 
}
1405
 
FORM_1;
1406
 
 
1407
 
typedef struct spool_q_enumforms
1408
 
{
1409
 
        POLICY_HND handle;
1410
 
        uint32 level;
1411
 
        RPC_BUFFER *buffer;
1412
 
        uint32 offered;
1413
 
}
1414
 
SPOOL_Q_ENUMFORMS;
1415
 
 
1416
 
typedef struct spool_r_enumforms
1417
 
{
1418
 
        RPC_BUFFER *buffer;
1419
 
        uint32 needed;
1420
 
        uint32 numofforms;
1421
 
        WERROR status;
1422
 
}
1423
 
SPOOL_R_ENUMFORMS;
1424
 
 
1425
 
typedef struct spool_q_getform
1426
 
{
1427
 
        POLICY_HND handle;
1428
 
        UNISTR2 formname;
1429
 
        uint32 level;
1430
 
        RPC_BUFFER *buffer;
1431
 
        uint32 offered;
1432
 
}
1433
 
SPOOL_Q_GETFORM;
1434
 
 
1435
 
typedef struct spool_r_getform
1436
 
{
1437
 
        RPC_BUFFER *buffer;
1438
 
        uint32 needed;
1439
 
        WERROR status;
1440
 
}
1441
 
SPOOL_R_GETFORM;
1442
 
 
1443
 
typedef struct spool_printer_info_level_1
1444
 
{
1445
 
        uint32 flags;
1446
 
        uint32 description_ptr;
1447
 
        uint32 name_ptr;
1448
 
        uint32 comment_ptr;
1449
 
        UNISTR2 description;
1450
 
        UNISTR2 name;
1451
 
        UNISTR2 comment;        
1452
 
} SPOOL_PRINTER_INFO_LEVEL_1;
1453
 
 
1454
 
typedef struct spool_printer_info_level_2
1455
 
{
1456
 
        uint32 servername_ptr;
1457
 
        uint32 printername_ptr;
1458
 
        uint32 sharename_ptr;
1459
 
        uint32 portname_ptr;
1460
 
        uint32 drivername_ptr;
1461
 
        uint32 comment_ptr;
1462
 
        uint32 location_ptr;
1463
 
        uint32 devmode_ptr;
1464
 
        uint32 sepfile_ptr;
1465
 
        uint32 printprocessor_ptr;
1466
 
        uint32 datatype_ptr;
1467
 
        uint32 parameters_ptr;
1468
 
        uint32 secdesc_ptr;
1469
 
        uint32 attributes;
1470
 
        uint32 priority;
1471
 
        uint32 default_priority;
1472
 
        uint32 starttime;
1473
 
        uint32 untiltime;
1474
 
        uint32 status;
1475
 
        uint32 cjobs;
1476
 
        uint32 averageppm;
1477
 
        UNISTR2 servername;
1478
 
        UNISTR2 printername;
1479
 
        UNISTR2 sharename;
1480
 
        UNISTR2 portname;
1481
 
        UNISTR2 drivername;
1482
 
        UNISTR2 comment;
1483
 
        UNISTR2 location;
1484
 
        UNISTR2 sepfile;
1485
 
        UNISTR2 printprocessor;
1486
 
        UNISTR2 datatype;
1487
 
        UNISTR2 parameters;
1488
 
}
1489
 
SPOOL_PRINTER_INFO_LEVEL_2;
1490
 
 
1491
 
typedef struct spool_printer_info_level_3
1492
 
{
1493
 
        uint32 secdesc_ptr;
1494
 
}
1495
 
SPOOL_PRINTER_INFO_LEVEL_3;
1496
 
 
1497
 
typedef struct spool_printer_info_level_7
1498
 
{
1499
 
        uint32 guid_ptr;
1500
 
        uint32 action;
1501
 
        UNISTR2 guid;
1502
 
}
1503
 
SPOOL_PRINTER_INFO_LEVEL_7;
1504
 
 
1505
 
typedef struct spool_printer_info_level
1506
 
{
1507
 
        uint32 level;
1508
 
        uint32 info_ptr;
1509
 
        SPOOL_PRINTER_INFO_LEVEL_1 *info_1;
1510
 
        SPOOL_PRINTER_INFO_LEVEL_2 *info_2;
1511
 
        SPOOL_PRINTER_INFO_LEVEL_3 *info_3;
1512
 
        SPOOL_PRINTER_INFO_LEVEL_7 *info_7;
1513
 
}
1514
 
SPOOL_PRINTER_INFO_LEVEL;
1515
 
 
1516
 
typedef struct spool_printer_driver_info_level_3
1517
 
{
1518
 
        uint32 cversion;
1519
 
        uint32 name_ptr;
1520
 
        uint32 environment_ptr;
1521
 
        uint32 driverpath_ptr;
1522
 
        uint32 datafile_ptr;
1523
 
        uint32 configfile_ptr;
1524
 
        uint32 helpfile_ptr;
1525
 
        uint32 monitorname_ptr;
1526
 
        uint32 defaultdatatype_ptr;
1527
 
        uint32 dependentfilessize;
1528
 
        uint32 dependentfiles_ptr;
1529
 
 
1530
 
        UNISTR2 name;
1531
 
        UNISTR2 environment;
1532
 
        UNISTR2 driverpath;
1533
 
        UNISTR2 datafile;
1534
 
        UNISTR2 configfile;
1535
 
        UNISTR2 helpfile;
1536
 
        UNISTR2 monitorname;
1537
 
        UNISTR2 defaultdatatype;
1538
 
        BUFFER5 dependentfiles;
1539
 
 
1540
 
}
1541
 
SPOOL_PRINTER_DRIVER_INFO_LEVEL_3;
1542
 
 
1543
 
/* SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 structure */
1544
 
typedef struct {
1545
 
        uint32 version;
1546
 
        uint32 name_ptr;
1547
 
        uint32 environment_ptr;
1548
 
        uint32 driverpath_ptr;
1549
 
        uint32 datafile_ptr;
1550
 
        uint32 configfile_ptr;
1551
 
        uint32 helpfile_ptr;
1552
 
        uint32 monitorname_ptr;
1553
 
        uint32 defaultdatatype_ptr;
1554
 
        uint32 dependentfiles_len;
1555
 
        uint32 dependentfiles_ptr;
1556
 
        uint32 previousnames_len;
1557
 
        uint32 previousnames_ptr;
1558
 
        NTTIME  driverdate;
1559
 
        UINT64_S        driverversion;
1560
 
        uint32  dummy4;
1561
 
        uint32 mfgname_ptr;
1562
 
        uint32 oemurl_ptr;
1563
 
        uint32 hardwareid_ptr;
1564
 
        uint32 provider_ptr;
1565
 
        UNISTR2 name;
1566
 
        UNISTR2 environment;
1567
 
        UNISTR2 driverpath;
1568
 
        UNISTR2 datafile;
1569
 
        UNISTR2 configfile;
1570
 
        UNISTR2 helpfile;
1571
 
        UNISTR2 monitorname;
1572
 
        UNISTR2 defaultdatatype;
1573
 
        BUFFER5 dependentfiles;
1574
 
        BUFFER5 previousnames;
1575
 
        UNISTR2 mfgname;
1576
 
        UNISTR2 oemurl;
1577
 
        UNISTR2 hardwareid;
1578
 
        UNISTR2 provider;
1579
 
} SPOOL_PRINTER_DRIVER_INFO_LEVEL_6;
1580
 
 
1581
 
 
1582
 
typedef struct spool_printer_driver_info_level
1583
 
{
1584
 
        uint32 level;
1585
 
        uint32 ptr;
1586
 
        SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *info_3;
1587
 
        SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 *info_6;
1588
 
}
1589
 
SPOOL_PRINTER_DRIVER_INFO_LEVEL;
1590
 
 
1591
 
 
1592
 
typedef struct spool_q_setprinter
1593
 
{
1594
 
        POLICY_HND handle;
1595
 
        uint32 level;
1596
 
        SPOOL_PRINTER_INFO_LEVEL info;
1597
 
        SEC_DESC_BUF *secdesc_ctr;
1598
 
        DEVMODE_CTR devmode_ctr;
1599
 
 
1600
 
        uint32 command;
1601
 
 
1602
 
}
1603
 
SPOOL_Q_SETPRINTER;
1604
 
 
1605
 
typedef struct spool_r_setprinter
1606
 
{
1607
 
        WERROR status;
1608
 
}
1609
 
SPOOL_R_SETPRINTER;
1610
 
 
1611
 
/********************************************/
1612
 
 
1613
 
typedef struct {
1614
 
        POLICY_HND handle;
1615
 
} SPOOL_Q_DELETEPRINTER;
1616
 
 
1617
 
typedef struct {
1618
 
        POLICY_HND handle;
1619
 
        WERROR status;
1620
 
} SPOOL_R_DELETEPRINTER;
1621
 
 
1622
 
/********************************************/
1623
 
 
1624
 
typedef struct {
1625
 
        POLICY_HND handle;
1626
 
} SPOOL_Q_ABORTPRINTER;
1627
 
 
1628
 
typedef struct {
1629
 
        WERROR status;
1630
 
} SPOOL_R_ABORTPRINTER;
1631
 
 
1632
 
 
1633
 
/********************************************/
1634
 
 
1635
 
typedef struct {
1636
 
        UNISTR2 *server_name;
1637
 
        uint32 level;
1638
 
        SPOOL_PRINTER_INFO_LEVEL info;
1639
 
        DEVMODE_CTR devmode_ctr;
1640
 
        SEC_DESC_BUF *secdesc_ctr;
1641
 
        uint32 user_switch;
1642
 
        SPOOL_USER_CTR user_ctr;
1643
 
} SPOOL_Q_ADDPRINTEREX;
1644
 
 
1645
 
typedef struct {
1646
 
        POLICY_HND handle;
1647
 
        WERROR status;
1648
 
} SPOOL_R_ADDPRINTEREX;
1649
 
 
1650
 
/********************************************/
1651
 
 
1652
 
typedef struct spool_q_addprinterdriver
1653
 
{
1654
 
        uint32 server_name_ptr;
1655
 
        UNISTR2 server_name;
1656
 
        uint32 level;
1657
 
        SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1658
 
}
1659
 
SPOOL_Q_ADDPRINTERDRIVER;
1660
 
 
1661
 
typedef struct spool_r_addprinterdriver
1662
 
{
1663
 
        WERROR status;
1664
 
}
1665
 
SPOOL_R_ADDPRINTERDRIVER;
1666
 
 
1667
 
typedef struct spool_q_addprinterdriverex
1668
 
{
1669
 
        uint32 server_name_ptr;
1670
 
        UNISTR2 server_name;
1671
 
        uint32 level;
1672
 
        SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1673
 
        uint32 copy_flags;
1674
 
}
1675
 
SPOOL_Q_ADDPRINTERDRIVEREX;
1676
 
 
1677
 
typedef struct spool_r_addprinterdriverex
1678
 
{
1679
 
        WERROR status;
1680
 
}
1681
 
SPOOL_R_ADDPRINTERDRIVEREX;
1682
 
 
1683
 
 
1684
 
typedef struct driver_directory_1
1685
 
{
1686
 
        UNISTR name;
1687
 
}
1688
 
DRIVER_DIRECTORY_1;
1689
 
 
1690
 
typedef struct driver_info_ctr_info
1691
 
{
1692
 
        DRIVER_DIRECTORY_1 *info1;
1693
 
}
1694
 
DRIVER_DIRECTORY_CTR;
1695
 
 
1696
 
typedef struct spool_q_getprinterdriverdirectory
1697
 
{
1698
 
        uint32 name_ptr;
1699
 
        UNISTR2 name;
1700
 
        uint32 environment_ptr;
1701
 
        UNISTR2 environment;
1702
 
        uint32 level;
1703
 
        RPC_BUFFER *buffer;
1704
 
        uint32 offered;
1705
 
}
1706
 
SPOOL_Q_GETPRINTERDRIVERDIR;
1707
 
 
1708
 
typedef struct spool_r_getprinterdriverdirectory
1709
 
{
1710
 
        RPC_BUFFER *buffer;
1711
 
        uint32 needed;
1712
 
        WERROR status;
1713
 
}
1714
 
SPOOL_R_GETPRINTERDRIVERDIR;
1715
 
 
1716
 
typedef struct spool_q_addprintprocessor
1717
 
{
1718
 
        uint32 server_ptr;
1719
 
        UNISTR2 server;
1720
 
        UNISTR2 environment;
1721
 
        UNISTR2 path;
1722
 
        UNISTR2 name;
1723
 
}
1724
 
SPOOL_Q_ADDPRINTPROCESSOR;
1725
 
 
1726
 
typedef struct spool_r_addprintprocessor
1727
 
{
1728
 
        WERROR status;
1729
 
}
1730
 
SPOOL_R_ADDPRINTPROCESSOR;
1731
 
 
1732
 
 
1733
 
typedef struct spool_q_enumprintprocessors
1734
 
{
1735
 
        uint32 name_ptr;
1736
 
        UNISTR2 name;
1737
 
        uint32 environment_ptr;
1738
 
        UNISTR2 environment;
1739
 
        uint32 level;
1740
 
        RPC_BUFFER *buffer;
1741
 
        uint32 offered;
1742
 
}
1743
 
SPOOL_Q_ENUMPRINTPROCESSORS;
1744
 
 
1745
 
typedef struct printprocessor_1
1746
 
{
1747
 
        UNISTR name;
1748
 
}
1749
 
PRINTPROCESSOR_1;
1750
 
 
1751
 
typedef struct spool_r_enumprintprocessors
1752
 
{
1753
 
        RPC_BUFFER *buffer;
1754
 
        uint32 needed;
1755
 
        uint32 returned;
1756
 
        WERROR status;
1757
 
}
1758
 
SPOOL_R_ENUMPRINTPROCESSORS;
1759
 
 
1760
 
typedef struct spool_q_enumprintprocdatatypes
1761
 
{
1762
 
        uint32 name_ptr;
1763
 
        UNISTR2 name;
1764
 
        uint32 processor_ptr;
1765
 
        UNISTR2 processor;
1766
 
        uint32 level;
1767
 
        RPC_BUFFER *buffer;
1768
 
        uint32 offered;
1769
 
}
1770
 
SPOOL_Q_ENUMPRINTPROCDATATYPES;
1771
 
 
1772
 
typedef struct ppdatatype_1
1773
 
{
1774
 
        UNISTR name;
1775
 
}
1776
 
PRINTPROCDATATYPE_1;
1777
 
 
1778
 
typedef struct spool_r_enumprintprocdatatypes
1779
 
{
1780
 
        RPC_BUFFER *buffer;
1781
 
        uint32 needed;
1782
 
        uint32 returned;
1783
 
        WERROR status;
1784
 
}
1785
 
SPOOL_R_ENUMPRINTPROCDATATYPES;
1786
 
 
1787
 
typedef struct printmonitor_1
1788
 
{
1789
 
        UNISTR name;
1790
 
}
1791
 
PRINTMONITOR_1;
1792
 
 
1793
 
typedef struct printmonitor_2
1794
 
{
1795
 
        UNISTR name;
1796
 
        UNISTR environment;
1797
 
        UNISTR dll_name;
1798
 
}
1799
 
PRINTMONITOR_2;
1800
 
 
1801
 
typedef struct spool_q_enumprintmonitors
1802
 
{
1803
 
        uint32 name_ptr;
1804
 
        UNISTR2 name;
1805
 
        uint32 level;
1806
 
        RPC_BUFFER *buffer;
1807
 
        uint32 offered;
1808
 
}
1809
 
SPOOL_Q_ENUMPRINTMONITORS;
1810
 
 
1811
 
typedef struct spool_r_enumprintmonitors
1812
 
{
1813
 
        RPC_BUFFER *buffer;
1814
 
        uint32 needed;
1815
 
        uint32 returned;
1816
 
        WERROR status;
1817
 
}
1818
 
SPOOL_R_ENUMPRINTMONITORS;
1819
 
 
1820
 
 
1821
 
typedef struct spool_q_enumprinterdata
1822
 
{
1823
 
        POLICY_HND handle;
1824
 
        uint32 index;
1825
 
        uint32 valuesize;
1826
 
        uint32 datasize;
1827
 
}
1828
 
SPOOL_Q_ENUMPRINTERDATA;
1829
 
 
1830
 
typedef struct spool_r_enumprinterdata
1831
 
{
1832
 
        uint32 valuesize;
1833
 
        uint16 *value;
1834
 
        uint32 realvaluesize;
1835
 
        uint32 type;
1836
 
        uint32 datasize;
1837
 
        uint8 *data;
1838
 
        uint32 realdatasize;
1839
 
        WERROR status;
1840
 
}
1841
 
SPOOL_R_ENUMPRINTERDATA;
1842
 
 
1843
 
typedef struct spool_q_setprinterdata
1844
 
{
1845
 
        POLICY_HND handle;
1846
 
        UNISTR2 value;
1847
 
        uint32 type;
1848
 
        uint32 max_len;
1849
 
        uint8 *data;
1850
 
        uint32 real_len;
1851
 
        uint32 numeric_data;
1852
 
}
1853
 
SPOOL_Q_SETPRINTERDATA;
1854
 
 
1855
 
typedef struct spool_r_setprinterdata
1856
 
{
1857
 
        WERROR status;
1858
 
}
1859
 
SPOOL_R_SETPRINTERDATA;
1860
 
 
1861
 
typedef struct spool_q_resetprinter
1862
 
{
1863
 
        POLICY_HND handle;
1864
 
        uint32 datatype_ptr;
1865
 
        UNISTR2 datatype;
1866
 
        DEVMODE_CTR devmode_ctr;
1867
 
 
1868
 
} SPOOL_Q_RESETPRINTER;
1869
 
 
1870
 
typedef struct spool_r_resetprinter
1871
 
{
1872
 
        WERROR status;
1873
 
1874
 
SPOOL_R_RESETPRINTER;
1875
 
 
1876
 
 
1877
 
 
1878
 
typedef struct _form
1879
 
{
1880
 
        uint32 flags;
1881
 
        uint32 name_ptr;
1882
 
        uint32 size_x;
1883
 
        uint32 size_y;
1884
 
        uint32 left;
1885
 
        uint32 top;
1886
 
        uint32 right;
1887
 
        uint32 bottom;
1888
 
        UNISTR2 name;
1889
 
}
1890
 
FORM;
1891
 
 
1892
 
typedef struct spool_q_addform
1893
 
{
1894
 
        POLICY_HND handle;
1895
 
        uint32 level;
1896
 
        uint32 level2;          /* This should really be part of the FORM structure */
1897
 
        FORM form;
1898
 
}
1899
 
SPOOL_Q_ADDFORM;
1900
 
 
1901
 
typedef struct spool_r_addform
1902
 
{
1903
 
        WERROR status;
1904
 
}
1905
 
SPOOL_R_ADDFORM;
1906
 
 
1907
 
typedef struct spool_q_setform
1908
 
{
1909
 
        POLICY_HND handle;
1910
 
        UNISTR2 name;
1911
 
        uint32 level;
1912
 
        uint32 level2;
1913
 
        FORM form;
1914
 
}
1915
 
SPOOL_Q_SETFORM;
1916
 
 
1917
 
typedef struct spool_r_setform
1918
 
{
1919
 
        WERROR status;
1920
 
}
1921
 
SPOOL_R_SETFORM;
1922
 
 
1923
 
typedef struct spool_q_deleteform
1924
 
{
1925
 
        POLICY_HND handle;
1926
 
        UNISTR2 name;
1927
 
}
1928
 
SPOOL_Q_DELETEFORM;
1929
 
 
1930
 
typedef struct spool_r_deleteform
1931
 
{
1932
 
        WERROR status;
1933
 
}
1934
 
SPOOL_R_DELETEFORM;
1935
 
 
1936
 
typedef struct spool_q_getjob
1937
 
{
1938
 
        POLICY_HND handle;
1939
 
        uint32 jobid;
1940
 
        uint32 level;
1941
 
        RPC_BUFFER *buffer;
1942
 
        uint32 offered;
1943
 
}
1944
 
SPOOL_Q_GETJOB;
1945
 
 
1946
 
typedef struct pjob_info_info
1947
 
{
1948
 
        union
1949
 
        {
1950
 
                JOB_INFO_1 *job_info_1;
1951
 
                JOB_INFO_2 *job_info_2;
1952
 
                void *info;
1953
 
        }
1954
 
        job;
1955
 
 
1956
 
}
1957
 
PJOB_INFO;
1958
 
 
1959
 
typedef struct spool_r_getjob
1960
 
{
1961
 
        RPC_BUFFER *buffer;
1962
 
        uint32 needed;
1963
 
        WERROR status;
1964
 
}
1965
 
SPOOL_R_GETJOB;
1966
 
 
1967
 
typedef struct spool_q_replyopenprinter
1968
 
{
1969
 
        UNISTR2 string;
1970
 
        uint32 printer;
1971
 
        uint32 type;
1972
 
        uint32 unknown0;
1973
 
        uint32 unknown1;
1974
 
}
1975
 
SPOOL_Q_REPLYOPENPRINTER;
1976
 
 
1977
 
typedef struct spool_r_replyopenprinter
1978
 
{
1979
 
        POLICY_HND handle;
1980
 
        WERROR status;
1981
 
}
1982
 
SPOOL_R_REPLYOPENPRINTER;
1983
 
 
1984
 
typedef struct spool_q_routerreplyprinter
1985
 
{
1986
 
        POLICY_HND handle;
1987
 
        uint32 condition;
1988
 
        uint32 unknown1;        /* 0x00000001 */
1989
 
        uint32 change_id;
1990
 
        uint8  unknown2[5];     /* 0x0000000001 */
1991
 
}
1992
 
SPOOL_Q_ROUTERREPLYPRINTER;
1993
 
 
1994
 
typedef struct spool_r_routerreplyprinter
1995
 
{
1996
 
        WERROR status;
1997
 
}
1998
 
SPOOL_R_ROUTERREPLYPRINTER;
1999
 
 
2000
 
typedef struct spool_q_replycloseprinter
2001
 
{
2002
 
        POLICY_HND handle;
2003
 
}
2004
 
SPOOL_Q_REPLYCLOSEPRINTER;
2005
 
 
2006
 
typedef struct spool_r_replycloseprinter
2007
 
{
2008
 
        POLICY_HND handle;
2009
 
        WERROR status;
2010
 
}
2011
 
SPOOL_R_REPLYCLOSEPRINTER;
2012
 
 
2013
 
typedef struct spool_q_rrpcn
2014
 
{
2015
 
        POLICY_HND handle;
2016
 
        uint32 change_low;
2017
 
        uint32 change_high;
2018
 
        uint32 unknown0;
2019
 
        uint32 unknown1;
2020
 
        uint32 info_ptr;
2021
 
        SPOOL_NOTIFY_INFO info; 
2022
 
}
2023
 
SPOOL_Q_REPLY_RRPCN;
2024
 
 
2025
 
typedef struct spool_r_rrpcn
2026
 
{
2027
 
        uint32 unknown0;
2028
 
        WERROR status;
2029
 
}
2030
 
SPOOL_R_REPLY_RRPCN;
2031
 
 
2032
 
typedef struct spool_q_getprinterdataex
2033
 
{
2034
 
        POLICY_HND handle;
2035
 
        UNISTR2 keyname;
2036
 
        UNISTR2 valuename;
2037
 
        uint32 size;
2038
 
}
2039
 
SPOOL_Q_GETPRINTERDATAEX;
2040
 
 
2041
 
typedef struct spool_r_getprinterdataex
2042
 
{
2043
 
        uint32 type;
2044
 
        uint32 size;
2045
 
        uint8 *data;
2046
 
        uint32 needed;
2047
 
        WERROR status;
2048
 
}
2049
 
SPOOL_R_GETPRINTERDATAEX;
2050
 
 
2051
 
typedef struct spool_q_setprinterdataex
2052
 
{
2053
 
        POLICY_HND handle;
2054
 
        UNISTR2 key;
2055
 
        UNISTR2 value;
2056
 
        uint32 type;
2057
 
        uint32 max_len;
2058
 
        uint8 *data;
2059
 
        uint32 real_len;
2060
 
        uint32 numeric_data;
2061
 
}
2062
 
SPOOL_Q_SETPRINTERDATAEX;
2063
 
 
2064
 
typedef struct spool_r_setprinterdataex
2065
 
{
2066
 
        WERROR status;
2067
 
}
2068
 
SPOOL_R_SETPRINTERDATAEX;
2069
 
 
2070
 
 
2071
 
typedef struct spool_q_deleteprinterdataex
2072
 
{
2073
 
        POLICY_HND handle;
2074
 
        UNISTR2 keyname;
2075
 
        UNISTR2 valuename;
2076
 
}
2077
 
SPOOL_Q_DELETEPRINTERDATAEX;
2078
 
 
2079
 
typedef struct spool_r_deleteprinterdataex
2080
 
{
2081
 
        WERROR status;
2082
 
}
2083
 
SPOOL_R_DELETEPRINTERDATAEX;
2084
 
 
2085
 
 
2086
 
typedef struct spool_q_enumprinterkey
2087
 
{
2088
 
        POLICY_HND handle;
2089
 
        UNISTR2 key;
2090
 
        uint32 size;
2091
 
}
2092
 
SPOOL_Q_ENUMPRINTERKEY;
2093
 
 
2094
 
typedef struct spool_r_enumprinterkey
2095
 
{
2096
 
        BUFFER5 keys;
2097
 
        uint32 needed;  /* in bytes */
2098
 
        WERROR status;
2099
 
}
2100
 
SPOOL_R_ENUMPRINTERKEY;
2101
 
 
2102
 
typedef struct spool_q_deleteprinterkey
2103
 
{
2104
 
        POLICY_HND handle;
2105
 
        UNISTR2 keyname;
2106
 
}
2107
 
SPOOL_Q_DELETEPRINTERKEY;
2108
 
 
2109
 
typedef struct spool_r_deleteprinterkey
2110
 
{
2111
 
        WERROR status;
2112
 
}
2113
 
SPOOL_R_DELETEPRINTERKEY;
2114
 
 
2115
 
typedef struct printer_enum_values
2116
 
{
2117
 
        UNISTR valuename;
2118
 
        uint32 value_len;
2119
 
        uint32 type;
2120
 
        uint8  *data;
2121
 
        uint32 data_len; 
2122
 
        
2123
 
}
2124
 
PRINTER_ENUM_VALUES;
2125
 
 
2126
 
typedef struct printer_enum_values_ctr
2127
 
{
2128
 
        uint32 size;
2129
 
        uint32 size_of_array;
2130
 
        PRINTER_ENUM_VALUES *values;
2131
 
}
2132
 
PRINTER_ENUM_VALUES_CTR;
2133
 
 
2134
 
typedef struct spool_q_enumprinterdataex
2135
 
{
2136
 
        POLICY_HND handle;
2137
 
        UNISTR2 key;
2138
 
        uint32 size;
2139
 
}
2140
 
SPOOL_Q_ENUMPRINTERDATAEX;
2141
 
 
2142
 
typedef struct spool_r_enumprinterdataex
2143
 
{
2144
 
        PRINTER_ENUM_VALUES_CTR ctr;
2145
 
        uint32 needed;
2146
 
        uint32 returned;
2147
 
        WERROR status;
2148
 
}
2149
 
SPOOL_R_ENUMPRINTERDATAEX;
2150
 
 
2151
 
typedef struct printprocessor_directory_1
2152
 
{
2153
 
        UNISTR name;
2154
 
}
2155
 
PRINTPROCESSOR_DIRECTORY_1;
2156
 
 
2157
 
typedef struct spool_q_getprintprocessordirectory
2158
 
{
2159
 
        UNISTR2 name;
2160
 
        UNISTR2 environment;
2161
 
        uint32 level;
2162
 
        RPC_BUFFER *buffer;
2163
 
        uint32 offered;
2164
 
}
2165
 
SPOOL_Q_GETPRINTPROCESSORDIRECTORY;
2166
 
 
2167
 
typedef struct spool_r_getprintprocessordirectory
2168
 
{
2169
 
        RPC_BUFFER *buffer;
2170
 
        uint32 needed;
2171
 
        WERROR status;
2172
 
}
2173
 
SPOOL_R_GETPRINTPROCESSORDIRECTORY;
2174
 
 
2175
 
/**************************************/
2176
 
 
2177
 
#define MAX_PORTNAME            64
2178
 
#define MAX_NETWORK_NAME        49
2179
 
#define MAX_SNMP_COMM_NAME      33
2180
 
#define MAX_QUEUE_NAME          33
2181
 
#define MAX_IPADDR_STRING       17
2182
 
                
2183
 
typedef struct {
2184
 
        uint16 portname[MAX_PORTNAME];
2185
 
        uint32 version;
2186
 
        uint32 protocol;
2187
 
        uint32 size;
2188
 
        uint32 reserved;
2189
 
        uint16 hostaddress[MAX_NETWORK_NAME];
2190
 
        uint16 snmpcommunity[MAX_SNMP_COMM_NAME];
2191
 
        uint32 dblspool;
2192
 
        uint16 queue[MAX_QUEUE_NAME];
2193
 
        uint16 ipaddress[MAX_IPADDR_STRING];
2194
 
        uint32 port;
2195
 
        uint32 snmpenabled;
2196
 
        uint32 snmpdevindex;
2197
 
} SPOOL_PORT_DATA_1;
2198
 
 
2199
 
typedef struct {
2200
 
        POLICY_HND handle;
2201
 
        UNISTR2 dataname;
2202
 
        RPC_BUFFER indata;
2203
 
        uint32 indata_len;
2204
 
        uint32 offered;
2205
 
        uint32 unknown;
2206
 
} SPOOL_Q_XCVDATAPORT;
2207
 
 
2208
 
typedef struct {
2209
 
        RPC_BUFFER outdata;
2210
 
        uint32 needed;
2211
 
        uint32 unknown;
2212
 
        WERROR status;
2213
 
} SPOOL_R_XCVDATAPORT;
2214
 
 
2215
 
#define PRINTER_DRIVER_VERSION 2
2216
 
#define PRINTER_DRIVER_ARCHITECTURE "Windows NT x86"
2217
 
 
2218
 
#endif /* _RPC_SPOOLSS_H */
2219