8eb0c7efb1ee732be7e6ac24c56c639fb9f09a00
[bbaumbach/samba-autobuild/.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                 void *info;
829         } printer;
830 } SPOOL_R_ENUMPRINTERS;
831
832
833 typedef struct spool_q_getprinter
834 {
835         PRINTER_HND handle;
836         uint32 level;
837         uint8* buffer;
838         uint32 offered;
839
840 } SPOOL_Q_GETPRINTER;
841
842 typedef struct spool_r_getprinter
843 {
844         PRINTER_HND handle;
845         uint32 level;
846         
847         uint32 offered;
848         uint32 needed;
849         uint32 status;
850         union {
851                 PRINTER_INFO_0 *info0;
852                 PRINTER_INFO_1 *info1;
853                 PRINTER_INFO_2 *info2;
854                 void *info;
855         } printer;
856 } SPOOL_R_GETPRINTER;
857
858 struct s_notify_info_data_table
859 {
860         uint16 type;
861         uint16 field;
862         char   *name;
863         uint32 size;
864         void   (*fn) (connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer);
865 };
866
867 typedef struct spool_q_getprinterdriver2
868 {
869         PRINTER_HND handle;
870         UNISTR2 architecture;
871         uint32 level;
872         BUFFER buffer;
873         uint32 buf_size;
874         uint32 status;
875 } SPOOL_Q_GETPRINTERDRIVER2;
876
877 typedef struct driver_info_1
878 {
879         UNISTR name;
880 } DRIVER_INFO_1;
881
882 typedef struct driver_info_2
883 {
884         uint32 version;
885         UNISTR name;
886         UNISTR architecture;
887         UNISTR driverpath;
888         UNISTR datafile;
889         UNISTR configfile;
890 } DRIVER_INFO_2;
891
892 typedef struct driver_info_3
893 {
894         uint32 version;
895         UNISTR name;
896         UNISTR architecture;
897         UNISTR driverpath;
898         UNISTR datafile;
899         UNISTR configfile;
900         UNISTR helpfile;
901         UNISTR **dependentfiles;
902         UNISTR monitorname;
903         UNISTR defaultdatatype;
904 } DRIVER_INFO_3;
905
906 typedef struct spool_r_getprinterdriver2
907 {
908         uint32 needed;
909         uint32 offered;
910         uint32 returned;
911         uint32 status;
912         uint32 level;
913         union {
914                 DRIVER_INFO_1 *info1;
915                 DRIVER_INFO_2 *info2;
916                 DRIVER_INFO_3 *info3;
917         } printer;
918 } SPOOL_R_GETPRINTERDRIVER2;
919
920 typedef struct add_jobinfo_1
921 {
922         UNISTR path;
923         uint32 job_number;
924 } ADD_JOBINFO_1;
925
926
927 typedef struct spool_q_addjob
928 {
929         PRINTER_HND handle;
930         uint32 level;
931         BUFFER buffer;
932         uint32 buf_size;
933 } SPOOL_Q_ADDJOB;
934
935 typedef struct spool_r_addjob
936 {
937         uint32 status;
938 } SPOOL_R_ADDJOB;
939
940 /*
941  * I'm really wondering how many different time formats
942  * I will have to cope with
943  *
944  * JFM, 09/13/98 In a mad mood ;-(
945 */
946 typedef struct systemtime
947 {
948     uint16 year;
949     uint16 month;
950     uint16 dayofweek;
951     uint16 day;
952     uint16 hour;
953     uint16 minute;
954     uint16 second;
955     uint16 milliseconds;
956 } SYSTEMTIME;
957
958 typedef struct s_job_info_1
959 {
960         uint32 jobid;
961         UNISTR printername;
962         UNISTR machinename;
963         UNISTR username;
964         UNISTR document;
965         UNISTR datatype;
966         UNISTR text_status;
967         uint32 status;
968         uint32 priority;
969         uint32 position;
970         uint32 totalpages;
971         uint32 pagesprinted;
972         SYSTEMTIME submitted;
973 } JOB_INFO_1;
974
975 typedef struct s_job_info_2
976 {
977         uint32 jobid;
978         UNISTR printername;
979         UNISTR machinename;
980         UNISTR username;
981         UNISTR document;
982         UNISTR notifyname;
983         UNISTR datatype;
984         UNISTR printprocessor;
985         UNISTR parameters;
986         UNISTR drivername;
987         DEVICEMODE *devmode;
988         UNISTR text_status;
989 /*      SEC_DESC sec_desc;*/
990         uint32 status;
991         uint32 priority;
992         uint32 position;
993         uint32 starttime;
994         uint32 untiltime;
995         uint32 totalpages;
996         uint32 size;
997         SYSTEMTIME submitted;
998         uint32 timeelapsed;
999         uint32 pagesprinted;
1000 } JOB_INFO_2;
1001
1002 typedef struct spool_q_enumjobs
1003 {
1004         PRINTER_HND handle;
1005         uint32 firstjob;
1006         uint32 numofjobs;
1007         uint32 level;
1008         BUFFER buffer;
1009         uint32 buf_size;
1010 } SPOOL_Q_ENUMJOBS;
1011
1012 typedef struct spool_r_enumjobs
1013 {
1014         uint32 level;
1015         union {
1016                 JOB_INFO_1 **job_info_1;
1017                 JOB_INFO_2 **job_info_2;
1018         } job;
1019         uint32 offered;
1020         uint32 numofjobs;
1021         uint32 status;
1022 } SPOOL_R_ENUMJOBS;
1023
1024 typedef struct spool_q_schedulejob
1025 {
1026         PRINTER_HND handle;
1027         uint32 jobid;
1028 } SPOOL_Q_SCHEDULEJOB;
1029
1030 typedef struct spool_r_schedulejob
1031 {
1032         uint32 status;
1033 } SPOOL_R_SCHEDULEJOB;
1034
1035 typedef struct s_port_info_1
1036 {
1037         UNISTR port_name;
1038 } PORT_INFO_1;
1039
1040 typedef struct s_port_info_2
1041 {
1042         UNISTR port_name;
1043         UNISTR monitor_name;
1044         UNISTR description;
1045         uint32 port_type;
1046         uint32 reserved;
1047 } PORT_INFO_2;
1048
1049 typedef struct spool_q_enumports
1050 {
1051         UNISTR2 name;
1052         uint32 level;
1053         BUFFER buffer;
1054         uint32 buf_size;
1055 } SPOOL_Q_ENUMPORTS;
1056
1057 typedef struct spool_r_enumports
1058 {
1059         uint32 level;
1060         union {
1061                 PORT_INFO_1 *port_info_1;
1062                 PORT_INFO_2 *port_info_2;
1063         } port;
1064         uint32 offered;
1065         uint32 numofports;
1066         uint32 status;
1067 } SPOOL_R_ENUMPORTS;
1068
1069 #define JOB_CONTROL_PAUSE              1
1070 #define JOB_CONTROL_RESUME             2
1071 #define JOB_CONTROL_CANCEL             3
1072 #define JOB_CONTROL_RESTART            4
1073 #define JOB_CONTROL_DELETE             5
1074
1075 typedef struct spool_q_setjob
1076 {
1077         PRINTER_HND handle;
1078         uint32 jobid;
1079         uint32 level;
1080         union {
1081                 JOB_INFO_1 job_info_1;
1082                 JOB_INFO_2 job_info_2;
1083         } job;
1084         uint32 command;
1085 } SPOOL_Q_SETJOB;
1086
1087 typedef struct spool_r_setjob
1088 {
1089         uint32 status;
1090 } SPOOL_R_SETJOB;
1091
1092 typedef struct spool_q_enumprinterdrivers
1093 {
1094         UNISTR2 name;
1095         UNISTR2 environment;
1096         uint32 level;
1097         BUFFER buffer;
1098         uint32 buf_size;
1099 } SPOOL_Q_ENUMPRINTERDRIVERS;
1100
1101 typedef struct spool_r_enumprinterdrivers
1102 {
1103         uint32 level;
1104         union {
1105                 DRIVER_INFO_1 *driver_info_1;
1106                 DRIVER_INFO_2 *driver_info_2;
1107                 DRIVER_INFO_3 *driver_info_3;
1108         } driver;
1109         uint32 offered;
1110         uint32 numofdrivers;
1111         uint32 status;
1112 } SPOOL_R_ENUMPRINTERDRIVERS;
1113
1114 typedef struct spool_form_1
1115 {
1116         uint32 flag;
1117         UNISTR name;
1118         uint32 width;
1119         uint32 length;
1120         uint32 left;
1121         uint32 top;
1122         uint32 right;
1123         uint32 bottom;
1124 } FORM_1;
1125
1126 typedef struct spool_q_enumforms
1127 {
1128         PRINTER_HND handle;
1129         uint32 level;
1130         BUFFER buffer;
1131         uint32 buf_size;
1132 } SPOOL_Q_ENUMFORMS;
1133
1134 typedef struct spool_r_enumforms
1135 {
1136         uint32 level;
1137         FORM_1 *forms_1;
1138         uint32 offered;
1139         uint32 numofforms;
1140         uint32 status;
1141 } SPOOL_R_ENUMFORMS;
1142
1143
1144 typedef struct spool_printer_info_level_2
1145 {
1146         uint32 servername_ptr;
1147         uint32 printername_ptr;
1148         uint32 sharename_ptr;
1149         uint32 portname_ptr;
1150         uint32 drivername_ptr;
1151         uint32 comment_ptr;
1152         uint32 location_ptr;
1153         uint32 devmode_ptr;
1154         uint32 sepfile_ptr;
1155         uint32 printprocessor_ptr;
1156         uint32 datatype_ptr;
1157         uint32 parameters_ptr;
1158         uint32 secdesc_ptr;
1159         uint32 attributes;
1160         uint32 priority;
1161         uint32 default_priority;
1162         uint32 starttime;
1163         uint32 untiltime;
1164         uint32 status;
1165         uint32 cjobs;
1166         uint32 averageppm;
1167         UNISTR2 servername;
1168         UNISTR2 printername;
1169         UNISTR2 sharename;
1170         UNISTR2 portname;
1171         UNISTR2 drivername;
1172         UNISTR2 comment;
1173         UNISTR2 location;
1174         UNISTR2 sepfile;
1175         UNISTR2 printprocessor;
1176         UNISTR2 datatype;
1177         UNISTR2 parameters;
1178         SEC_DESC_BUF *secdesc;
1179 } SPOOL_PRINTER_INFO_LEVEL_2;
1180
1181 typedef struct spool_printer_info_level
1182 {
1183         SPOOL_PRINTER_INFO_LEVEL_2 *info_2;
1184 } SPOOL_PRINTER_INFO_LEVEL;
1185
1186 typedef struct spool_printer_driver_info_level_3
1187 {
1188         uint32 cversion;
1189         uint32 name_ptr;
1190         uint32 environment_ptr;
1191         uint32 driverpath_ptr;
1192         uint32 datafile_ptr;
1193         uint32 configfile_ptr;
1194         uint32 helpfile_ptr;
1195         uint32 monitorname_ptr;
1196         uint32 defaultdatatype_ptr;
1197         uint32 dependentfilessize;
1198         uint32 dependentfiles_ptr;
1199
1200         UNISTR2 name;
1201         UNISTR2 environment;
1202         UNISTR2 driverpath;
1203         UNISTR2 datafile;
1204         UNISTR2 configfile;
1205         UNISTR2 helpfile;
1206         UNISTR2 monitorname;
1207         UNISTR2 defaultdatatype;
1208         BUFFER5 dependentfiles;
1209
1210 } SPOOL_PRINTER_DRIVER_INFO_LEVEL_3;
1211
1212 typedef struct spool_printer_driver_info_level
1213 {
1214         SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *info_3;
1215 } SPOOL_PRINTER_DRIVER_INFO_LEVEL;
1216
1217
1218 /* this struct is undocumented */
1219 /* thanks to the ddk ... */
1220 typedef struct spool_user_level_1
1221 {
1222         uint32 size;
1223         uint32 client_name_ptr;
1224         uint32 user_name_ptr;
1225         uint32 build;
1226         uint32 major;
1227         uint32 minor;
1228         uint32 processor;
1229         UNISTR2 client_name;
1230         UNISTR2 user_name;
1231 } SPOOL_USER_LEVEL_1;
1232
1233 typedef struct spool_user_level
1234 {
1235         SPOOL_USER_LEVEL_1 *user_level_1;
1236 } SPOOL_USER_LEVEL;
1237
1238 typedef struct spool_q_setprinter
1239 {
1240         PRINTER_HND handle;
1241         uint32 level;
1242         SPOOL_PRINTER_INFO_LEVEL info;
1243
1244         DEVICEMODE *devmode;
1245         struct
1246         {
1247                 uint32 size_of_buffer;
1248                 uint32 data;
1249         } security;
1250
1251         uint32 command;
1252 } SPOOL_Q_SETPRINTER;
1253
1254 typedef struct spool_r_setprinter
1255 {
1256         uint32 status;
1257 } SPOOL_R_SETPRINTER;
1258
1259 typedef struct spool_q_addprinter
1260 {
1261         UNISTR2 server_name;
1262         uint32 level;
1263         SPOOL_PRINTER_INFO_LEVEL info;
1264         uint32 unk0;
1265         uint32 unk1;
1266         uint32 unk2;
1267         uint32 unk3;
1268         uint32 user_level;
1269         SPOOL_USER_LEVEL user;
1270 } SPOOL_Q_ADDPRINTER;
1271
1272 typedef struct spool_r_addprinter
1273 {
1274         uint32 status;
1275 } SPOOL_R_ADDPRINTER;
1276
1277 typedef struct spool_q_addprinterex
1278 {
1279         UNISTR2 server_name;
1280         uint32 level;
1281         SPOOL_PRINTER_INFO_LEVEL info;
1282         uint32 unk0;
1283         uint32 unk1;
1284         uint32 unk2;
1285         uint32 unk3;
1286         uint32 user_level;
1287         SPOOL_USER_LEVEL user;
1288 } SPOOL_Q_ADDPRINTEREX;
1289
1290
1291 typedef struct spool_r_addprinterex
1292 {
1293         PRINTER_HND handle;
1294         uint32 status;
1295 } SPOOL_R_ADDPRINTEREX;
1296
1297 typedef struct spool_q_addprinterdriver
1298 {
1299         UNISTR2 server_name;
1300         uint32 level;
1301         SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
1302 } SPOOL_Q_ADDPRINTERDRIVER;
1303
1304 typedef struct spool_r_addprinterdriver
1305 {
1306         uint32 status;
1307 } SPOOL_R_ADDPRINTERDRIVER;
1308
1309 typedef struct spool_q_getprinterdriverdirectory
1310 {
1311         UNISTR2 name;
1312         UNISTR2 environment;
1313         uint32 level;
1314         BUFFER buffer;
1315         uint32 buf_size;
1316 } SPOOL_Q_GETPRINTERDRIVERDIR;
1317
1318 typedef struct driver_directory_1
1319 {
1320         UNISTR name;
1321 } DRIVER_DIRECTORY_1 ;
1322
1323 typedef struct spool_r_getprinterdriverdirectory
1324 {
1325         uint32 level;
1326         union {
1327                 DRIVER_DIRECTORY_1 driver_info_1;
1328         } driver;
1329         uint32 offered;
1330         uint32 status;
1331 } SPOOL_R_GETPRINTERDRIVERDIR;
1332
1333 typedef struct spool_q_enumprintprocessors
1334 {
1335         UNISTR2 name;
1336         UNISTR2 environment;
1337         uint32 level;
1338         BUFFER buffer;
1339         uint32 buf_size;
1340 } SPOOL_Q_ENUMPRINTPROCESSORS;
1341
1342 typedef struct printprocessor_1
1343 {
1344         UNISTR name;
1345 } PRINTPROCESSOR_1;
1346
1347 typedef struct spool_r_enumprintprocessors
1348 {
1349         uint32 level;
1350         PRINTPROCESSOR_1 *info_1;
1351         uint32 offered;
1352         uint32 numofprintprocessors;
1353         uint32 status;
1354 } SPOOL_R_ENUMPRINTPROCESSORS;
1355
1356 typedef struct spool_q_enumprintprocessordatatypes
1357 {
1358         UNISTR2 name;
1359         UNISTR2 printprocessor;
1360         uint32 level;
1361         BUFFER buffer;
1362         uint32 buf_size;
1363 } SPOOL_Q_ENUMPRINTPROCESSORDATATYPES;
1364
1365 typedef struct ppdatatype_1
1366 {
1367         UNISTR name;
1368 } PPDATATYPE_1;
1369
1370 typedef struct spool_r_enumprintprocessordatatypes
1371 {
1372         uint32 level;
1373         PPDATATYPE_1 *info_1;
1374         uint32 offered;
1375         uint32 numofppdatatypes;
1376         uint32 status;
1377 } SPOOL_R_ENUMPRINTPROCESSORDATATYPES;
1378
1379 typedef struct spool_q_enumprintmonitors
1380 {
1381         UNISTR2 name;
1382         uint32 level;
1383         BUFFER buffer;
1384         uint32 buf_size;
1385 } SPOOL_Q_ENUMPRINTMONITORS;
1386
1387 typedef struct printmonitor_1
1388 {
1389         UNISTR name;
1390 } PRINTMONITOR_1;
1391
1392 typedef struct spool_r_enumprintmonitors
1393 {
1394         uint32 level;
1395         PRINTMONITOR_1 *info_1;
1396         uint32 offered;
1397         uint32 numofprintmonitors;
1398         uint32 status;
1399 } SPOOL_R_ENUMPRINTMONITORS;
1400
1401 typedef struct spool_q_enumprinterdata
1402 {
1403         PRINTER_HND handle;
1404         uint32 index;
1405         uint32 valuesize;
1406         uint32 datasize;
1407 } SPOOL_Q_ENUMPRINTERDATA;
1408
1409 typedef struct spool_r_enumprinterdata
1410 {
1411         uint32 valuesize;
1412         UNISTR value;
1413         uint32 realvaluesize;
1414         uint32 type;
1415         uint32 datasize;
1416         uint8  *data;
1417         uint32 realdatasize;
1418         uint32 status;
1419 } SPOOL_R_ENUMPRINTERDATA;
1420
1421 typedef struct spool_q_setprinterdata
1422 {
1423         PRINTER_HND handle;
1424         UNISTR2 value;
1425         uint32 type;
1426         uint32 max_len;
1427         uint8 *data;
1428         uint32 real_len;
1429         uint32 numeric_data;
1430 } SPOOL_Q_SETPRINTERDATA;
1431
1432 typedef struct spool_r_setprinterdata
1433 {
1434         uint32 status;
1435 } SPOOL_R_SETPRINTERDATA;
1436
1437 typedef struct _form
1438 {
1439        uint32 flags;
1440        uint32 name_ptr;
1441        uint32 size_x;
1442        uint32 size_y;
1443        uint32 left;
1444        uint32 top;
1445        uint32 right;
1446        uint32 bottom;
1447        UNISTR2 name;
1448 } FORM;
1449
1450 typedef struct spool_q_addform
1451 {
1452         PRINTER_HND handle;
1453         uint32 level;
1454         uint32 level2;
1455         FORM form;
1456 } SPOOL_Q_ADDFORM;
1457
1458 typedef struct spool_r_addform
1459 {
1460         uint32 status;
1461 } SPOOL_R_ADDFORM;
1462
1463 typedef struct spool_q_setform
1464 {
1465         PRINTER_HND handle;
1466         UNISTR2 name;
1467         uint32 level;
1468         uint32 level2;
1469         FORM form;
1470 } SPOOL_Q_SETFORM;
1471
1472 typedef struct spool_r_setform
1473 {
1474         uint32 status;
1475 } SPOOL_R_SETFORM;
1476
1477 typedef struct spool_q_getjob
1478 {
1479         PRINTER_HND handle;
1480         uint32 jobid;
1481         uint32 level;
1482         BUFFER buffer;
1483         uint32 buf_size;
1484 } SPOOL_Q_GETJOB;
1485
1486 typedef struct spool_r_getjob
1487 {
1488         uint32 level;
1489         union {
1490                 JOB_INFO_1 *job_info_1;
1491                 JOB_INFO_2 *job_info_2;
1492         } job;
1493         uint32 offered;
1494         uint32 status;
1495 } SPOOL_R_GETJOB;
1496
1497 #define PRINTER_DRIVER_VERSION 2
1498 #define PRINTER_DRIVER_ARCHITECTURE "Windows NT x86"
1499
1500
1501 #endif /* _RPC_SPOOLSS_H */
1502