0afc8d2b5d3bd419b7c9dc1bef936223ad45e3cc
[ira/wip.git] / source3 / include / rpc_spoolss.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    SMB parameters and setup
5    Copyright (C) Andrew Tridgell 1992-1998
6    Copyright (C) Luke Kenneth Casson Leighton 1996-1998
7    Copyright (C) Jean Francois Micouleau 1998-1999
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 #define INTEGER 1
28 #define STRING 2
29
30 /* spoolss pipe: this are the calls which are not implemented ...
31 #define SPOOLSS_OPENPRINTER                             0x01
32 #define SPOOLSS_DELETEPRINTER                           0x06
33 #define SPOOLSS_GETPRINTERDRIVER                        0x0b
34 #define SPOOLSS_DELETEPRINTERDRIVER                     0x0d
35 #define SPOOLSS_ADDPRINTPROCESSOR                       0x0e
36 #define SPOOLSS_GETPRINTPROCESSORDIRECTORY              0x10
37 #define SPOOLSS_ABORTPRINTER                            0x15
38 #define SPOOLSS_READPRINTER                             0x16
39 #define SPOOLSS_WAITFORPRINTERCHANGE                    0x1c
40 #define SPOOLSS_DELETEFORM                              0x1f
41 #define SPOOLSS_GETFORM                                 0x20
42 #define SPOOLSS_ADDPORT                                 0x25
43 #define SPOOLSS_CONFIGUREPORT                           0x26
44 #define SPOOLSS_DELETEPORT                              0x27
45 #define SPOOLSS_CREATEPRINTERIC                         0x28
46 #define SPOOLSS_PLAYGDISCRIPTONPRINTERIC                0x29
47 #define SPOOLSS_DELETEPRINTERIC                         0x2a
48 #define SPOOLSS_ADDPRINTERCONNECTION                    0x2b
49 #define SPOOLSS_DELETEPRINTERCONNECTION                 0x2c
50 #define SPOOLSS_PRINTERMESSAGEBOX                       0x2d
51 #define SPOOLSS_ADDMONITOR                              0x2e
52 #define SPOOLSS_DELETEMONITOR                           0x2f
53 #define SPOOLSS_DELETEPRINTPROCESSOR                    0x30
54 #define SPOOLSS_ADDPRINTPROVIDOR                        0x31
55 #define SPOOLSS_DELETEPRINTPROVIDOR                     0x32
56 #define SPOOLSS_RESETPRINTER                            0x34
57 #define SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION      0x36
58 #define SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION       0x37
59 #define SPOOLSS_ROUTERFINDFIRSTPRINTERNOTIFICATIONOLD   0x39
60 #define SPOOLSS_REPLYOPENPRINTER                        0x3a
61 #define SPOOLSS_ROUTERREPLYPRINTER                      0x3b
62 #define SPOOLSS_REPLYCLOSEPRINTER                       0x3c
63 #define SPOOLSS_ADDPORTEX                               0x3d
64 #define SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFICATION0x3e
65 #define SPOOLSS_SPOOLERINIT                             0x3f
66 #define SPOOLSS_RESETPRINTEREX                          0x40
67 #define SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFICATION  0x42
68 */
69
70 /* those are implemented */
71
72 #define SPOOLSS_ENUMPRINTERS                            0x00
73 #define SPOOLSS_SETJOB                                  0x02
74 #define SPOOLSS_GETJOB                                  0x03
75 #define SPOOLSS_ENUMJOBS                                0x04
76 #define SPOOLSS_ADDPRINTER                              0x05
77 #define SPOOLSS_SETPRINTER                              0x07
78 #define SPOOLSS_GETPRINTER                              0x08
79 #define SPOOLSS_ADDPRINTERDRIVER                        0x09
80 #define SPOOLSS_ENUMPRINTERDRIVERS                      0x0a
81 #define SPOOLSS_GETPRINTERDRIVERDIRECTORY               0x0c
82 #define SPOOLSS_ENUMPRINTPROCESSORS                     0x0f
83 #define SPOOLSS_STARTDOCPRINTER                         0x11
84 #define SPOOLSS_STARTPAGEPRINTER                        0x12
85 #define SPOOLSS_WRITEPRINTER                            0x13
86 #define SPOOLSS_ENDPAGEPRINTER                          0x14
87 #define SPOOLSS_ENDDOCPRINTER                           0x17
88 #define SPOOLSS_ADDJOB                                  0x18
89 #define SPOOLSS_SCHEDULEJOB                             0x19
90 #define SPOOLSS_GETPRINTERDATA                          0x1a
91 #define SPOOLSS_SETPRINTERDATA                          0x1b
92 #define SPOOLSS_CLOSEPRINTER                            0x1d
93 #define SPOOLSS_ADDFORM                                 0x1e
94 #define SPOOLSS_SETFORM                                 0x21
95 #define SPOOLSS_ENUMFORMS                               0x22
96 #define SPOOLSS_ENUMPORTS                               0x23
97 #define SPOOLSS_ENUMMONITORS                            0x24
98 #define SPOOLSS_ENUMPRINTPROCESSORDATATYPES             0x33
99 #define SPOOLSS_GETPRINTERDRIVER2                       0x35
100 /* find close printer notification */
101 #define SPOOLSS_FCPN                                    0x38
102 /* remote find first printer change notifyEx */
103 #define SPOOLSS_RFFPCNEX                                0x41
104 /* remote find next printer change notifyEx */
105 #define SPOOLSS_RFNPCNEX                                0x43
106 #define SPOOLSS_OPENPRINTEREX                           0x45
107 #define SPOOLSS_ADDPRINTEREX                            0x46
108 #define SPOOLSS_ENUMPRINTERDATA                         0x48
109
110
111 #define SERVER_ACCESS_ADMINISTER        0x00000001
112 #define SERVER_ACCESS_ENUMERATE         0x00000002
113
114 #define PRINTER_ACCESS_ADMINISTER       0x00000004
115 #define PRINTER_ACCESS_USE              0x00000008
116
117 #define PRINTER_CONTROL_UNPAUSE         0x00000000
118 #define PRINTER_CONTROL_PAUSE           0x00000001
119 #define PRINTER_CONTROL_RESUME          0x00000002
120 #define PRINTER_CONTROL_PURGE           0x00000003
121 #define PRINTER_CONTROL_SET_STATUS      0x00000004
122
123 #define PRINTER_STATUS_PAUSED           0x00000001
124 #define PRINTER_STATUS_ERROR            0x00000002
125 #define PRINTER_STATUS_PENDING_DELETION 0x00000004
126 #define PRINTER_STATUS_PAPER_JAM        0x00000008
127
128 #define PRINTER_STATUS_PAPER_OUT        0x00000010
129 #define PRINTER_STATUS_MANUAL_FEED      0x00000020
130 #define PRINTER_STATUS_PAPER_PROBLEM    0x00000040
131 #define PRINTER_STATUS_OFFLINE          0x00000080
132
133 #define PRINTER_STATUS_IO_ACTIVE        0x00000100
134 #define PRINTER_STATUS_BUSY             0x00000200
135 #define PRINTER_STATUS_PRINTING         0x00000400
136 #define PRINTER_STATUS_OUTPUT_BIN_FULL  0x00000800
137
138 #define PRINTER_STATUS_NOT_AVAILABLE    0x00001000
139 #define PRINTER_STATUS_WAITING          0x00002000
140 #define PRINTER_STATUS_PROCESSING       0x00004000
141 #define PRINTER_STATUS_INITIALIZING     0x00008000
142
143 #define PRINTER_STATUS_WARMING_UP       0x00010000
144 #define PRINTER_STATUS_TONER_LOW        0x00020000
145 #define PRINTER_STATUS_NO_TONER         0x00040000
146 #define PRINTER_STATUS_PAGE_PUNT        0x00080000
147
148 #define PRINTER_STATUS_USER_INTERVENTION        0x00100000
149 #define PRINTER_STATUS_OUT_OF_MEMORY    0x00200000
150 #define PRINTER_STATUS_DOOR_OPEN        0x00400000
151 #define PRINTER_STATUS_SERVER_UNKNOWN   0x00800000
152
153 #define PRINTER_STATUS_POWER_SAVE       0x01000000
154
155 #define JOB_ACCESS_ADMINISTER           0x00000010
156
157 #define STANDARD_RIGHTS_READ            0x00020000
158 #define STANDARD_RIGHTS_WRITE           STANDARD_RIGHTS_READ
159 #define STANDARD_RIGHTS_EXECUTE         STANDARD_RIGHTS_READ
160 #define STANDARD_RIGHTS_REQUIRED        0x000F0000
161
162 /* Access rights for print servers */
163 #define SERVER_ALL_ACCESS       STANDARD_RIGHTS_REQUIRED|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE
164 #define SERVER_READ             STANDARD_RIGHTS_READ|SERVER_ACCESS_ENUMERATE
165 #define SERVER_WRITE            STANDARD_RIGHTS_WRITE|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE
166 #define SERVER_EXECUTE          STANDARD_RIGHTS_EXECUTE|SERVER_ACCESS_ENUMERATE
167
168 /* Access rights for printers */
169 #define PRINTER_ALL_ACCESS      STANDARD_RIGHTS_REQUIRED|PRINTER_ACCESS_ADMINISTER|PRINTER_ACCESS_USE
170 #define PRINTER_READ          STANDARD_RIGHTS_READ|PRINTER_ACCESS_USE
171 #define PRINTER_WRITE         STANDARD_RIGHTS_WRITE|PRINTER_ACCESS_USE
172 #define PRINTER_EXECUTE       STANDARD_RIGHTS_EXECUTE|PRINTER_ACCESS_USE
173
174 /* Access rights for jobs */
175 #define JOB_ALL_ACCESS  STANDARD_RIGHTS_REQUIRED|JOB_ACCESS_ADMINISTER
176 #define JOB_READ        STANDARD_RIGHTS_READ|JOB_ACCESS_ADMINISTER
177 #define JOB_WRITE       STANDARD_RIGHTS_WRITE|JOB_ACCESS_ADMINISTER
178 #define JOB_EXECUTE     STANDARD_RIGHTS_EXECUTE|JOB_ACCESS_ADMINISTER
179
180 #define PRINTER_HND_SIZE 20
181
182 #define ONE_VALUE 01
183 #define TWO_VALUE 02
184 #define POINTER   03
185
186 #define PRINTER_NOTIFY_TYPE 0x00
187 #define JOB_NOTIFY_TYPE     0x01
188
189 #define MAX_PRINTER_NOTIFY 26
190
191 #define PRINTER_NOTIFY_SERVER_NAME              0x00
192 #define PRINTER_NOTIFY_PRINTER_NAME             0x01
193 #define PRINTER_NOTIFY_SHARE_NAME               0x02
194 #define PRINTER_NOTIFY_PORT_NAME                0x03
195 #define PRINTER_NOTIFY_DRIVER_NAME              0x04
196 #define PRINTER_NOTIFY_COMMENT                  0x05
197 #define PRINTER_NOTIFY_LOCATION                 0x06
198 #define PRINTER_NOTIFY_DEVMODE                  0x07
199 #define PRINTER_NOTIFY_SEPFILE                  0x08
200 #define PRINTER_NOTIFY_PRINT_PROCESSOR          0x09
201 #define PRINTER_NOTIFY_PARAMETERS               0x0A
202 #define PRINTER_NOTIFY_DATATYPE                 0x0B
203 #define PRINTER_NOTIFY_SECURITY_DESCRIPTOR      0x0C
204 #define PRINTER_NOTIFY_ATTRIBUTES               0x0D
205 #define PRINTER_NOTIFY_PRIORITY                 0x0E
206 #define PRINTER_NOTIFY_DEFAULT_PRIORITY         0x0F
207 #define PRINTER_NOTIFY_START_TIME               0x10
208 #define PRINTER_NOTIFY_UNTIL_TIME               0x11
209 #define PRINTER_NOTIFY_STATUS                   0x12
210 #define PRINTER_NOTIFY_STATUS_STRING            0x13
211 #define PRINTER_NOTIFY_CJOBS                    0x14
212 #define PRINTER_NOTIFY_AVERAGE_PPM              0x15
213 #define PRINTER_NOTIFY_TOTAL_PAGES              0x16
214 #define PRINTER_NOTIFY_PAGES_PRINTED            0x17
215 #define PRINTER_NOTIFY_TOTAL_BYTES              0x18
216 #define PRINTER_NOTIFY_BYTES_PRINTED            0x19
217
218 #define MAX_JOB_NOTIFY 24
219
220 #define JOB_NOTIFY_PRINTER_NAME                 0x00
221 #define JOB_NOTIFY_MACHINE_NAME                 0x01
222 #define JOB_NOTIFY_PORT_NAME                    0x02
223 #define JOB_NOTIFY_USER_NAME                    0x03
224 #define JOB_NOTIFY_NOTIFY_NAME                  0x04
225 #define JOB_NOTIFY_DATATYPE                     0x05
226 #define JOB_NOTIFY_PRINT_PROCESSOR              0x06
227 #define JOB_NOTIFY_PARAMETERS                   0x07
228 #define JOB_NOTIFY_DRIVER_NAME                  0x08
229 #define JOB_NOTIFY_DEVMODE                      0x09
230 #define JOB_NOTIFY_STATUS                       0x0A
231 #define JOB_NOTIFY_STATUS_STRING                0x0B
232 #define JOB_NOTIFY_SECURITY_DESCRIPTOR          0x0C
233 #define JOB_NOTIFY_DOCUMENT                     0x0D
234 #define JOB_NOTIFY_PRIORITY                     0x0E
235 #define JOB_NOTIFY_POSITION                     0x0F
236 #define JOB_NOTIFY_SUBMITTED                    0x10
237 #define JOB_NOTIFY_START_TIME                   0x11
238 #define JOB_NOTIFY_UNTIL_TIME                   0x12
239 #define JOB_NOTIFY_TIME                         0x13
240 #define JOB_NOTIFY_TOTAL_PAGES                  0x14
241 #define JOB_NOTIFY_PAGES_PRINTED                0x15
242 #define JOB_NOTIFY_TOTAL_BYTES                  0x16
243 #define JOB_NOTIFY_BYTES_PRINTED                0x17
244
245 /*
246  * The printer attributes.
247  * I #defined all of them (grabbed form MSDN)
248  * I'm only using:
249  * ( SHARED | NETWORK | RAW_ONLY )
250  * RAW_ONLY _MUST_ be present otherwise NT will send an EMF file
251  */
252  
253 #define PRINTER_ATTRIBUTE_QUEUED                0x00000001
254 #define PRINTER_ATTRIBUTE_DIRECT                0x00000002
255 #define PRINTER_ATTRIBUTE_DEFAULT               0x00000004
256 #define PRINTER_ATTRIBUTE_SHARED                0x00000008
257
258 #define PRINTER_ATTRIBUTE_NETWORK               0x00000010
259 #define PRINTER_ATTRIBUTE_HIDDEN                0x00000020
260 #define PRINTER_ATTRIBUTE_LOCAL                 0x00000040
261 #define PRINTER_ATTRIBUTE_ENABLE_DEVQ           0x00000080
262
263 #define PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS       0x00000100
264 #define PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST     0x00000200
265 #define PRINTER_ATTRIBUTE_WORK_OFFLINE          0x00000400
266 #define PRINTER_ATTRIBUTE_ENABLE_BIDI           0x00000800
267
268 #define PRINTER_ATTRIBUTE_RAW_ONLY              0x00001000
269
270 #define NO_PRIORITY      0
271 #define MAX_PRIORITY    99
272 #define MIN_PRIORITY     1
273 #define DEF_PRIORITY     1
274
275 #define PRINTER_ENUM_DEFAULT            0x00000001
276 #define PRINTER_ENUM_LOCAL              0x00000002
277 #define PRINTER_ENUM_CONNECTIONS        0x00000004
278 #define PRINTER_ENUM_FAVORITE           0x00000004
279 #define PRINTER_ENUM_NAME               0x00000008
280 #define PRINTER_ENUM_REMOTE             0x00000010
281 #define PRINTER_ENUM_SHARED             0x00000020
282 #define PRINTER_ENUM_NETWORK            0x00000040
283
284 #define PRINTER_ENUM_EXPAND             0x00004000
285 #define PRINTER_ENUM_CONTAINER          0x00008000
286
287 #define PRINTER_ENUM_ICONMASK           0x00ff0000
288 #define PRINTER_ENUM_ICON1              0x00010000
289 #define PRINTER_ENUM_ICON2              0x00020000
290 #define PRINTER_ENUM_ICON3              0x00040000
291 #define PRINTER_ENUM_ICON4              0x00080000
292 #define PRINTER_ENUM_ICON5              0x00100000
293 #define PRINTER_ENUM_ICON6              0x00200000
294 #define PRINTER_ENUM_ICON7              0x00400000
295 #define PRINTER_ENUM_ICON8              0x00800000
296
297 typedef struct
298 {
299         char name[100];
300         uint32 flag;
301         uint32 width;
302         uint32 length;
303         uint32 left;
304         uint32 top;
305         uint32 right;
306         uint32 bottom;
307 } nt_forms_struct;
308
309 typedef struct 
310 {
311         char name[100];
312         char architecture[100];
313         uint32 version;
314         char default_form[30];
315         uint32 color_flag;
316         char driver[100];
317         char datafile[100];
318         char configfile[100];
319         char helpfile[100];
320         char monitor[100];
321         char monitor_name[100];
322         char **dependant;
323 } nt_drivers_struct;
324
325 typedef struct devicemode
326 {
327         UNISTR  devicename;
328         uint16  specversion;
329         uint16  driverversion;
330         uint16  size;
331         uint16  driverextra;
332         uint32  fields;
333         uint16  orientation;
334         uint16  papersize;
335         uint16  paperlength;
336         uint16  paperwidth;
337         uint16  scale;
338         uint16  copies;
339         uint16  defaultsource;
340         uint16  printquality;
341         uint16  color;
342         uint16  duplex;
343         uint16  yresolution;
344         uint16  ttoption;
345         uint16  collate;
346         UNISTR  formname;
347         uint16  logpixels;
348         uint32  bitsperpel;
349         uint32  pelswidth;
350         uint32  pelsheight;
351         uint32  displayflags;
352         uint32  displayfrequency;
353         uint32  icmmethod;
354         uint32  icmintent;
355         uint32  mediatype;
356         uint32  dithertype;
357         uint32  reserved1;
358         uint32  reserved2;
359         uint32  panningwidth;
360         uint32  panningheight;
361         uint8   *private;
362 } DEVICEMODE; 
363
364 typedef struct devicemode_container
365 {
366         DEVICEMODE *dm;
367         uint8 *buffer;
368         uint32 size_of_buffer;
369 } DEVICEMODE_CONTAINER;
370
371 #define ORIENTATION      0x00000001L
372 #define PAPERSIZE        0x00000002L
373 #define PAPERLENGTH      0x00000004L
374 #define PAPERWIDTH       0x00000008L
375 #define SCALE            0x00000010L
376 #define COPIES           0x00000100L
377 #define DEFAULTSOURCE    0x00000200L
378 #define PRINTQUALITY     0x00000400L
379 #define COLOR            0x00000800L
380 #define DUPLEX           0x00001000L
381 #define YRESOLUTION      0x00002000L
382 #define TTOPTION         0x00004000L
383 #define COLLATE          0x00008000L
384 #define FORMNAME         0x00010000L
385 #define LOGPIXELS        0x00020000L
386 #define BITSPERPEL       0x00040000L
387 #define PELSWIDTH        0x00080000L
388 #define PELSHEIGHT       0x00100000L
389 #define DISPLAYFLAGS     0x00200000L
390 #define DISPLAYFREQUENCY 0x00400000L
391 #define PANNINGWIDTH     0x00800000L
392 #define PANNINGHEIGHT    0x01000000L
393
394 #define ORIENT_PORTRAIT   1
395 #define ORIENT_LANDSCAPE  2
396
397 #define PAPER_FIRST                PAPER_LETTER
398 #define PAPER_LETTER               1  /* Letter 8 1/2 x 11 in               */
399 #define PAPER_LETTERSMALL          2  /* Letter Small 8 1/2 x 11 in         */
400 #define PAPER_TABLOID              3  /* Tabloid 11 x 17 in                 */
401 #define PAPER_LEDGER               4  /* Ledger 17 x 11 in                  */
402 #define PAPER_LEGAL                5  /* Legal 8 1/2 x 14 in                */
403 #define PAPER_STATEMENT            6  /* Statement 5 1/2 x 8 1/2 in         */
404 #define PAPER_EXECUTIVE            7  /* Executive 7 1/4 x 10 1/2 in        */
405 #define PAPER_A3                   8  /* A3 297 x 420 mm                    */
406 #define PAPER_A4                   9  /* A4 210 x 297 mm                    */
407 #define PAPER_A4SMALL             10  /* A4 Small 210 x 297 mm              */
408 #define PAPER_A5                  11  /* A5 148 x 210 mm                    */
409 #define PAPER_B4                  12  /* B4 (JIS) 250 x 354                 */
410 #define PAPER_B5                  13  /* B5 (JIS) 182 x 257 mm              */
411 #define PAPER_FOLIO               14  /* Folio 8 1/2 x 13 in                */
412 #define PAPER_QUARTO              15  /* Quarto 215 x 275 mm                */
413 #define PAPER_10X14               16  /* 10x14 in                           */
414 #define PAPER_11X17               17  /* 11x17 in                           */
415 #define PAPER_NOTE                18  /* Note 8 1/2 x 11 in                 */
416 #define PAPER_ENV_9               19  /* Envelope #9 3 7/8 x 8 7/8          */
417 #define PAPER_ENV_10              20  /* Envelope #10 4 1/8 x 9 1/2         */
418 #define PAPER_ENV_11              21  /* Envelope #11 4 1/2 x 10 3/8        */
419 #define PAPER_ENV_12              22  /* Envelope #12 4 \276 x 11           */
420 #define PAPER_ENV_14              23  /* Envelope #14 5 x 11 1/2            */
421 #define PAPER_CSHEET              24  /* C size sheet                       */
422 #define PAPER_DSHEET              25  /* D size sheet                       */
423 #define PAPER_ESHEET              26  /* E size sheet                       */
424 #define PAPER_ENV_DL              27  /* Envelope DL 110 x 220mm            */
425 #define PAPER_ENV_C5              28  /* Envelope C5 162 x 229 mm           */
426 #define PAPER_ENV_C3              29  /* Envelope C3  324 x 458 mm          */
427 #define PAPER_ENV_C4              30  /* Envelope C4  229 x 324 mm          */
428 #define PAPER_ENV_C6              31  /* Envelope C6  114 x 162 mm          */
429 #define PAPER_ENV_C65             32  /* Envelope C65 114 x 229 mm          */
430 #define PAPER_ENV_B4              33  /* Envelope B4  250 x 353 mm          */
431 #define PAPER_ENV_B5              34  /* Envelope B5  176 x 250 mm          */
432 #define PAPER_ENV_B6              35  /* Envelope B6  176 x 125 mm          */
433 #define PAPER_ENV_ITALY           36  /* Envelope 110 x 230 mm              */
434 #define PAPER_ENV_MONARCH         37  /* Envelope Monarch 3.875 x 7.5 in    */
435 #define PAPER_ENV_PERSONAL        38  /* 6 3/4 Envelope 3 5/8 x 6 1/2 in    */
436 #define PAPER_FANFOLD_US          39  /* US Std Fanfold 14 7/8 x 11 in      */
437 #define PAPER_FANFOLD_STD_GERMAN  40  /* German Std Fanfold 8 1/2 x 12 in   */
438 #define PAPER_FANFOLD_LGL_GERMAN  41  /* German Legal Fanfold 8 1/2 x 13 in */
439
440 #define PAPER_LAST                PAPER_FANFOLD_LGL_GERMAN
441 #define PAPER_USER                256
442
443 #define BIN_FIRST         BIN_UPPER
444 #define BIN_UPPER         1
445 #define BIN_ONLYONE       1
446 #define BIN_LOWER         2
447 #define BIN_MIDDLE        3
448 #define BIN_MANUAL        4
449 #define BIN_ENVELOPE      5
450 #define BIN_ENVMANUAL     6
451 #define BIN_AUTO          7
452 #define BIN_TRACTOR       8
453 #define BIN_SMALLFMT      9
454 #define BIN_LARGEFMT      10
455 #define BIN_LARGECAPACITY 11
456 #define BIN_CASSETTE      14
457 #define BIN_FORMSOURCE    15
458 #define BIN_LAST          BIN_FORMSOURCE
459
460 #define BIN_USER          256     /* device specific bins start here */
461
462 #define RES_DRAFT         (-1)
463 #define RES_LOW           (-2)
464 #define RES_MEDIUM        (-3)
465 #define RES_HIGH          (-4)
466
467 #define COLOR_MONOCHROME  1
468 #define COLOR_COLOR       2
469
470 #define DUP_SIMPLEX    1
471 #define DUP_VERTICAL   2
472 #define DUP_HORIZONTAL 3
473
474 #define TT_BITMAP     1       /* print TT fonts as graphics */
475 #define TT_DOWNLOAD   2       /* download TT fonts as soft fonts */
476 #define TT_SUBDEV     3       /* substitute device fonts for TT fonts */
477
478 #define COLLATE_FALSE  0
479 #define COLLATE_TRUE   1
480
481 #define ERROR_INVALID_HANDLE              6
482 #define ERROR_INVALID_PARAMETER          87
483 #define ERROR_INSUFFICIENT_BUFFER       122
484
485 typedef struct s_header_type
486 {
487         uint32 type;
488         union
489         {
490                 uint32 value;
491                 UNISTR string;
492         } data;
493 } HEADER_TYPE;
494
495 typedef struct s_buffer
496 {
497         uint32 ptr;
498         uint32 size;
499         uint32 count;
500         uint8 *data;
501         HEADER_TYPE *header;
502 } BUFFER;
503
504
505 /* PRINTER_HND */
506 typedef struct printer_policy_info
507 {
508   uint8 data[PRINTER_HND_SIZE]; /* printer handle */
509
510 } PRINTER_HND;
511
512 /* SPOOL_Q_OPEN_PRINTER_EX request to open a printer */
513 typedef struct spool_q_open_printer_ex
514 {
515         uint32  ptr;
516         UNISTR2 printername;
517         uint32  unknown0;
518         uint32  cbbuf;
519         uint32  devmod;
520         uint32  access_required;
521         uint32  unknown1;       /* 0x0000 0001 */
522         uint32  unknown2;       /* 0x0000 0001 */
523         uint32  unknown3;       /* ??? pointer? */
524         uint32  unknown4;       /* 0x0000 001c */
525         uint32  unknown5;       /* ??? e.g 0xb94dd0 */
526         uint32  unknown6;       /* ??? pointer? */
527         uint32  unknown7;       /* 0x0000 0565 */
528         uint32  unknown8;       /* 0x0000 0002 */
529         uint32  unknown9;       /* 0x0000 0000 */
530         uint32  unknown10;      /* 0x0000 0000 */
531         UNISTR2 station;
532         UNISTR2 username;
533
534 } SPOOL_Q_OPEN_PRINTER_EX;
535
536 /* SPOOL_Q_OPEN_PRINTER_EX reply to an open printer */ 
537 typedef struct spool_r_open_printer_ex
538 {       
539         PRINTER_HND handle; /* handle used along all transactions (20*uint8) */
540         uint32 status;
541
542 } SPOOL_R_OPEN_PRINTER_EX;
543
544 typedef struct spool_q_getprinterdata
545 {
546         PRINTER_HND handle;
547         UNISTR2     valuename;
548         uint32      size;
549 } SPOOL_Q_GETPRINTERDATA;
550
551 typedef struct spool_r_getprinterdata
552 {
553         uint32 type;
554         uint32 size;
555         uint8 *data;
556         uint32 numeric_data;
557         uint32 needed;
558         uint32 status;
559 } SPOOL_R_GETPRINTERDATA;
560
561 typedef struct spool_q_closeprinter
562 {
563         PRINTER_HND handle;
564 } SPOOL_Q_CLOSEPRINTER;
565
566 typedef struct spool_r_closeprinter
567 {
568         PRINTER_HND handle;
569         uint32 status;
570 } SPOOL_R_CLOSEPRINTER;
571
572 typedef struct spool_q_startpageprinter
573 {
574         PRINTER_HND handle;
575 } SPOOL_Q_STARTPAGEPRINTER;
576
577 typedef struct spool_r_startpageprinter
578 {
579         uint32 status;
580 } SPOOL_R_STARTPAGEPRINTER;
581
582 typedef struct spool_q_endpageprinter
583 {
584         PRINTER_HND handle;
585 } SPOOL_Q_ENDPAGEPRINTER;
586
587 typedef struct spool_r_endpageprinter
588 {
589         uint32 status;
590 } SPOOL_R_ENDPAGEPRINTER;
591
592 typedef struct spool_doc_info_1
593 {
594         uint32 p_docname;
595         uint32 p_outputfile;
596         uint32 p_datatype;
597         UNISTR2 docname;
598         UNISTR2 outputfile;
599         UNISTR2 datatype;
600 } DOC_INFO_1;
601
602 typedef struct spool_doc_info
603 {
604         uint32 switch_value;
605         DOC_INFO_1 doc_info_1;
606 } DOC_INFO;
607
608 typedef struct spool_doc_info_container
609 {
610         uint32 level;
611         DOC_INFO docinfo;
612 } DOC_INFO_CONTAINER;
613
614 typedef struct spool_q_startdocprinter
615 {
616         PRINTER_HND handle;
617         DOC_INFO_CONTAINER doc_info_container;
618 } SPOOL_Q_STARTDOCPRINTER;
619
620 typedef struct spool_r_startdocprinter
621 {
622         uint32 jobid;
623         uint32 status;
624 } SPOOL_R_STARTDOCPRINTER;
625
626 typedef struct spool_q_enddocprinter
627 {
628         PRINTER_HND handle;
629 } SPOOL_Q_ENDDOCPRINTER;
630
631 typedef struct spool_r_enddocprinter
632 {
633         uint32 status;
634 } SPOOL_R_ENDDOCPRINTER;
635
636 typedef struct spool_q_writeprinter
637 {
638         PRINTER_HND handle;
639         uint32 buffer_size;
640         uint8 *buffer;
641         uint32 buffer_size2;
642 } SPOOL_Q_WRITEPRINTER;
643
644 typedef struct spool_r_writeprinter
645 {
646         uint32 buffer_written;
647         uint32 status;
648 } SPOOL_R_WRITEPRINTER;
649
650 typedef struct spool_notify_option_type
651 {
652         uint16 type;
653         uint16 reserved0;
654         uint32 reserved1;
655         uint32 reserved2;
656         uint32 count;
657         uint16 fields[16];
658 } SPOOL_NOTIFY_OPTION_TYPE;
659
660 typedef struct spool_notify_option
661 {
662         uint32 version;
663         uint32 reserved;
664         uint32 count;
665         SPOOL_NOTIFY_OPTION_TYPE type[16]; /* totally arbitrary !!! */
666 } SPOOL_NOTIFY_OPTION;
667
668 typedef struct spool_notify_info_data
669 {
670         uint16 type;
671         uint16 field;
672         uint32 reserved;
673         uint32 id;
674         union 
675         {
676                 uint32 value[2];
677                 struct
678                 {
679                         uint32 length;
680                         uint16 string[1024];
681                 } data;
682         } notify_data;
683         uint32 size;
684         BOOL   enc_type;
685 } SPOOL_NOTIFY_INFO_DATA;
686
687 typedef struct spool_notify_info
688 {
689         uint32 version;
690         uint32 flags;
691         uint32 count;
692         SPOOL_NOTIFY_INFO_DATA data[26*16];
693         /* 26 differents data types */
694         /* so size it for 16 printers at max */
695         /* jfmxxxx: Have to make it dynamic !!!*/
696 } SPOOL_NOTIFY_INFO;
697
698 /* If the struct name looks obscure, yes it is ! */
699 /* RemoteFindFirstPrinterChangeNotificationEx query struct */
700 typedef struct spoolss_q_rffpcnex
701 {
702         PRINTER_HND handle;
703         uint32 flags;
704         uint32 options;
705         UNISTR2 localmachine;
706         uint32  printerlocal;
707         SPOOL_NOTIFY_OPTION option;
708 } SPOOL_Q_RFFPCNEX;
709
710 typedef struct spool_r_rffpcnex
711 {
712         uint32 status;
713 } SPOOL_R_RFFPCNEX;
714
715 /* Remote Find Next Printer Change Notify Ex */
716 typedef struct spool_q_rfnpcnex
717 {
718         PRINTER_HND handle;
719         uint32 change;
720         SPOOL_NOTIFY_OPTION option;
721 } SPOOL_Q_RFNPCNEX;
722
723 typedef struct spool_r_rfnpcnex
724 {
725         uint32 count;
726         SPOOL_NOTIFY_INFO info;
727 } SPOOL_R_RFNPCNEX;
728
729 /* Find Close Printer Notify */
730 typedef struct spool_q_fcpn
731 {
732         PRINTER_HND handle;
733 } SPOOL_Q_FCPN;
734
735 typedef struct spool_r_fcpn
736 {
737         uint32 status;
738 } SPOOL_R_FCPN;
739
740
741 typedef struct printer_info_0
742 {
743         UNISTR printername;
744         UNISTR servername;
745         uint32 cjobs;
746         uint32 attributes;
747         uint32 unknown0;
748         uint32 unknown1;
749         uint32 unknown2;
750         uint32 unknown3;
751         uint32 unknown4;
752         uint32 unknown5;
753         uint32 unknown6;
754         uint16 majorversion;
755         uint16 buildversion;
756         uint32 unknown7;
757         uint32 unknown8;
758         uint32 unknown9;
759         uint32 unknown10;
760         uint32 unknown11;
761         uint32 unknown12;
762         uint32 unknown13;
763         uint32 unknown14;
764         uint32 unknown15;
765         uint32 unknown16;
766         uint32 unknown17;
767         uint32 unknown18;
768         uint32 status;
769         uint32 unknown20;
770         uint32 unknown21;
771         uint16 unknown22;
772         uint32 unknown23;       
773 } PRINTER_INFO_0;
774
775 typedef struct printer_info_1
776 {
777     uint32 flags;
778     UNISTR description;
779     UNISTR name;
780     UNISTR comment;
781 } PRINTER_INFO_1;
782
783 typedef struct printer_info_2
784 {
785     UNISTR     servername;
786     UNISTR     printername;
787     UNISTR     sharename;
788     UNISTR     portname;
789     UNISTR     drivername;
790     UNISTR     comment;
791     UNISTR     location;
792     DEVICEMODE *devmode;
793     UNISTR     sepfile;
794     UNISTR     printprocessor;
795     UNISTR     datatype;
796     UNISTR     parameters;
797     /*SECURITY_DESCRIPTOR securitydescriptor;*/
798     uint32   attributes;
799     uint32   priority;
800     uint32   defaultpriority;
801     uint32   starttime;
802     uint32   untiltime;
803     uint32   status;
804     uint32   cjobs;
805     uint32   averageppm;
806 } PRINTER_INFO_2;
807
808 typedef struct spool_q_enumprinters
809 {
810         uint32 flags;
811         UNISTR2 servername;
812         uint32 level;
813         BUFFER buffer;
814 /*      uint32 buf_size;*/
815 } SPOOL_Q_ENUMPRINTERS;
816
817 typedef struct spool_r_enumprinters
818 {
819         uint32 offered;  /* number of bytes offered */
820         uint32 needed;   /* bytes needed */
821         uint32 returned; /* number of printers */
822         uint32 status;
823         uint32 level;
824         UNISTR servername;
825         union {
826                 PRINTER_INFO_1 **printers_1;
827                 PRINTER_INFO_2 **printers_2;
828         } printer;
829 } SPOOL_R_ENUMPRINTERS;
830
831
832 typedef struct spool_q_getprinter
833 {
834         PRINTER_HND handle;
835         uint32 level;
836         uint8* buffer;
837         uint32 offered;
838
839 } SPOOL_Q_GETPRINTER;
840
841 typedef struct spool_r_getprinter
842 {
843         PRINTER_HND handle;
844         uint32 level;
845         
846         uint32 offered;
847         uint32 needed;
848         uint32 status;
849         union {
850                 PRINTER_INFO_0 *info0;
851                 PRINTER_INFO_1 *info1;
852                 PRINTER_INFO_2 *info2;
853                 void *info;
854         } printer;
855 } SPOOL_R_GETPRINTER;
856
857 struct s_notify_info_data_table
858 {
859         uint16 type;
860         uint16 field;
861         char   *name;
862         uint32 size;
863         void   (*fn) (connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer);
864 };
865
866 typedef struct spool_q_getprinterdriver2
867 {
868         PRINTER_HND handle;
869         UNISTR2 architecture;
870         uint32 level;
871         BUFFER buffer;
872         uint32 buf_size;
873         uint32 status;
874 } SPOOL_Q_GETPRINTERDRIVER2;
875
876 typedef struct driver_info_1
877 {
878         UNISTR name;
879 } DRIVER_INFO_1;
880
881 typedef struct driver_info_2
882 {
883         uint32 version;
884         UNISTR name;
885         UNISTR architecture;
886         UNISTR driverpath;
887         UNISTR datafile;
888         UNISTR configfile;
889 } DRIVER_INFO_2;
890
891 typedef struct driver_info_3
892 {
893         uint32 version;
894         UNISTR name;
895         UNISTR architecture;
896         UNISTR driverpath;
897         UNISTR datafile;
898         UNISTR configfile;
899         UNISTR helpfile;
900         UNISTR **dependentfiles;
901         UNISTR monitorname;
902         UNISTR defaultdatatype;
903 } DRIVER_INFO_3;
904
905 typedef struct spool_r_getprinterdriver2
906 {
907         uint32 needed;
908         uint32 offered;
909         uint32 returned;
910         uint32 status;
911         uint32 level;
912         union {
913                 DRIVER_INFO_1 *info1;
914                 DRIVER_INFO_2 *info2;
915                 DRIVER_INFO_3 *info3;
916         } printer;
917 } SPOOL_R_GETPRINTERDRIVER2;
918
919 typedef struct add_jobinfo_1
920 {
921         UNISTR path;
922         uint32 job_number;
923 } ADD_JOBINFO_1;
924
925
926 typedef struct spool_q_addjob
927 {
928         PRINTER_HND handle;
929         uint32 level;
930         BUFFER buffer;
931         uint32 buf_size;
932 } SPOOL_Q_ADDJOB;
933
934 typedef struct spool_r_addjob
935 {
936         uint32 status;
937 } SPOOL_R_ADDJOB;
938
939 /*
940  * I'm really wondering how many different time formats
941  * I will have to cope with
942  *
943  * JFM, 09/13/98 In a mad mood ;-(
944 */
945 typedef struct systemtime
946 {
947     uint16 year;
948     uint16 month;
949     uint16 dayofweek;
950     uint16 day;
951     uint16 hour;
952     uint16 minute;
953     uint16 second;
954     uint16 milliseconds;
955 } SYSTEMTIME;
956
957 typedef struct s_job_info_1
958 {
959         uint32 jobid;
960         UNISTR printername;
961         UNISTR machinename;
962         UNISTR username;
963         UNISTR document;
964         UNISTR datatype;
965         UNISTR text_status;
966         uint32 status;
967         uint32 priority;
968         uint32 position;
969         uint32 totalpages;
970         uint32 pagesprinted;
971         SYSTEMTIME submitted;
972 } JOB_INFO_1;
973
974 typedef struct s_job_info_2
975 {
976         uint32 jobid;
977         UNISTR printername;
978         UNISTR machinename;
979         UNISTR username;
980         UNISTR document;
981         UNISTR notifyname;
982         UNISTR datatype;
983         UNISTR printprocessor;
984         UNISTR parameters;
985         UNISTR drivername;
986         DEVICEMODE *devmode;
987         UNISTR text_status;
988 /*      SEC_DESC sec_desc;*/
989         uint32 status;
990         uint32 priority;
991         uint32 position;
992         uint32 starttime;
993         uint32 untiltime;
994         uint32 totalpages;
995         uint32 size;
996         SYSTEMTIME submitted;
997         uint32 timeelapsed;
998         uint32 pagesprinted;
999 } JOB_INFO_2;
1000
1001 typedef struct spool_q_enumjobs
1002 {
1003         PRINTER_HND handle;
1004         uint32 firstjob;
1005         uint32 numofjobs;
1006         uint32 level;
1007         BUFFER buffer;
1008         uint32 buf_size;
1009 } SPOOL_Q_ENUMJOBS;
1010
1011 typedef struct spool_r_enumjobs
1012 {
1013         uint32 level;
1014         union {
1015                 JOB_INFO_1 *job_info_1;
1016                 JOB_INFO_2 *job_info_2;
1017         } job;
1018         uint32 offered;
1019         uint32 numofjobs;
1020         uint32 status;
1021 } SPOOL_R_ENUMJOBS;
1022
1023 typedef struct spool_q_schedulejob
1024 {
1025         PRINTER_HND handle;
1026         uint32 jobid;
1027 } SPOOL_Q_SCHEDULEJOB;
1028
1029 typedef struct spool_r_schedulejob
1030 {
1031         uint32 status;
1032 } SPOOL_R_SCHEDULEJOB;
1033
1034 typedef struct s_port_info_1
1035 {
1036         UNISTR port_name;
1037 } PORT_INFO_1;
1038
1039 typedef struct s_port_info_2
1040 {
1041         UNISTR port_name;
1042         UNISTR monitor_name;
1043         UNISTR description;
1044         uint32 port_type;
1045         uint32 reserved;
1046 } PORT_INFO_2;
1047
1048 typedef struct spool_q_enumports
1049 {
1050         UNISTR2 name;
1051         uint32 level;
1052         BUFFER buffer;
1053         uint32 buf_size;
1054 } SPOOL_Q_ENUMPORTS;
1055
1056 typedef struct spool_r_enumports
1057 {
1058         uint32 level;
1059         union {
1060                 PORT_INFO_1 *port_info_1;
1061                 PORT_INFO_2 *port_info_2;
1062         } port;
1063         uint32 offered;
1064         uint32 numofports;
1065         uint32 status;
1066 } SPOOL_R_ENUMPORTS;
1067
1068 #define JOB_CONTROL_PAUSE              1
1069 #define JOB_CONTROL_RESUME             2
1070 #define JOB_CONTROL_CANCEL             3
1071 #define JOB_CONTROL_RESTART            4
1072 #define JOB_CONTROL_DELETE             5
1073
1074 typedef struct spool_q_setjob
1075 {
1076         PRINTER_HND handle;
1077         uint32 jobid;
1078         uint32 level;
1079         union {
1080                 JOB_INFO_1 job_info_1;
1081                 JOB_INFO_2 job_info_2;
1082         } job;
1083         uint32 command;
1084 } SPOOL_Q_SETJOB;
1085
1086 typedef struct spool_r_setjob
1087 {
1088         uint32 status;
1089 } SPOOL_R_SETJOB;
1090
1091 typedef struct spool_q_enumprinterdrivers
1092 {
1093         UNISTR2 name;
1094         UNISTR2 environment;
1095         uint32 level;
1096         BUFFER buffer;
1097         uint32 buf_size;
1098 } SPOOL_Q_ENUMPRINTERDRIVERS;
1099
1100 typedef struct spool_r_enumprinterdrivers
1101 {
1102         uint32 level;
1103         union {
1104                 DRIVER_INFO_1 *driver_info_1;
1105                 DRIVER_INFO_2 *driver_info_2;
1106                 DRIVER_INFO_3 *driver_info_3;
1107         } driver;
1108         uint32 offered;
1109         uint32 numofdrivers;
1110         uint32 status;
1111 } SPOOL_R_ENUMPRINTERDRIVERS;
1112
1113 typedef struct spool_form_1
1114 {
1115         uint32 flag;
1116         UNISTR name;
1117         uint32 width;
1118         uint32 length;
1119         uint32 left;
1120         uint32 top;
1121         uint32 right;
1122         uint32 bottom;
1123 } FORM_1;
1124
1125 typedef struct spool_q_enumforms
1126 {
1127         PRINTER_HND handle;
1128         uint32 level;
1129         BUFFER buffer;
1130         uint32 buf_size;
1131 } SPOOL_Q_ENUMFORMS;
1132
1133 typedef struct spool_r_enumforms
1134 {
1135         uint32 level;
1136         FORM_1 *forms_1;
1137         uint32 offered;
1138         uint32 numofforms;
1139         uint32 status;
1140 } SPOOL_R_ENUMFORMS;
1141
1142
1143 typedef struct spool_printer_info_level_2
1144 {
1145         uint32 servername_ptr;
1146         uint32 printername_ptr;
1147         uint32 sharename_ptr;
1148         uint32 portname_ptr;
1149         uint32 drivername_ptr;
1150         uint32 comment_ptr;
1151         uint32 location_ptr;
1152         uint32 devmode_ptr;
1153         uint32 sepfile_ptr;
1154         uint32 printprocessor_ptr;
1155         uint32 datatype_ptr;
1156         uint32 parameters_ptr;
1157         uint32 secdesc_ptr;
1158         uint32 attributes;
1159         uint32 priority;
1160         uint32 default_priority;
1161         uint32 starttime;
1162         uint32 untiltime;
1163         uint32 status;
1164         uint32 cjobs;
1165         uint32 averageppm;
1166         UNISTR2 servername;
1167         UNISTR2 printername;
1168         UNISTR2 sharename;
1169         UNISTR2 portname;
1170         UNISTR2 drivername;
1171         UNISTR2 comment;
1172         UNISTR2 location;
1173         UNISTR2 sepfile;
1174         UNISTR2 printprocessor;
1175         UNISTR2 datatype;
1176         UNISTR2 parameters;
1177         SEC_DESC_BUF *secdesc;
1178 } SPOOL_PRINTER_INFO_LEVEL_2;
1179
1180 typedef struct spool_printer_info_level
1181 {
1182         SPOOL_PRINTER_INFO_LEVEL_2 *info_2;
1183 } SPOOL_PRINTER_INFO_LEVEL;
1184
1185 typedef struct spool_printer_driver_info_level_3
1186 {
1187         uint32 cversion;
1188         uint32 name_ptr;
1189         uint32 environment_ptr;
1190         uint32 driverpath_ptr;
1191         uint32 datafile_ptr;
1192         uint32 configfile_ptr;
1193         uint32 helpfile_ptr;
1194         uint32 monitorname_ptr;
1195         uint32 defaultdatatype_ptr;
1196         uint32 dependentfilessize;
1197         uint32 dependentfiles_ptr;
1198
1199         UNISTR2 name;
1200         UNISTR2 environment;
1201         UNISTR2 driverpath;
1202         UNISTR2 datafile;
1203         UNISTR2 configfile;
1204         UNISTR2 helpfile;
1205         UNISTR2 monitorname;
1206         UNISTR2 defaultdatatype;
1207         BUFFER5 dependentfiles;
1208
1209 } SPOOL_PRINTER_DRIVER_INFO_LEVEL_3;
1210
1211 typedef struct spool_printer_driver_info_level
1212 {
1213         SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *info_3;
1214 } SPOOL_PRINTER_DRIVER_INFO_LEVEL;
1215
1216
1217 /* this struct is undocumented */
1218 /* thanks to the ddk ... */
1219 typedef struct spool_user_level_1
1220 {
1221         uint32 size;
1222         uint32 client_name_ptr;
1223         uint32 user_name_ptr;
1224         uint32 build;
1225         uint32 major;
1226         uint32 minor;
1227         uint32 processor;
1228         UNISTR2 client_name;
1229         UNISTR2 user_name;
1230 } SPOOL_USER_LEVEL_1;
1231
1232 typedef struct spool_user_level
1233 {
1234         SPOOL_USER_LEVEL_1 *user_level_1;
1235 } SPOOL_USER_LEVEL;
1236
1237 typedef struct spool_q_setprinter
1238 {
1239         PRINTER_HND handle;
1240         uint32 level;
1241         SPOOL_PRINTER_INFO_LEVEL info;
1242
1243         DEVICEMODE *devmode;
1244         struct
1245         {
1246                 uint32 size_of_buffer;
1247                 uint32 data;
1248         } security;
1249
1250         uint32 command;
1251 } SPOOL_Q_SETPRINTER;
1252
1253 typedef struct spool_r_setprinter
1254 {
1255         uint32 status;
1256 } SPOOL_R_SETPRINTER;
1257
1258 typedef struct spool_q_addprinter
1259 {
1260         UNISTR2 server_name;
1261         uint32 level;
1262         SPOOL_PRINTER_INFO_LEVEL info;
1263         uint32 unk0;
1264         uint32 unk1;
1265         uint32 unk2;
1266         uint32 unk3;
1267         uint32 user_level;
1268         SPOOL_USER_LEVEL user;
1269 } SPOOL_Q_ADDPRINTER;
1270
1271 typedef struct spool_r_addprinter
1272 {
1273         uint32 status;
1274 } SPOOL_R_ADDPRINTER;
1275
1276 typedef struct spool_q_addprinterex
1277 {
1278         UNISTR2 server_name;
1279         uint32 level;
1280         SPOOL_PRINTER_INFO_LEVEL info;
1281         uint32 unk0;
1282         uint32 unk1;
1283         uint32 unk2;
1284         uint32 unk3;
1285         uint32 user_level;
1286         SPOOL_USER_LEVEL user;
1287 } SPOOL_Q_ADDPRINTEREX;
1288
1289
1290 typedef struct spool_r_addprinterex
1291 {
1292         PRINTER_HND handle;
1293         uint32 status;
1294 } SPOOL_R_ADDPRINTEREX;
1295
1296 typedef struct spool_q_addprinterdriver
1297 {
1298         UNISTR2 server_name;
1299         uint32 level;
1300         SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1301 } SPOOL_Q_ADDPRINTERDRIVER;
1302
1303 typedef struct spool_r_addprinterdriver
1304 {
1305         uint32 status;
1306 } SPOOL_R_ADDPRINTERDRIVER;
1307
1308 typedef struct spool_q_getprinterdriverdirectory
1309 {
1310         UNISTR2 name;
1311         UNISTR2 environment;
1312         uint32 level;
1313         BUFFER buffer;
1314         uint32 buf_size;
1315 } SPOOL_Q_GETPRINTERDRIVERDIR;
1316
1317 typedef struct driver_directory_1
1318 {
1319         UNISTR name;
1320 } DRIVER_DIRECTORY_1 ;
1321
1322 typedef struct spool_r_getprinterdriverdirectory
1323 {
1324         uint32 level;
1325         union {
1326                 DRIVER_DIRECTORY_1 driver_info_1;
1327         } driver;
1328         uint32 offered;
1329         uint32 status;
1330 } SPOOL_R_GETPRINTERDRIVERDIR;
1331
1332 typedef struct spool_q_enumprintprocessors
1333 {
1334         UNISTR2 name;
1335         UNISTR2 environment;
1336         uint32 level;
1337         BUFFER buffer;
1338         uint32 buf_size;
1339 } SPOOL_Q_ENUMPRINTPROCESSORS;
1340
1341 typedef struct printprocessor_1
1342 {
1343         UNISTR name;
1344 } PRINTPROCESSOR_1;
1345
1346 typedef struct spool_r_enumprintprocessors
1347 {
1348         uint32 level;
1349         PRINTPROCESSOR_1 *info_1;
1350         uint32 offered;
1351         uint32 numofprintprocessors;
1352         uint32 status;
1353 } SPOOL_R_ENUMPRINTPROCESSORS;
1354
1355 typedef struct spool_q_enumprintprocessordatatypes
1356 {
1357         UNISTR2 name;
1358         UNISTR2 printprocessor;
1359         uint32 level;
1360         BUFFER buffer;
1361         uint32 buf_size;
1362 } SPOOL_Q_ENUMPRINTPROCESSORDATATYPES;
1363
1364 typedef struct ppdatatype_1
1365 {
1366         UNISTR name;
1367 } PPDATATYPE_1;
1368
1369 typedef struct spool_r_enumprintprocessordatatypes
1370 {
1371         uint32 level;
1372         PPDATATYPE_1 *info_1;
1373         uint32 offered;
1374         uint32 numofppdatatypes;
1375         uint32 status;
1376 } SPOOL_R_ENUMPRINTPROCESSORDATATYPES;
1377
1378 typedef struct spool_q_enumprintmonitors
1379 {
1380         UNISTR2 name;
1381         uint32 level;
1382         BUFFER buffer;
1383         uint32 buf_size;
1384 } SPOOL_Q_ENUMPRINTMONITORS;
1385
1386 typedef struct printmonitor_1
1387 {
1388         UNISTR name;
1389 } PRINTMONITOR_1;
1390
1391 typedef struct spool_r_enumprintmonitors
1392 {
1393         uint32 level;
1394         PRINTMONITOR_1 *info_1;
1395         uint32 offered;
1396         uint32 numofprintmonitors;
1397         uint32 status;
1398 } SPOOL_R_ENUMPRINTMONITORS;
1399
1400 typedef struct spool_q_enumprinterdata
1401 {
1402         PRINTER_HND handle;
1403         uint32 index;
1404         uint32 valuesize;
1405         uint32 datasize;
1406 } SPOOL_Q_ENUMPRINTERDATA;
1407
1408 typedef struct spool_r_enumprinterdata
1409 {
1410         uint32 valuesize;
1411         UNISTR value;
1412         uint32 realvaluesize;
1413         uint32 type;
1414         uint32 datasize;
1415         uint8  *data;
1416         uint32 realdatasize;
1417         uint32 status;
1418 } SPOOL_R_ENUMPRINTERDATA;
1419
1420 typedef struct spool_q_setprinterdata
1421 {
1422         PRINTER_HND handle;
1423         UNISTR2 value;
1424         uint32 type;
1425         uint32 max_len;
1426         uint8 *data;
1427         uint32 real_len;
1428         uint32 numeric_data;
1429 } SPOOL_Q_SETPRINTERDATA;
1430
1431 typedef struct spool_r_setprinterdata
1432 {
1433         uint32 status;
1434 } SPOOL_R_SETPRINTERDATA;
1435
1436 typedef struct _form
1437 {
1438        uint32 flags;
1439        uint32 name_ptr;
1440        uint32 size_x;
1441        uint32 size_y;
1442        uint32 left;
1443        uint32 top;
1444        uint32 right;
1445        uint32 bottom;
1446        UNISTR2 name;
1447 } FORM;
1448
1449 typedef struct spool_q_addform
1450 {
1451         PRINTER_HND handle;
1452         uint32 level;
1453         uint32 level2;
1454         FORM form;
1455 } SPOOL_Q_ADDFORM;
1456
1457 typedef struct spool_r_addform
1458 {
1459         uint32 status;
1460 } SPOOL_R_ADDFORM;
1461
1462 typedef struct spool_q_setform
1463 {
1464         PRINTER_HND handle;
1465         UNISTR2 name;
1466         uint32 level;
1467         uint32 level2;
1468         FORM form;
1469 } SPOOL_Q_SETFORM;
1470
1471 typedef struct spool_r_setform
1472 {
1473         uint32 status;
1474 } SPOOL_R_SETFORM;
1475
1476 typedef struct spool_q_getjob
1477 {
1478         PRINTER_HND handle;
1479         uint32 jobid;
1480         uint32 level;
1481         BUFFER buffer;
1482         uint32 buf_size;
1483 } SPOOL_Q_GETJOB;
1484
1485 typedef struct spool_r_getjob
1486 {
1487         uint32 level;
1488         union {
1489                 JOB_INFO_1 *job_info_1;
1490                 JOB_INFO_2 *job_info_2;
1491         } job;
1492         uint32 offered;
1493         uint32 status;
1494 } SPOOL_R_GETJOB;
1495
1496 #define PRINTER_DRIVER_VERSION 2
1497 #define PRINTER_DRIVER_ARCHITECTURE "Windows NT x86"
1498
1499
1500 #endif /* _RPC_SPOOLSS_H */
1501